mirror of
https://github.com/home-assistant/core.git
synced 2025-11-05 17:09:32 +00:00
Simplify track_same_state (#9795)
This commit is contained in:
committed by
Pascal Vizeli
parent
fc47e9443b
commit
a97e7bb22d
@@ -65,7 +65,9 @@ def async_trigger(hass, config, action):
|
||||
return
|
||||
|
||||
async_remove_track_same = async_track_same_state(
|
||||
hass, to_s.state, time_delta, call_action, entity_ids=entity_id)
|
||||
hass, time_delta, call_action,
|
||||
lambda _, _2, to_state: to_state.state == to_s.state,
|
||||
entity_ids=entity_id)
|
||||
|
||||
unsub = async_track_state_change(
|
||||
hass, entity_id, state_automation_listener, from_state, to_state)
|
||||
|
||||
Reference in New Issue
Block a user