Allow gas units to be overriden (#80884)
This commit is contained in:
parent
3d3349240f
commit
6b1f503a79
1 changed files with 4 additions and 2 deletions
|
@ -376,9 +376,11 @@ STATE_CLASS_TOTAL: Final = "total"
|
|||
STATE_CLASS_TOTAL_INCREASING: Final = "total_increasing"
|
||||
STATE_CLASSES: Final[list[str]] = [cls.value for cls in SensorStateClass]
|
||||
|
||||
UNIT_CONVERTERS: dict[str, type[BaseUnitConverter]] = {
|
||||
# Note: this needs to be aligned with frontend: OVERRIDE_SENSOR_UNITS in
|
||||
# `entity-registry-settings.ts`
|
||||
UNIT_CONVERTERS: dict[SensorDeviceClass | str | None, type[BaseUnitConverter]] = {
|
||||
SensorDeviceClass.DISTANCE: DistanceConverter,
|
||||
SensorDeviceClass.PRECIPITATION_INTENSITY: SpeedConverter,
|
||||
SensorDeviceClass.GAS: VolumeConverter,
|
||||
SensorDeviceClass.PRESSURE: PressureConverter,
|
||||
SensorDeviceClass.SPEED: SpeedConverter,
|
||||
SensorDeviceClass.TEMPERATURE: TemperatureConverter,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue