mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 15:26:59 +00:00
easier return entity state object of a trigger (#16294)
replacing `states[trigger.to_state.domain][trigger.to_state.object_id]` with `states[trigger.to_state.entity_id]` for better readability and keeping the same function.
This commit is contained in:
parent
c39398288a
commit
5f1efdeeb6
@ -67,7 +67,7 @@ Knowing how to access the [state object](/docs/configuration/state_object/) of a
|
|||||||
|
|
||||||
* `trigger.from_state` will return the **previous** [state object](/docs/configuration/state_object/) of the entity.
|
* `trigger.from_state` will return the **previous** [state object](/docs/configuration/state_object/) of the entity.
|
||||||
* `trigger.to_state` will return the **new** [state object](/docs/configuration/state_object/) that triggered trigger.
|
* `trigger.to_state` will return the **new** [state object](/docs/configuration/state_object/) that triggered trigger.
|
||||||
* `states[trigger.to_state.domain][trigger.to_state.object_id]` will return the **current** [state object](/docs/configuration/state_object/) of the entity.
|
* `states[trigger.to_state.entity_id]` will return the **current** [state object](/docs/configuration/state_object/) of the entity.
|
||||||
|
|
||||||
<div class='note'>
|
<div class='note'>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user