1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Remove unneeded from_state from device triggers (#45152)

This commit is contained in:
Erik Montnemery
2021-02-08 11:09:45 +01:00
committed by GitHub
parent 8efb5eea4d
commit f99c27c6d4
7 changed files with 4 additions and 26 deletions

View File

@@ -84,16 +84,13 @@ async def async_attach_trigger(
# Use the existing state or event triggers from the automation integration.
if config[CONF_TYPE] == "turned_on":
from_state = STATE_OFF
to_state = STATE_ON
else:
from_state = STATE_ON
to_state = STATE_OFF
state_config = {
state.CONF_PLATFORM: "state",
CONF_ENTITY_ID: config[CONF_ENTITY_ID],
state.CONF_FROM: from_state,
state.CONF_TO: to_state,
}
state_config = state.TRIGGER_SCHEMA(state_config)