From a5c2a80db3ade00f331ff0867275657e7063a1ad Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Tue, 23 Jul 2019 14:05:15 -0600 Subject: [PATCH] Add area support to input boolean service schemas (#25429) --- .../components/input_boolean/__init__.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/input_boolean/__init__.py b/homeassistant/components/input_boolean/__init__.py index 246af2613a7..833142a60b5 100644 --- a/homeassistant/components/input_boolean/__init__.py +++ b/homeassistant/components/input_boolean/__init__.py @@ -4,10 +4,11 @@ import logging import voluptuous as vol from homeassistant.const import ( - ATTR_ENTITY_ID, CONF_ICON, CONF_NAME, SERVICE_TURN_OFF, SERVICE_TURN_ON, - SERVICE_TOGGLE, STATE_ON) + CONF_ICON, CONF_NAME, SERVICE_TURN_OFF, SERVICE_TURN_ON, SERVICE_TOGGLE, + STATE_ON) from homeassistant.loader import bind_hass import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.config_validation import ENTITY_SERVICE_SCHEMA from homeassistant.helpers.entity import ToggleEntity from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.restore_state import RestoreEntity @@ -20,10 +21,6 @@ _LOGGER = logging.getLogger(__name__) CONF_INITIAL = 'initial' -SERVICE_SCHEMA = vol.Schema({ - vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, -}) - CONFIG_SCHEMA = vol.Schema({ DOMAIN: cv.schema_with_slug_keys( vol.Any({ @@ -61,17 +58,17 @@ async def async_setup(hass, config): return False component.async_register_entity_service( - SERVICE_TURN_ON, SERVICE_SCHEMA, + SERVICE_TURN_ON, ENTITY_SERVICE_SCHEMA, 'async_turn_on' ) component.async_register_entity_service( - SERVICE_TURN_OFF, SERVICE_SCHEMA, + SERVICE_TURN_OFF, ENTITY_SERVICE_SCHEMA, 'async_turn_off' ) component.async_register_entity_service( - SERVICE_TOGGLE, SERVICE_SCHEMA, + SERVICE_TOGGLE, ENTITY_SERVICE_SCHEMA, 'async_toggle' )