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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 68 additions and 56 deletions

View file

@ -23,6 +23,7 @@ from homeassistant.const import (
UnitOfEnergy,
UnitOfFrequency,
UnitOfPower,
UnitOfReactivePower,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import device_registry as dr, entity_registry as er
@ -31,7 +32,7 @@ from homeassistant.helpers.typing import StateType
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.util import dt as dt_util
from .const import DOMAIN, VOLT_AMPERE_REACTIVE, VOLT_AMPERE_REACTIVE_HOURS
from .const import DOMAIN, VOLT_AMPERE_REACTIVE_HOURS
from .coordinator import IotawattUpdater
_LOGGER = logging.getLogger(__name__)
@ -89,7 +90,7 @@ ENTITY_DESCRIPTION_KEY_MAP: dict[str, IotaWattSensorEntityDescription] = {
),
"VAR": IotaWattSensorEntityDescription(
key="VAR",
native_unit_of_measurement=VOLT_AMPERE_REACTIVE,
native_unit_of_measurement=UnitOfReactivePower.VOLT_AMPERE_REACTIVE,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:flash",
entity_registry_enabled_default=False,