1
mirror of https://github.com/home-assistant/core synced 2024-08-06 09:34:49 +02:00

Use enums in poolsense (#62071)

This commit is contained in:
Robert Hillis 2021-12-16 11:06:16 -05:00 committed by GitHub
parent b28c821bc3
commit ec3efb4b1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 10 deletions

View File

@ -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,
),
)

View File

@ -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",