diff --git a/homeassistant/components/flo/binary_sensor.py b/homeassistant/components/flo/binary_sensor.py index 88675e571e7..2118635d9ad 100644 --- a/homeassistant/components/flo/binary_sensor.py +++ b/homeassistant/components/flo/binary_sensor.py @@ -2,7 +2,7 @@ from __future__ import annotations from homeassistant.components.binary_sensor import ( - DEVICE_CLASS_PROBLEM, + BinarySensorDeviceClass, BinarySensorEntity, ) @@ -37,7 +37,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities): class FloPendingAlertsBinarySensor(FloEntity, BinarySensorEntity): """Binary sensor that reports on if there are any pending system alerts.""" - _attr_device_class = DEVICE_CLASS_PROBLEM + _attr_device_class = BinarySensorDeviceClass.PROBLEM def __init__(self, device): """Initialize the pending alerts binary sensor.""" @@ -63,7 +63,7 @@ class FloPendingAlertsBinarySensor(FloEntity, BinarySensorEntity): class FloWaterDetectedBinarySensor(FloEntity, BinarySensorEntity): """Binary sensor that reports if water is detected (for leak detectors).""" - _attr_device_class = DEVICE_CLASS_PROBLEM + _attr_device_class = BinarySensorDeviceClass.PROBLEM def __init__(self, device): """Initialize the pending alerts binary sensor.""" diff --git a/homeassistant/components/flo/sensor.py b/homeassistant/components/flo/sensor.py index b64ed9ee3e4..c98f99f74ce 100644 --- a/homeassistant/components/flo/sensor.py +++ b/homeassistant/components/flo/sensor.py @@ -1,12 +1,8 @@ """Support for Flo Water Monitor sensors.""" from __future__ import annotations -from homeassistant.components.sensor import SensorEntity +from homeassistant.components.sensor import SensorDeviceClass, SensorEntity from homeassistant.const import ( - DEVICE_CLASS_BATTERY, - DEVICE_CLASS_HUMIDITY, - DEVICE_CLASS_PRESSURE, - DEVICE_CLASS_TEMPERATURE, PERCENTAGE, PRESSURE_PSI, TEMP_FAHRENHEIT, @@ -114,7 +110,7 @@ class FloCurrentFlowRateSensor(FloEntity, SensorEntity): class FloTemperatureSensor(FloEntity, SensorEntity): """Monitors the temperature.""" - _attr_device_class = DEVICE_CLASS_TEMPERATURE + _attr_device_class = SensorDeviceClass.TEMPERATURE _attr_native_unit_of_measurement = TEMP_FAHRENHEIT def __init__(self, name, device): @@ -133,7 +129,7 @@ class FloTemperatureSensor(FloEntity, SensorEntity): class FloHumiditySensor(FloEntity, SensorEntity): """Monitors the humidity.""" - _attr_device_class = DEVICE_CLASS_HUMIDITY + _attr_device_class = SensorDeviceClass.HUMIDITY _attr_native_unit_of_measurement = PERCENTAGE def __init__(self, device): @@ -152,7 +148,7 @@ class FloHumiditySensor(FloEntity, SensorEntity): class FloPressureSensor(FloEntity, SensorEntity): """Monitors the water pressure.""" - _attr_device_class = DEVICE_CLASS_PRESSURE + _attr_device_class = SensorDeviceClass.PRESSURE _attr_native_unit_of_measurement = PRESSURE_PSI def __init__(self, device): @@ -171,7 +167,7 @@ class FloPressureSensor(FloEntity, SensorEntity): class FloBatterySensor(FloEntity, SensorEntity): """Monitors the battery level for battery-powered leak detectors.""" - _attr_device_class = DEVICE_CLASS_BATTERY + _attr_device_class = SensorDeviceClass.BATTERY _attr_native_unit_of_measurement = PERCENTAGE def __init__(self, device):