Use device class enum in UptimeRobot (#60688)
This commit is contained in:
parent
79ebc1b79a
commit
bbd179200c
2 changed files with 4 additions and 4 deletions
|
@ -2,7 +2,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_CONNECTIVITY,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
BinarySensorEntityDescription,
|
||||
)
|
||||
|
@ -27,7 +27,7 @@ async def async_setup_entry(
|
|||
BinarySensorEntityDescription(
|
||||
key=str(monitor.id),
|
||||
name=monitor.friendly_name,
|
||||
device_class=DEVICE_CLASS_CONNECTIVITY,
|
||||
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
||||
),
|
||||
monitor=monitor,
|
||||
)
|
||||
|
|
|
@ -4,7 +4,7 @@ from unittest.mock import patch
|
|||
|
||||
from pyuptimerobot import UptimeRobotAuthenticationException
|
||||
|
||||
from homeassistant.components.binary_sensor import DEVICE_CLASS_CONNECTIVITY
|
||||
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
|
||||
from homeassistant.components.uptimerobot.const import (
|
||||
ATTRIBUTION,
|
||||
COORDINATOR_UPDATE_INTERVAL,
|
||||
|
@ -29,7 +29,7 @@ async def test_presentation(hass: HomeAssistant) -> None:
|
|||
entity = hass.states.get(UPTIMEROBOT_TEST_ENTITY)
|
||||
|
||||
assert entity.state == STATE_ON
|
||||
assert entity.attributes["device_class"] == DEVICE_CLASS_CONNECTIVITY
|
||||
assert entity.attributes["device_class"] == BinarySensorDeviceClass.CONNECTIVITY
|
||||
assert entity.attributes["attribution"] == ATTRIBUTION
|
||||
assert entity.attributes["target"] == MOCK_UPTIMEROBOT_MONITOR["url"]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue