Restore attributes of template binary sensor (#69350)

This commit is contained in:
Erik Montnemery 2022-04-06 07:58:12 +02:00 committed by GitHub
parent 79dc551f5a
commit 7b5dd4a623
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 70 additions and 12 deletions

View file

@ -331,6 +331,7 @@ class TriggerBinarySensorEntity(TriggerEntity, BinarySensorEntity, RestoreEntity
and self._state is None
):
self._state = last_state.state == STATE_ON
self.restore_attributes(last_state)
if CONF_AUTO_OFF not in self._config:
return