mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Fix Shelly gen2 cover unavailable when not calibrated (#69671)
This commit is contained in:
parent
06d2aeec6b
commit
06e4c2f351
@ -158,9 +158,6 @@ class RpcShellyCover(ShellyRpcEntity, CoverEntity):
|
|||||||
@property
|
@property
|
||||||
def is_closed(self) -> bool | None:
|
def is_closed(self) -> bool | None:
|
||||||
"""If cover is closed."""
|
"""If cover is closed."""
|
||||||
if not self.status["pos_control"]:
|
|
||||||
return None
|
|
||||||
|
|
||||||
return cast(bool, self.status["state"] == "closed")
|
return cast(bool, self.status["state"] == "closed")
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -12,7 +12,7 @@ from homeassistant.components.cover import (
|
|||||||
STATE_OPEN,
|
STATE_OPEN,
|
||||||
STATE_OPENING,
|
STATE_OPENING,
|
||||||
)
|
)
|
||||||
from homeassistant.const import ATTR_ENTITY_ID, STATE_UNKNOWN
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
from homeassistant.helpers.entity_component import async_update_entity
|
from homeassistant.helpers.entity_component import async_update_entity
|
||||||
|
|
||||||
ROLLER_BLOCK_ID = 1
|
ROLLER_BLOCK_ID = 1
|
||||||
@ -189,4 +189,4 @@ async def test_rpc_device_no_position_control(hass, rpc_wrapper, monkeypatch):
|
|||||||
|
|
||||||
await async_update_entity(hass, "cover.test_cover_0")
|
await async_update_entity(hass, "cover.test_cover_0")
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
assert hass.states.get("cover.test_cover_0").state == STATE_UNKNOWN
|
assert hass.states.get("cover.test_cover_0").state == STATE_OPEN
|
||||||
|
Loading…
x
Reference in New Issue
Block a user