mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Allow liter for gas sensor device class (#141518)
This commit is contained in:
@@ -434,6 +434,7 @@ def test_get_unit_system_invalid(key: str) -> None:
|
||||
UnitOfVolume.CUBIC_METERS,
|
||||
),
|
||||
(SensorDeviceClass.GAS, UnitOfVolume.CUBIC_FEET, UnitOfVolume.CUBIC_METERS),
|
||||
(SensorDeviceClass.GAS, UnitOfVolume.LITERS, None),
|
||||
(SensorDeviceClass.GAS, UnitOfVolume.CUBIC_METERS, None),
|
||||
(SensorDeviceClass.GAS, "very_much", None),
|
||||
# Test precipitation conversion
|
||||
@@ -573,7 +574,10 @@ UNCONVERTED_UNITS_METRIC_SYSTEM = {
|
||||
UnitOfLength.METERS,
|
||||
UnitOfLength.MILLIMETERS,
|
||||
),
|
||||
SensorDeviceClass.GAS: (UnitOfVolume.CUBIC_METERS,),
|
||||
SensorDeviceClass.GAS: (
|
||||
UnitOfVolume.CUBIC_METERS,
|
||||
UnitOfVolume.LITERS,
|
||||
),
|
||||
SensorDeviceClass.PRECIPITATION: (
|
||||
UnitOfLength.CENTIMETERS,
|
||||
UnitOfLength.MILLIMETERS,
|
||||
@@ -687,6 +691,7 @@ def test_metric_converted_units(device_class: SensorDeviceClass) -> None:
|
||||
# Test gas meter conversion
|
||||
(SensorDeviceClass.GAS, UnitOfVolume.CENTUM_CUBIC_FEET, None),
|
||||
(SensorDeviceClass.GAS, UnitOfVolume.CUBIC_METERS, UnitOfVolume.CUBIC_FEET),
|
||||
(SensorDeviceClass.GAS, UnitOfVolume.LITERS, UnitOfVolume.CUBIC_FEET),
|
||||
(SensorDeviceClass.GAS, UnitOfVolume.CUBIC_FEET, None),
|
||||
(SensorDeviceClass.GAS, "very_much", None),
|
||||
# Test precipitation conversion
|
||||
|
||||
Reference in New Issue
Block a user