From ac0fa3cbf8d932c1718e37147877baaefc9d5dbe Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Sat, 18 Dec 2021 14:51:39 +0100 Subject: [PATCH] Use new enums in smarttub (#62216) Co-authored-by: epenet --- homeassistant/components/smarttub/binary_sensor.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/smarttub/binary_sensor.py b/homeassistant/components/smarttub/binary_sensor.py index ead0e6a0dce..f5af1655255 100644 --- a/homeassistant/components/smarttub/binary_sensor.py +++ b/homeassistant/components/smarttub/binary_sensor.py @@ -5,8 +5,7 @@ from smarttub import SpaError, SpaReminder import voluptuous as vol from homeassistant.components.binary_sensor import ( - DEVICE_CLASS_CONNECTIVITY, - DEVICE_CLASS_PROBLEM, + BinarySensorDeviceClass, BinarySensorEntity, ) from homeassistant.helpers import entity_platform @@ -71,7 +70,7 @@ async def async_setup_entry(hass, entry, async_add_entities): class SmartTubOnline(SmartTubSensorBase, BinarySensorEntity): """A binary sensor indicating whether the spa is currently online (connected to the cloud).""" - _attr_device_class = DEVICE_CLASS_CONNECTIVITY + _attr_device_class = BinarySensorDeviceClass.CONNECTIVITY def __init__(self, coordinator, spa): """Initialize the entity.""" @@ -94,7 +93,7 @@ class SmartTubOnline(SmartTubSensorBase, BinarySensorEntity): class SmartTubReminder(SmartTubEntity, BinarySensorEntity): """Reminders for maintenance actions.""" - _attr_device_class = DEVICE_CLASS_PROBLEM + _attr_device_class = BinarySensorDeviceClass.PROBLEM def __init__(self, coordinator, spa, reminder): """Initialize the entity.""" @@ -145,7 +144,7 @@ class SmartTubError(SmartTubEntity, BinarySensorEntity): There may be 0 or more errors. If there are >0, we show the first one. """ - _attr_device_class = DEVICE_CLASS_PROBLEM + _attr_device_class = BinarySensorDeviceClass.PROBLEM def __init__(self, coordinator, spa): """Initialize the entity."""