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
|
@ -58,6 +58,7 @@ def test_matches_device_classes(device_class: SensorDeviceClass) -> None:
|
|||
SensorDeviceClass.BATTERY: "CONF_IS_BATTERY_LEVEL",
|
||||
SensorDeviceClass.CO: "CONF_IS_CO",
|
||||
SensorDeviceClass.CO2: "CONF_IS_CO2",
|
||||
SensorDeviceClass.CONDUCTIVITY: "CONF_IS_CONDUCTIVITY",
|
||||
SensorDeviceClass.ENERGY_STORAGE: "CONF_IS_ENERGY",
|
||||
SensorDeviceClass.VOLUME_STORAGE: "CONF_IS_VOLUME",
|
||||
}.get(device_class, f"CONF_IS_{device_class.value.upper()}")
|
||||
|
@ -66,6 +67,7 @@ def test_matches_device_classes(device_class: SensorDeviceClass) -> None:
|
|||
# Ensure it has correct value
|
||||
constant_value = {
|
||||
SensorDeviceClass.BATTERY: "is_battery_level",
|
||||
SensorDeviceClass.CONDUCTIVITY: "is_conductivity",
|
||||
SensorDeviceClass.ENERGY_STORAGE: "is_energy",
|
||||
SensorDeviceClass.VOLUME_STORAGE: "is_volume",
|
||||
}.get(device_class, f"is_{device_class.value}")
|
||||
|
|
|
@ -62,6 +62,7 @@ def test_matches_device_classes(device_class: SensorDeviceClass) -> None:
|
|||
SensorDeviceClass.BATTERY: "CONF_BATTERY_LEVEL",
|
||||
SensorDeviceClass.CO: "CONF_CO",
|
||||
SensorDeviceClass.CO2: "CONF_CO2",
|
||||
SensorDeviceClass.CONDUCTIVITY: "CONF_CONDUCTIVITY",
|
||||
SensorDeviceClass.ENERGY_STORAGE: "CONF_ENERGY",
|
||||
SensorDeviceClass.VOLUME_STORAGE: "CONF_VOLUME",
|
||||
}.get(device_class, f"CONF_{device_class.value.upper()}")
|
||||
|
@ -70,6 +71,7 @@ def test_matches_device_classes(device_class: SensorDeviceClass) -> None:
|
|||
# Ensure it has correct value
|
||||
constant_value = {
|
||||
SensorDeviceClass.BATTERY: "battery_level",
|
||||
SensorDeviceClass.CONDUCTIVITY: "conductivity",
|
||||
SensorDeviceClass.ENERGY_STORAGE: "energy",
|
||||
SensorDeviceClass.VOLUME_STORAGE: "volume",
|
||||
}.get(device_class, device_class.value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue