Make sure command entities restore from state (#38038)

This commit is contained in:
Joakim Plate authored and GitHub committed 2020-07-22 00:01:31 +02:00
1 parent ad5d7ee615
commit 945acb4e29
11 files changed
+182 -11

No files matched your search

@@ -398,12 +398,6 @@ class RfxtrxEntity(RestoreEntity):
"""Restore RFXtrx device state (ON/OFF)."""
if self._event:
self._apply_event(self._event)
else:
old_state = await self.async_get_last_state()
if old_state is not None:
event = old_state.attributes.get(ATTR_EVENT)
if event:
self._apply_event(get_rfx_object(event))
self.async_on_remove(
self.hass.helpers.dispatcher.async_dispatcher_connect(