Change POWER_VOLT_AMPERE_REACTIVE to UnitOfReactivePower (#117153)

* Refactoring: exchange POWER_VOLT_AMPERE_REACTIVE with UnitOfReactivePower

* updated iotawatt and mysensors from VOLT_AMPERE_REACTIVE to UnitOfReactivePower.VOLT_AMPERE_REACTIVE

* deprecation period for POWER_VOLT_AMPERE_REACTIVE changed to one year.

* POWER_VOLT_AMPERE_REACTIVE changed to UnitOfReactivePower in blebox integration

* Update homeassistant/const.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
This commit is contained in:
Christian Neumeier
2024-08-21 15:36:45 +02:00
committed by GitHub
parent b21b300625
commit 3e53cc175f
15 changed files with 68 additions and 56 deletions

View File

@@ -10,11 +10,11 @@ from homeassistant.const import (
CONCENTRATION_PARTS_PER_MILLION,
LIGHT_LUX,
PERCENTAGE,
POWER_VOLT_AMPERE_REACTIVE,
SIGNAL_STRENGTH_DECIBELS,
UnitOfApparentPower,
UnitOfFrequency,
UnitOfPressure,
UnitOfReactivePower,
UnitOfVolume,
)
@@ -44,7 +44,7 @@ UNITS_OF_MEASUREMENT = {
SensorDeviceClass.ENERGY: "kWh", # energy (Wh/kWh/MWh)
SensorDeviceClass.FREQUENCY: UnitOfFrequency.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.REACTIVE_POWER: UnitOfReactivePower.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: UnitOfVolume.CUBIC_METERS, # gas (m³)