mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Use new DeviceClass enums in flipr (#61439)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
da7c5f4722
commit
5538d5d59d
@ -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,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -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",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user