mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
YoLink fix cover incorrect state (#104975)
* Fix cover incorrect state * Change entity to unavailable
This commit is contained in:
parent
0e7e1cb34f
commit
3b0ac469d4
@ -60,11 +60,13 @@ class YoLinkCoverEntity(YoLinkEntity, CoverEntity):
|
|||||||
"""Update HA Entity State."""
|
"""Update HA Entity State."""
|
||||||
if (state_val := state.get("state")) is None:
|
if (state_val := state.get("state")) is None:
|
||||||
return
|
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_is_closed = None
|
||||||
|
self._attr_available = False
|
||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
elif state_val in ["open", "closed"]:
|
elif state_val in ["open", "closed"]:
|
||||||
self._attr_is_closed = state_val == "closed"
|
self._attr_is_closed = state_val == "closed"
|
||||||
|
self._attr_available = True
|
||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
|
|
||||||
async def toggle_garage_state(self) -> None:
|
async def toggle_garage_state(self) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user