YoLink fix cover incorrect state (#104975)
* Fix cover incorrect state * Change entity to unavailablepull/113887/head
parent
0e7e1cb34f
commit
3b0ac469d4
|
@ -60,11 +60,13 @@ class YoLinkCoverEntity(YoLinkEntity, CoverEntity):
|
|||
"""Update HA Entity State."""
|
||||
if (state_val := state.get("state")) is None:
|
||||
return
|
||||
if self.coordinator.paired_device is None:
|
||||
if self.coordinator.paired_device is None or state_val == "error":
|
||||
self._attr_is_closed = None
|
||||
self._attr_available = False
|
||||
self.async_write_ha_state()
|
||||
elif state_val in ["open", "closed"]:
|
||||
self._attr_is_closed = state_val == "closed"
|
||||
self._attr_available = True
|
||||
self.async_write_ha_state()
|
||||
|
||||
async def toggle_garage_state(self) -> None:
|
||||
|
|
Loading…
Reference in New Issue