mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Add goodwe sensors for apparent/reactive pwr (#87940)
This commit is contained in:
parent
f60e9c71a2
commit
9ae0236208
@ -19,13 +19,16 @@ from homeassistant.components.sensor import (
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
PERCENTAGE,
|
||||
POWER_VOLT_AMPERE_REACTIVE,
|
||||
EntityCategory,
|
||||
UnitOfApparentPower,
|
||||
UnitOfElectricCurrent,
|
||||
UnitOfElectricPotential,
|
||||
UnitOfEnergy,
|
||||
UnitOfFrequency,
|
||||
UnitOfPower,
|
||||
UnitOfTemperature,
|
||||
UnitOfTime,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
@ -111,6 +114,20 @@ _DESCRIPTIONS: dict[str, GoodweSensorEntityDescription] = {
|
||||
value=lambda coordinator, sensor: coordinator.total_sensor_value(sensor),
|
||||
available=lambda coordinator: coordinator.data is not None,
|
||||
),
|
||||
"VA": GoodweSensorEntityDescription(
|
||||
key="VA",
|
||||
device_class=SensorDeviceClass.APPARENT_POWER,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
native_unit_of_measurement=UnitOfApparentPower.VOLT_AMPERE,
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"var": GoodweSensorEntityDescription(
|
||||
key="var",
|
||||
device_class=SensorDeviceClass.REACTIVE_POWER,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
native_unit_of_measurement=POWER_VOLT_AMPERE_REACTIVE,
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"C": GoodweSensorEntityDescription(
|
||||
key="C",
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
@ -123,6 +140,13 @@ _DESCRIPTIONS: dict[str, GoodweSensorEntityDescription] = {
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
native_unit_of_measurement=UnitOfFrequency.HERTZ,
|
||||
),
|
||||
"h": GoodweSensorEntityDescription(
|
||||
key="h",
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
native_unit_of_measurement=UnitOfTime.HOURS,
|
||||
entity_registry_enabled_default=False,
|
||||
),
|
||||
"%": GoodweSensorEntityDescription(
|
||||
key="%",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
Loading…
x
Reference in New Issue
Block a user