Use new DeviceClass enums in flipr (#61439)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-10 14:48:10 +01:00 committed by GitHub
parent da7c5f4722
commit 5538d5d59d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 11 deletions

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from homeassistant.components.binary_sensor import ( from homeassistant.components.binary_sensor import (
DEVICE_CLASS_PROBLEM, BinarySensorDeviceClass,
BinarySensorEntity, BinarySensorEntity,
BinarySensorEntityDescription, BinarySensorEntityDescription,
) )
@ -14,12 +14,12 @@ BINARY_SENSORS_TYPES: tuple[BinarySensorEntityDescription, ...] = (
BinarySensorEntityDescription( BinarySensorEntityDescription(
key="ph_status", key="ph_status",
name="PH Status", name="PH Status",
device_class=DEVICE_CLASS_PROBLEM, device_class=BinarySensorDeviceClass.PROBLEM,
), ),
BinarySensorEntityDescription( BinarySensorEntityDescription(
key="chlorine_status", key="chlorine_status",
name="Chlorine Status", name="Chlorine Status",
device_class=DEVICE_CLASS_PROBLEM, device_class=BinarySensorDeviceClass.PROBLEM,
), ),
) )

View File

@ -1,13 +1,12 @@
"""Sensor platform for the Flipr's pool_sensor.""" """Sensor platform for the Flipr's pool_sensor."""
from __future__ import annotations from __future__ import annotations
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription from homeassistant.components.sensor import (
from homeassistant.const import ( SensorDeviceClass,
DEVICE_CLASS_TEMPERATURE, SensorEntity,
DEVICE_CLASS_TIMESTAMP, SensorEntityDescription,
ELECTRIC_POTENTIAL_MILLIVOLT,
TEMP_CELSIUS,
) )
from homeassistant.const import ELECTRIC_POTENTIAL_MILLIVOLT, TEMP_CELSIUS
from . import FliprEntity from . import FliprEntity
from .const import DOMAIN from .const import DOMAIN
@ -27,13 +26,13 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription( SensorEntityDescription(
key="temperature", key="temperature",
name="Water Temp", name="Water Temp",
device_class=DEVICE_CLASS_TEMPERATURE, device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=TEMP_CELSIUS, native_unit_of_measurement=TEMP_CELSIUS,
), ),
SensorEntityDescription( SensorEntityDescription(
key="date_time", key="date_time",
name="Last Measured", name="Last Measured",
device_class=DEVICE_CLASS_TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
), ),
SensorEntityDescription( SensorEntityDescription(
key="red_ox", key="red_ox",