Add Siemes and Millisiemens as additional units of conductivity and enable conversion between conductivity units (#118728)
This commit is contained in:
parent
818750dfd1
commit
0dd5391cd7
17 changed files with 112 additions and 16 deletions
|
@ -18,6 +18,7 @@ from homeassistant.const import (
|
|||
SIGNAL_STRENGTH_DECIBELS,
|
||||
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
|
||||
UnitOfApparentPower,
|
||||
UnitOfConductivity,
|
||||
UnitOfDataRate,
|
||||
UnitOfElectricCurrent,
|
||||
UnitOfElectricPotential,
|
||||
|
@ -120,6 +121,12 @@ class NumberDeviceClass(StrEnum):
|
|||
Unit of measurement: `ppm` (parts per million)
|
||||
"""
|
||||
|
||||
CONDUCTIVITY = "conductivity"
|
||||
"""Conductivity.
|
||||
|
||||
Unit of measurement: `S/cm`, `mS/cm`, `µS/cm`
|
||||
"""
|
||||
|
||||
CURRENT = "current"
|
||||
"""Current.
|
||||
|
||||
|
@ -424,6 +431,7 @@ DEVICE_CLASS_UNITS: dict[NumberDeviceClass, set[type[StrEnum] | str | None]] = {
|
|||
NumberDeviceClass.BATTERY: {PERCENTAGE},
|
||||
NumberDeviceClass.CO: {CONCENTRATION_PARTS_PER_MILLION},
|
||||
NumberDeviceClass.CO2: {CONCENTRATION_PARTS_PER_MILLION},
|
||||
NumberDeviceClass.CONDUCTIVITY: set(UnitOfConductivity),
|
||||
NumberDeviceClass.CURRENT: set(UnitOfElectricCurrent),
|
||||
NumberDeviceClass.DATA_RATE: set(UnitOfDataRate),
|
||||
NumberDeviceClass.DATA_SIZE: set(UnitOfInformation),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue