Add additional energy sensors to Eve Energy (#64826)

This commit is contained in:
Jc2k 2022-01-24 17:46:45 +00:00 committed by GitHub
parent c8a63d4ffc
commit 24ee4256b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 407 additions and 0 deletions

View file

@ -18,6 +18,7 @@ from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_MILLION,
ELECTRIC_CURRENT_AMPERE,
ELECTRIC_POTENTIAL_VOLT,
ENERGY_KILO_WATT_HOUR,
LIGHT_LUX,
PERCENTAGE,
@ -76,6 +77,27 @@ SIMPLE_SENSOR: dict[str, HomeKitSensorEntityDescription] = {
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=POWER_WATT,
),
CharacteristicsTypes.Vendor.EVE_ENERGY_KW_HOUR: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.Vendor.EVE_ENERGY_KW_HOUR,
name="Energy kWh",
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
),
CharacteristicsTypes.Vendor.EVE_ENERGY_VOLTAGE: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.Vendor.EVE_ENERGY_VOLTAGE,
name="Volts",
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
),
CharacteristicsTypes.Vendor.EVE_ENERGY_AMPERE: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.Vendor.EVE_ENERGY_AMPERE,
name="Amps",
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
),
CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY: HomeKitSensorEntityDescription(
key=CharacteristicsTypes.Vendor.KOOGEEK_REALTIME_ENERGY,
name="Real Time Energy",