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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user