Remove unneeded from_state from device triggers (#45152)
This commit is contained in:
parent
8efb5eea4d
commit
f99c27c6d4
7 changed files with 4 additions and 26 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue