From bbd179200cafad9fc0a8b0f4a9e280dbc807b46d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Wed, 1 Dec 2021 10:36:15 +0100 Subject: [PATCH] Use device class enum in UptimeRobot (#60688) --- homeassistant/components/uptimerobot/binary_sensor.py | 4 ++-- tests/components/uptimerobot/test_binary_sensor.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/uptimerobot/binary_sensor.py b/homeassistant/components/uptimerobot/binary_sensor.py index 09ce3262d81..43aed00708d 100644 --- a/homeassistant/components/uptimerobot/binary_sensor.py +++ b/homeassistant/components/uptimerobot/binary_sensor.py @@ -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, ) diff --git a/tests/components/uptimerobot/test_binary_sensor.py b/tests/components/uptimerobot/test_binary_sensor.py index 8a5c4f623e0..25ca76a2914 100644 --- a/tests/components/uptimerobot/test_binary_sensor.py +++ b/tests/components/uptimerobot/test_binary_sensor.py @@ -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"]