From e01512e469a65d67aee1eec1a9f16ba9cc8df263 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Tue, 8 Oct 2024 15:20:26 +0200 Subject: [PATCH] Update integrations to use new UnitOfConductivity enums (#127932) --- homeassistant/components/fyta/sensor.py | 2 +- homeassistant/components/mysensors/sensor.py | 2 +- homeassistant/components/plant/__init__.py | 2 +- homeassistant/components/xiaomi_ble/sensor.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/fyta/sensor.py b/homeassistant/components/fyta/sensor.py index a351d79dd8b..f324b9b3afe 100644 --- a/homeassistant/components/fyta/sensor.py +++ b/homeassistant/components/fyta/sensor.py @@ -113,7 +113,7 @@ SENSORS: Final[list[FytaSensorEntityDescription]] = [ FytaSensorEntityDescription( key="salinity", translation_key="salinity", - native_unit_of_measurement=UnitOfConductivity.MILLISIEMENS, + native_unit_of_measurement=UnitOfConductivity.MILLISIEMENS_PER_CM, device_class=SensorDeviceClass.CONDUCTIVITY, state_class=SensorStateClass.MEASUREMENT, value_fn=lambda plant: plant.salinity, diff --git a/homeassistant/components/mysensors/sensor.py b/homeassistant/components/mysensors/sensor.py index 3cf4be21757..eec3c6bcd79 100644 --- a/homeassistant/components/mysensors/sensor.py +++ b/homeassistant/components/mysensors/sensor.py @@ -193,7 +193,7 @@ SENSORS: dict[str, SensorEntityDescription] = { ), "V_EC": SensorEntityDescription( key="V_EC", - native_unit_of_measurement=UnitOfConductivity.MICROSIEMENS, + native_unit_of_measurement=UnitOfConductivity.MICROSIEMENS_PER_CM, ), "V_VAR": SensorEntityDescription( key="V_VAR", diff --git a/homeassistant/components/plant/__init__.py b/homeassistant/components/plant/__init__.py index c6e527290df..48c606865df 100644 --- a/homeassistant/components/plant/__init__.py +++ b/homeassistant/components/plant/__init__.py @@ -155,7 +155,7 @@ class Plant(Entity): "max": CONF_MAX_MOISTURE, }, READING_CONDUCTIVITY: { - ATTR_UNIT_OF_MEASUREMENT: UnitOfConductivity.MICROSIEMENS, + ATTR_UNIT_OF_MEASUREMENT: UnitOfConductivity.MICROSIEMENS_PER_CM, "min": CONF_MIN_CONDUCTIVITY, "max": CONF_MAX_CONDUCTIVITY, }, diff --git a/homeassistant/components/xiaomi_ble/sensor.py b/homeassistant/components/xiaomi_ble/sensor.py index 4a28f127476..ba8f64383ee 100644 --- a/homeassistant/components/xiaomi_ble/sensor.py +++ b/homeassistant/components/xiaomi_ble/sensor.py @@ -49,7 +49,7 @@ SENSOR_DESCRIPTIONS = { (DeviceClass.CONDUCTIVITY, Units.CONDUCTIVITY): SensorEntityDescription( key=str(Units.CONDUCTIVITY), device_class=SensorDeviceClass.CONDUCTIVITY, - native_unit_of_measurement=UnitOfConductivity.MICROSIEMENS, + native_unit_of_measurement=UnitOfConductivity.MICROSIEMENS_PER_CM, state_class=SensorStateClass.MEASUREMENT, ), (