Move temperature conversions to sensor base class (5/8) (#54475)
This commit is contained in:
parent
e55868b17f
commit
103e21c278
65 changed files with 289 additions and 288 deletions
|
@ -28,49 +28,49 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
|||
SensorEntityDescription(
|
||||
key="temperature",
|
||||
name="Temperature",
|
||||
unit_of_measurement=TEMP_CELSIUS,
|
||||
native_unit_of_measurement=TEMP_CELSIUS,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_TEMPERATURE,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="orp",
|
||||
name="Oxydo Reduction Potential",
|
||||
unit_of_measurement=ELECTRIC_POTENTIAL_MILLIVOLT,
|
||||
native_unit_of_measurement=ELECTRIC_POTENTIAL_MILLIVOLT,
|
||||
icon="mdi:pool",
|
||||
device_class=None,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="ph",
|
||||
name="pH",
|
||||
unit_of_measurement=None,
|
||||
native_unit_of_measurement=None,
|
||||
icon="mdi:pool",
|
||||
device_class=None,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="tds",
|
||||
name="TDS",
|
||||
unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
|
||||
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
|
||||
icon="mdi:pool",
|
||||
device_class=None,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="battery",
|
||||
name="Battery",
|
||||
unit_of_measurement=PERCENTAGE,
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_BATTERY,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="rssi",
|
||||
name="RSSI",
|
||||
unit_of_measurement=PERCENTAGE,
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon=None,
|
||||
device_class=DEVICE_CLASS_SIGNAL_STRENGTH,
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="salt",
|
||||
name="Salt",
|
||||
unit_of_measurement="mg/L",
|
||||
native_unit_of_measurement="mg/L",
|
||||
icon="mdi:pool",
|
||||
device_class=None,
|
||||
),
|
||||
|
@ -164,7 +164,7 @@ class OndiloICO(CoordinatorEntity, SensorEntity):
|
|||
)
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
def native_value(self):
|
||||
"""Last value of the sensor."""
|
||||
return self._devdata()["value"]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue