Fix ZHA cover initial state (#71083)

This commit is contained in:
David F. Mulcahey 2022-04-29 18:35:53 -04:00 committed by GitHub
parent 7f094a928b
commit f184f9e142
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 18 deletions

View file

@ -86,12 +86,6 @@ class ZHAEnumSelectEntity(ZhaEntity, SelectEntity):
self._channel.data_cache[self._attr_name] = self._enum[option.replace(" ", "_")]
self.async_write_ha_state()
async def async_added_to_hass(self) -> None:
"""Run when about to be added to hass."""
await super().async_added_to_hass()
if last_state := await self.async_get_last_state():
self.async_restore_last_state(last_state)
@callback
def async_restore_last_state(self, last_state) -> None:
"""Restore previous state."""