mirror of
https://github.com/home-assistant/core.git
synced 2026-04-28 04:33:49 +01:00
Add sensor device classes for apparent and reactive power (#62010)
This commit is contained in:
@@ -13,6 +13,8 @@ from homeassistant.const import (
|
||||
CONCENTRATION_PARTS_PER_MILLION,
|
||||
FREQUENCY_GIGAHERTZ,
|
||||
PERCENTAGE,
|
||||
POWER_VOLT_AMPERE,
|
||||
POWER_VOLT_AMPERE_REACTIVE,
|
||||
PRESSURE_HPA,
|
||||
SIGNAL_STRENGTH_DECIBELS,
|
||||
VOLUME_CUBIC_METERS,
|
||||
@@ -23,6 +25,7 @@ from tests.common import MockEntity
|
||||
DEVICE_CLASSES.append("none")
|
||||
|
||||
UNITS_OF_MEASUREMENT = {
|
||||
SensorDeviceClass.APPARENT_POWER: POWER_VOLT_AMPERE, # apparent power (VA)
|
||||
SensorDeviceClass.BATTERY: PERCENTAGE, # % of battery that is left
|
||||
SensorDeviceClass.CO: CONCENTRATION_PARTS_PER_MILLION, # ppm of CO concentration
|
||||
SensorDeviceClass.CO2: CONCENTRATION_PARTS_PER_MILLION, # ppm of CO2 concentration
|
||||
@@ -41,9 +44,10 @@ UNITS_OF_MEASUREMENT = {
|
||||
SensorDeviceClass.PRESSURE: PRESSURE_HPA, # pressure (hPa/mbar)
|
||||
SensorDeviceClass.POWER: "kW", # power (W/kW)
|
||||
SensorDeviceClass.CURRENT: "A", # current (A)
|
||||
SensorDeviceClass.ENERGY: "kWh", # energy (Wh/kWh)
|
||||
SensorDeviceClass.ENERGY: "kWh", # energy (Wh/kWh/MWh)
|
||||
SensorDeviceClass.FREQUENCY: FREQUENCY_GIGAHERTZ, # energy (Hz/kHz/MHz/GHz)
|
||||
SensorDeviceClass.POWER_FACTOR: PERCENTAGE, # power factor (no unit, min: -1.0, max: 1.0)
|
||||
SensorDeviceClass.REACTIVE_POWER: POWER_VOLT_AMPERE_REACTIVE, # reactive power (var)
|
||||
SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS: CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, # µg/m³ of vocs
|
||||
SensorDeviceClass.VOLTAGE: "V", # voltage (V)
|
||||
SensorDeviceClass.GAS: VOLUME_CUBIC_METERS, # gas (m³)
|
||||
|
||||
Reference in New Issue
Block a user