Allow passing dictionaries to async_register_entity_service (#26370)

This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2019-09-03 09:50:24 +02:00
1 parent df9703d814
commit 0cffd61481
3 files changed
+12 -15

No files matched your search

+3 -12
View File
@@ -10,7 +10,6 @@ from homeassistant.helpers.entity import ToggleEntity
from homeassistant.helpers.config_validation import ( # noqa
PLATFORM_SCHEMA,
PLATFORM_SCHEMA_BASE,
ENTITY_SERVICE_SCHEMA,
)
from homeassistant.const import (
STATE_ON,
@@ -68,17 +67,9 @@ async def async_setup(hass, config):
)
await component.async_setup(config)
component.async_register_entity_service(
SERVICE_TURN_OFF, ENTITY_SERVICE_SCHEMA, "async_turn_off"
)
component.async_register_entity_service(
SERVICE_TURN_ON, ENTITY_SERVICE_SCHEMA, "async_turn_on"
)
component.async_register_entity_service(
SERVICE_TOGGLE, ENTITY_SERVICE_SCHEMA, "async_toggle"
)
component.async_register_entity_service(SERVICE_TURN_OFF, {}, "async_turn_off")
component.async_register_entity_service(SERVICE_TURN_ON, {}, "async_turn_on")
component.async_register_entity_service(SERVICE_TOGGLE, {}, "async_toggle")
return True