mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Use new enums in smarttub (#62216)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
051a6499b8
commit
ac0fa3cbf8
@ -5,8 +5,7 @@ from smarttub import SpaError, SpaReminder
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_CONNECTIVITY,
|
BinarySensorDeviceClass,
|
||||||
DEVICE_CLASS_PROBLEM,
|
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.helpers import entity_platform
|
from homeassistant.helpers import entity_platform
|
||||||
@ -71,7 +70,7 @@ async def async_setup_entry(hass, entry, async_add_entities):
|
|||||||
class SmartTubOnline(SmartTubSensorBase, BinarySensorEntity):
|
class SmartTubOnline(SmartTubSensorBase, BinarySensorEntity):
|
||||||
"""A binary sensor indicating whether the spa is currently online (connected to the cloud)."""
|
"""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):
|
def __init__(self, coordinator, spa):
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
@ -94,7 +93,7 @@ class SmartTubOnline(SmartTubSensorBase, BinarySensorEntity):
|
|||||||
class SmartTubReminder(SmartTubEntity, BinarySensorEntity):
|
class SmartTubReminder(SmartTubEntity, BinarySensorEntity):
|
||||||
"""Reminders for maintenance actions."""
|
"""Reminders for maintenance actions."""
|
||||||
|
|
||||||
_attr_device_class = DEVICE_CLASS_PROBLEM
|
_attr_device_class = BinarySensorDeviceClass.PROBLEM
|
||||||
|
|
||||||
def __init__(self, coordinator, spa, reminder):
|
def __init__(self, coordinator, spa, reminder):
|
||||||
"""Initialize the entity."""
|
"""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.
|
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):
|
def __init__(self, coordinator, spa):
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user