From bbd1cbf5c9e06bb6df892b42a6c5770e84fd69d8 Mon Sep 17 00:00:00 2001 From: cnico Date: Sat, 28 Jun 2025 23:29:24 +0200 Subject: [PATCH] Correct Chlorine unit definition in flipr integration (#147537) * Correction of bug 145683 * constant for chlorine unit correction * constant name correction * Review correction --- homeassistant/components/flipr/sensor.py | 2 +- tests/components/flipr/test_sensor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/flipr/sensor.py b/homeassistant/components/flipr/sensor.py index 296bcaac68d..f96edbc0f71 100644 --- a/homeassistant/components/flipr/sensor.py +++ b/homeassistant/components/flipr/sensor.py @@ -19,7 +19,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = ( SensorEntityDescription( key="chlorine", translation_key="chlorine", - native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, + native_unit_of_measurement="mg/L", state_class=SensorStateClass.MEASUREMENT, ), SensorEntityDescription( diff --git a/tests/components/flipr/test_sensor.py b/tests/components/flipr/test_sensor.py index 77937e3af54..d4568747d01 100644 --- a/tests/components/flipr/test_sensor.py +++ b/tests/components/flipr/test_sensor.py @@ -54,7 +54,7 @@ async def test_sensors( state = hass.states.get("sensor.flipr_myfliprid_chlorine") assert state - assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "mV" + assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == "mg/L" assert state.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.MEASUREMENT assert state.state == "0.23654886"