Allow converting units of additional sensor device classes (#86072)
This commit is contained in:
parent
ec1b4d5651
commit
14a32cd63b
1 changed files with 3 additions and 1 deletions
|
@ -416,14 +416,16 @@ STATE_CLASSES: Final[list[str]] = [cls.value for cls in SensorStateClass]
|
|||
# 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.ATMOSPHERIC_PRESSURE: PressureConverter,
|
||||
SensorDeviceClass.CURRENT: ElectricCurrentConverter,
|
||||
SensorDeviceClass.DATA_RATE: DataRateConverter,
|
||||
SensorDeviceClass.DATA_SIZE: InformationConverter,
|
||||
SensorDeviceClass.DISTANCE: DistanceConverter,
|
||||
SensorDeviceClass.CURRENT: ElectricCurrentConverter,
|
||||
SensorDeviceClass.ENERGY: EnergyConverter,
|
||||
SensorDeviceClass.GAS: VolumeConverter,
|
||||
SensorDeviceClass.POWER_FACTOR: UnitlessRatioConverter,
|
||||
SensorDeviceClass.PRECIPITATION: DistanceConverter,
|
||||
SensorDeviceClass.PRECIPITATION_INTENSITY: SpeedConverter,
|
||||
SensorDeviceClass.PRESSURE: PressureConverter,
|
||||
SensorDeviceClass.SPEED: SpeedConverter,
|
||||
SensorDeviceClass.TEMPERATURE: TemperatureConverter,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue