Add area support to lock service schemas (#25435)
* Add area support to lock service schemas * extend * Fixed tests * Fixed tests
This commit is contained in:
1 parent
4c067ecff7
commit
5e2dfb14fb
3 files changed
+9
-9
No files matched your search
@@ -9,11 +9,11 @@ from homeassistant.loader import bind_hass
|
||||
from homeassistant.helpers.entity_component import EntityComponent
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.config_validation import ( # noqa
|
||||
PLATFORM_SCHEMA, PLATFORM_SCHEMA_BASE)
|
||||
ENTITY_SERVICE_SCHEMA, PLATFORM_SCHEMA, PLATFORM_SCHEMA_BASE)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.const import (
|
||||
ATTR_CODE, ATTR_CODE_FORMAT, ATTR_ENTITY_ID, STATE_LOCKED, STATE_UNLOCKED,
|
||||
SERVICE_LOCK, SERVICE_UNLOCK, SERVICE_OPEN)
|
||||
ATTR_CODE, ATTR_CODE_FORMAT, STATE_LOCKED, STATE_UNLOCKED, SERVICE_LOCK,
|
||||
SERVICE_UNLOCK, SERVICE_OPEN)
|
||||
from homeassistant.components import group
|
||||
|
||||
ATTR_CHANGED_BY = 'changed_by'
|
||||
@@ -28,8 +28,7 @@ GROUP_NAME_ALL_LOCKS = 'all locks'
|
||||
|
||||
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
||||
|
||||
LOCK_SERVICE_SCHEMA = vol.Schema({
|
||||
vol.Optional(ATTR_ENTITY_ID): cv.comp_entity_ids,
|
||||
LOCK_SERVICE_SCHEMA = ENTITY_SERVICE_SCHEMA.extend({
|
||||
vol.Optional(ATTR_CODE): cv.string,
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user