Use device class enum in UptimeRobot (#60688)

This commit is contained in:
Joakim Sørensen 2021-12-01 10:36:15 +01:00 committed by GitHub
parent 79ebc1b79a
commit bbd179200c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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,
)

View file

@ -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"]