From 4e3bd55c737807e77f6ac853026a67136458d7e0 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:11:07 +0200 Subject: [PATCH] Revert UnitOfReactivePower change from iotawatt (#124393) Revert "Change POWER_VOLT_AMPERE_REACTIVE to UnitOfReactivePower (#117153)" This reverts commit 3e53cc175f78d8224f539e08dc6978c6cee3b41f. --- homeassistant/components/iotawatt/const.py | 1 + homeassistant/components/iotawatt/sensor.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/iotawatt/const.py b/homeassistant/components/iotawatt/const.py index 278030d4f10..de008388f62 100644 --- a/homeassistant/components/iotawatt/const.py +++ b/homeassistant/components/iotawatt/const.py @@ -7,6 +7,7 @@ import json import httpx DOMAIN = "iotawatt" +VOLT_AMPERE_REACTIVE = "VAR" VOLT_AMPERE_REACTIVE_HOURS = "VARh" CONNECTION_ERRORS = (KeyError, json.JSONDecodeError, httpx.HTTPError) diff --git a/homeassistant/components/iotawatt/sensor.py b/homeassistant/components/iotawatt/sensor.py index e0328ea9d58..c9af588c160 100644 --- a/homeassistant/components/iotawatt/sensor.py +++ b/homeassistant/components/iotawatt/sensor.py @@ -23,7 +23,6 @@ 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 @@ -32,7 +31,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_HOURS +from .const import DOMAIN, VOLT_AMPERE_REACTIVE, VOLT_AMPERE_REACTIVE_HOURS from .coordinator import IotawattUpdater _LOGGER = logging.getLogger(__name__) @@ -90,7 +89,7 @@ ENTITY_DESCRIPTION_KEY_MAP: dict[str, IotaWattSensorEntityDescription] = { ), "VAR": IotaWattSensorEntityDescription( key="VAR", - native_unit_of_measurement=UnitOfReactivePower.VOLT_AMPERE_REACTIVE, + native_unit_of_measurement=VOLT_AMPERE_REACTIVE, state_class=SensorStateClass.MEASUREMENT, icon="mdi:flash", entity_registry_enabled_default=False,