mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +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
|
||||
|
||||
from homeassistant.const import ATTR_ENTITY_ID, CONF_PLATFORM, SERVICE_TURN_ON
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.const import CONF_PLATFORM, SERVICE_TURN_ON
|
||||
from homeassistant.helpers.config_validation import ENTITY_SERVICE_SCHEMA
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.entity_component import EntityComponent
|
||||
from homeassistant.helpers.state import HASS_DOMAIN
|
||||
@ -52,10 +52,6 @@ PLATFORM_SCHEMA = vol.Schema(
|
||||
_platform_validator
|
||||
), extra=vol.ALLOW_EXTRA)
|
||||
|
||||
SCENE_SERVICE_SCHEMA = vol.Schema({
|
||||
vol.Required(ATTR_ENTITY_ID): cv.entity_ids,
|
||||
})
|
||||
|
||||
|
||||
async def async_setup(hass, config):
|
||||
"""Set up the scenes."""
|
||||
@ -74,7 +70,7 @@ async def async_setup(hass, config):
|
||||
|
||||
hass.services.async_register(
|
||||
DOMAIN, SERVICE_TURN_ON, async_handle_scene_service,
|
||||
schema=SCENE_SERVICE_SCHEMA)
|
||||
schema=ENTITY_SERVICE_SCHEMA)
|
||||
|
||||
return True
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user