1 """Sensor platform for the Flipr's pool_sensor."""
3 from __future__
import annotations
8 SensorEntityDescription,
15 from .
import FliprConfigEntry
16 from .entity
import FliprEntity
18 SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
21 translation_key=
"chlorine",
22 native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT,
23 state_class=SensorStateClass.MEASUREMENT,
27 device_class=SensorDeviceClass.PH,
28 state_class=SensorStateClass.MEASUREMENT,
32 translation_key=
"water_temperature",
33 device_class=SensorDeviceClass.TEMPERATURE,
34 native_unit_of_measurement=UnitOfTemperature.CELSIUS,
35 state_class=SensorStateClass.MEASUREMENT,
39 translation_key=
"last_measured",
40 device_class=SensorDeviceClass.TIMESTAMP,
44 translation_key=
"red_ox",
45 native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT,
46 state_class=SensorStateClass.MEASUREMENT,
50 native_unit_of_measurement=PERCENTAGE,
51 state_class=SensorStateClass.MEASUREMENT,
52 device_class=SensorDeviceClass.BATTERY,
59 config_entry: FliprConfigEntry,
60 async_add_entities: AddEntitiesCallback,
62 """Defer sensor setup to the shared sensor module."""
63 coordinators = config_entry.runtime_data.flipr_coordinators
67 for description
in SENSOR_TYPES
68 for coordinator
in coordinators
73 """Sensor representing FliprSensor data."""
77 """State of the sensor."""
None async_setup_entry(HomeAssistant hass, FliprConfigEntry config_entry, AddEntitiesCallback async_add_entities)