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:
MagieMalone 2021-01-25 12:34:36 +01:00 committed by GitHub
parent c39398288a
commit 5f1efdeeb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.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'>