mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Add area support to scene service schemas (#25438)
This commit is contained in:
parent
80051b7fc2
commit
ee7ec5f234
@ -5,8 +5,8 @@ import logging
|
|||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID, CONF_PLATFORM, SERVICE_TURN_ON
|
from homeassistant.const import CONF_PLATFORM, SERVICE_TURN_ON
|
||||||
import homeassistant.helpers.config_validation as cv
|
from homeassistant.helpers.config_validation import ENTITY_SERVICE_SCHEMA
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.helpers.entity_component import EntityComponent
|
from homeassistant.helpers.entity_component import EntityComponent
|
||||||
from homeassistant.helpers.state import HASS_DOMAIN
|
from homeassistant.helpers.state import HASS_DOMAIN
|
||||||
@ -52,10 +52,6 @@ PLATFORM_SCHEMA = vol.Schema(
|
|||||||
_platform_validator
|
_platform_validator
|
||||||
), extra=vol.ALLOW_EXTRA)
|
), extra=vol.ALLOW_EXTRA)
|
||||||
|
|
||||||
SCENE_SERVICE_SCHEMA = vol.Schema({
|
|
||||||
vol.Required(ATTR_ENTITY_ID): cv.entity_ids,
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup(hass, config):
|
async def async_setup(hass, config):
|
||||||
"""Set up the scenes."""
|
"""Set up the scenes."""
|
||||||
@ -74,7 +70,7 @@ async def async_setup(hass, config):
|
|||||||
|
|
||||||
hass.services.async_register(
|
hass.services.async_register(
|
||||||
DOMAIN, SERVICE_TURN_ON, async_handle_scene_service,
|
DOMAIN, SERVICE_TURN_ON, async_handle_scene_service,
|
||||||
schema=SCENE_SERVICE_SCHEMA)
|
schema=ENTITY_SERVICE_SCHEMA)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user