Use DeviceClass Enums in gogogate2 tests (#62137)
This commit is contained in:
parent
28e373297f
commit
4418b0a43e
2 changed files with 6 additions and 8 deletions
|
@ -16,11 +16,10 @@ from ismartgate.common import (
|
|||
)
|
||||
|
||||
from homeassistant.components.cover import (
|
||||
DEVICE_CLASS_GARAGE,
|
||||
DEVICE_CLASS_GATE,
|
||||
DOMAIN as COVER_DOMAIN,
|
||||
SUPPORT_CLOSE,
|
||||
SUPPORT_OPEN,
|
||||
CoverDeviceClass,
|
||||
)
|
||||
from homeassistant.components.gogogate2.const import (
|
||||
DEVICE_TYPE_GOGOGATE2,
|
||||
|
@ -282,11 +281,11 @@ async def test_availability(ismartgateapi_mock, hass: HomeAssistant) -> None:
|
|||
assert hass.states.get("cover.door1")
|
||||
assert (
|
||||
hass.states.get("cover.door1").attributes[ATTR_DEVICE_CLASS]
|
||||
== DEVICE_CLASS_GARAGE
|
||||
== CoverDeviceClass.GARAGE
|
||||
)
|
||||
assert (
|
||||
hass.states.get("cover.door2").attributes[ATTR_DEVICE_CLASS]
|
||||
== DEVICE_CLASS_GATE
|
||||
== CoverDeviceClass.GATE
|
||||
)
|
||||
|
||||
api.async_info.side_effect = Exception("Error")
|
||||
|
|
|
@ -17,6 +17,7 @@ from ismartgate.common import (
|
|||
)
|
||||
|
||||
from homeassistant.components.gogogate2.const import DEVICE_TYPE_ISMARTGATE, DOMAIN
|
||||
from homeassistant.components.sensor import SensorDeviceClass
|
||||
from homeassistant.config_entries import SOURCE_USER
|
||||
from homeassistant.const import (
|
||||
ATTR_DEVICE_CLASS,
|
||||
|
@ -25,8 +26,6 @@ from homeassistant.const import (
|
|||
CONF_IP_ADDRESS,
|
||||
CONF_PASSWORD,
|
||||
CONF_USERNAME,
|
||||
DEVICE_CLASS_BATTERY,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
STATE_UNAVAILABLE,
|
||||
STATE_UNKNOWN,
|
||||
)
|
||||
|
@ -296,11 +295,11 @@ async def test_availability(ismartgateapi_mock, hass: HomeAssistant) -> None:
|
|||
assert hass.states.get("sensor.door3_temperature") is None
|
||||
assert (
|
||||
hass.states.get("sensor.door1_battery").attributes[ATTR_DEVICE_CLASS]
|
||||
== DEVICE_CLASS_BATTERY
|
||||
== SensorDeviceClass.BATTERY
|
||||
)
|
||||
assert (
|
||||
hass.states.get("sensor.door1_temperature").attributes[ATTR_DEVICE_CLASS]
|
||||
== DEVICE_CLASS_TEMPERATURE
|
||||
== SensorDeviceClass.TEMPERATURE
|
||||
)
|
||||
assert (
|
||||
hass.states.get("sensor.door1_temperature").attributes[ATTR_UNIT_OF_MEASUREMENT]
|
||||
|
|
Loading…
Add table
Reference in a new issue