Skip to content

Commit

Permalink
Updated deprecated const usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
CadeusTheGreat authored Jan 6, 2024
1 parent d5b987e commit 42a6175
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions custom_components/alphaess/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SensorEntity,
SensorStateClass,
)
from homeassistant.const import ENERGY_KILO_WATT_HOUR, PERCENTAGE, POWER_WATT
from homeassistant.const import UnitOfEnergy.KILO_WATT_HOUR, PERCENTAGE, UnitOfPower.WATT
from homeassistant.helpers.device_registry import DeviceEntryType
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
Expand All @@ -20,49 +20,49 @@
AlphaESSSensorDescription(
key=AlphaESSNames.SolarProduction,
name="Solar Production",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
AlphaESSSensorDescription(
key=AlphaESSNames.SolarToBattery,
name="Solar to Battery",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
AlphaESSSensorDescription(
key=AlphaESSNames.SolarToGrid,
name="Solar to Grid",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
AlphaESSSensorDescription(
key=AlphaESSNames.SolarToLoad,
name="Solar to Load",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
AlphaESSSensorDescription(
key=AlphaESSNames.TotalLoad,
name="Total Load",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
AlphaESSSensorDescription(
key=AlphaESSNames.GridToLoad,
name="Grid to Load",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
AlphaESSSensorDescription(
key=AlphaESSNames.GridToBattery,
name="Grid to Battery",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
Expand All @@ -76,77 +76,77 @@
AlphaESSSensorDescription(
key=AlphaESSNames.Charge,
name="Charge",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
AlphaESSSensorDescription(
key=AlphaESSNames.Discharge,
name="Discharge",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
AlphaESSSensorDescription(
key=AlphaESSNames.EVCharger,
name="EV Charger",
native_unit_of_measurement=ENERGY_KILO_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
AlphaESSSensorDescription(
key=AlphaESSNames.Generation,
name="Instantaneous Generation",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
AlphaESSSensorDescription(
key=AlphaESSNames.PPV1,
name="Instantaneous PPV1",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
AlphaESSSensorDescription(
key=AlphaESSNames.PPV2,
name="Instantaneous PPV2",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
AlphaESSSensorDescription(
key=AlphaESSNames.PPV3,
name="Instantaneous PPV3",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
AlphaESSSensorDescription(
key=AlphaESSNames.PPV4,
name="Instantaneous PPV4",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
AlphaESSSensorDescription(
key=AlphaESSNames.GridIOL1,
name="Instantaneous Grid I/O L1",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
AlphaESSSensorDescription(
key=AlphaESSNames.GridIOL2,
name="Instantaneous Grid I/O L2",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
AlphaESSSensorDescription(
key=AlphaESSNames.GridIOL3,
name="Instantaneous Grid I/O L3",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
Expand All @@ -160,21 +160,21 @@
AlphaESSSensorDescription(
key=AlphaESSNames.BatteryIO,
name="Instantaneous Battery I/O",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
AlphaESSSensorDescription(
key=AlphaESSNames.GridIOTotal,
name="Instantaneous Grid I/O Total",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
AlphaESSSensorDescription(
key=AlphaESSNames.Load,
name="Instantaneous Load",
native_unit_of_measurement=POWER_WATT,
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
),
Expand Down

0 comments on commit 42a6175

Please sign in to comment.