Cover state is enum (#127144)

* Change light state to use enum

* Adjust cover tests

* Update cover

* Fix covers

* Some tests

* More tests

* Fix tests

* Fix
This commit is contained in:
G Johansson
2024-10-08 18:39:04 +02:00
committed by GitHub
parent 959898e0fc
commit 666e8e133e
65 changed files with 1011 additions and 1032 deletions

View File

@@ -3,13 +3,12 @@
from unittest.mock import patch
from homeassistant.components.abode import ATTR_DEVICE_ID
from homeassistant.components.cover import DOMAIN as COVER_DOMAIN
from homeassistant.components.cover import DOMAIN as COVER_DOMAIN, CoverState
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_FRIENDLY_NAME,
SERVICE_CLOSE_COVER,
SERVICE_OPEN_COVER,
STATE_CLOSED,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
@@ -34,7 +33,7 @@ async def test_attributes(hass: HomeAssistant) -> None:
await setup_platform(hass, COVER_DOMAIN)
state = hass.states.get(DEVICE_ID)
assert state.state == STATE_CLOSED
assert state.state == CoverState.CLOSED
assert state.attributes.get(ATTR_DEVICE_ID) == "ZW:00000007"
assert not state.attributes.get("battery_low")
assert not state.attributes.get("no_response")