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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)