Use enums in poolsense (#62071)
This commit is contained in:
parent
b28c821bc3
commit
ec3efb4b1a
2 changed files with 11 additions and 10 deletions
|
@ -2,7 +2,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_PROBLEM,
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
BinarySensorEntityDescription,
|
||||
)
|
||||
|
@ -15,12 +15,12 @@ BINARY_SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
|
|||
BinarySensorEntityDescription(
|
||||
key="pH Status",
|
||||
name="pH Status",
|
||||
device_class=DEVICE_CLASS_PROBLEM,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
BinarySensorEntityDescription(
|
||||
key="Chlorine Status",
|
||||
name="Chlorine Status",
|
||||
device_class=DEVICE_CLASS_PROBLEM,
|
||||
device_class=BinarySensorDeviceClass.PROBLEM,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
"""Sensor platform for the PoolSense sensor."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
|
||||
from homeassistant.components.sensor import (
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
SensorEntityDescription,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_EMAIL,
|
||||
DEVICE_CLASS_BATTERY,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
DEVICE_CLASS_TIMESTAMP,
|
||||
ELECTRIC_POTENTIAL_MILLIVOLT,
|
||||
PERCENTAGE,
|
||||
TEMP_CELSIUS,
|
||||
|
@ -31,20 +32,20 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||
key="Battery",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
name="Battery",
|
||||
device_class=DEVICE_CLASS_BATTERY,
|
||||
device_class=SensorDeviceClass.BATTERY,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="Water Temp",
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
icon="mdi:coolant-temperature",
|
||||
name="Temperature",
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="Last Seen",
|
||||
icon="mdi:clock",
|
||||
name="Last Seen",
|
||||
device_class=DEVICE_CLASS_TIMESTAMP,
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="Chlorine High",
|
||||
|
|
Loading…
Add table
Reference in a new issue