mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add area support to remote service schemas (#25437)
* Add area support to remote service schemas * Base
This commit is contained in:
parent
5e2dfb14fb
commit
e4b4551b35
@ -10,11 +10,10 @@ from homeassistant.helpers.entity_component import EntityComponent
|
|||||||
from homeassistant.helpers.entity import ToggleEntity
|
from homeassistant.helpers.entity import ToggleEntity
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
STATE_ON, SERVICE_TURN_ON, SERVICE_TURN_OFF, SERVICE_TOGGLE,
|
STATE_ON, SERVICE_TURN_ON, SERVICE_TURN_OFF, SERVICE_TOGGLE)
|
||||||
ATTR_ENTITY_ID)
|
|
||||||
from homeassistant.components import group
|
from homeassistant.components import group
|
||||||
from homeassistant.helpers.config_validation import ( # noqa
|
from homeassistant.helpers.config_validation import ( # noqa
|
||||||
PLATFORM_SCHEMA, PLATFORM_SCHEMA_BASE)
|
ENTITY_SERVICE_SCHEMA, PLATFORM_SCHEMA, PLATFORM_SCHEMA_BASE)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -47,9 +46,9 @@ DEFAULT_HOLD_SECS = 0
|
|||||||
|
|
||||||
SUPPORT_LEARN_COMMAND = 1
|
SUPPORT_LEARN_COMMAND = 1
|
||||||
|
|
||||||
REMOTE_SERVICE_SCHEMA = vol.Schema({
|
# Keep this in place so that platforms don't have to directly know about
|
||||||
vol.Optional(ATTR_ENTITY_ID): cv.comp_entity_ids,
|
# ENTITY_SERVICE_SCHEMA:
|
||||||
})
|
REMOTE_SERVICE_SCHEMA = ENTITY_SERVICE_SCHEMA
|
||||||
|
|
||||||
REMOTE_SERVICE_ACTIVITY_SCHEMA = REMOTE_SERVICE_SCHEMA.extend({
|
REMOTE_SERVICE_ACTIVITY_SCHEMA = REMOTE_SERVICE_SCHEMA.extend({
|
||||||
vol.Optional(ATTR_ACTIVITY): cv.string
|
vol.Optional(ATTR_ACTIVITY): cv.string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user