Correct Chlorine unit definition in flipr integration (#147537)

* Correction of bug 145683

* constant for chlorine unit correction

* constant name correction

* Review correction
This commit is contained in:
cnico 2025-06-28 23:29:24 +02:00 committed by GitHub
parent 43450d4489
commit bbd1cbf5c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription( SensorEntityDescription(
key="chlorine", key="chlorine",
translation_key="chlorine", translation_key="chlorine",
native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT, native_unit_of_measurement="mg/L",
state_class=SensorStateClass.MEASUREMENT, state_class=SensorStateClass.MEASUREMENT,
), ),
SensorEntityDescription( SensorEntityDescription(

View File

@ -54,7 +54,7 @@ async def test_sensors(
state = hass.states.get("sensor.flipr_myfliprid_chlorine") state = hass.states.get("sensor.flipr_myfliprid_chlorine")
assert state 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.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.MEASUREMENT
assert state.state == "0.23654886" assert state.state == "0.23654886"