Skip to content

Commit

Permalink
Use new unit enums in fronius (home-assistant#84224)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Dec 19, 2022
1 parent f1fc54d commit 0f40a73
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions homeassistant/components/fronius/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ENERGY_WATT_HOUR,
PERCENTAGE,
POWER_VOLT_AMPERE_REACTIVE,
TEMP_CELSIUS,
UnitOfApparentPower,
UnitOfElectricCurrent,
UnitOfElectricPotential,
UnitOfEnergy,
UnitOfFrequency,
UnitOfPower,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import DeviceInfo, EntityCategory
Expand Down Expand Up @@ -80,21 +80,21 @@ async def async_setup_entry(
SensorEntityDescription(
key="energy_day",
name="Energy day",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
SensorEntityDescription(
key="energy_year",
name="Energy year",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
SensorEntityDescription(
key="energy_total",
name="Energy total",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
Expand Down Expand Up @@ -255,30 +255,30 @@ async def async_setup_entry(
SensorEntityDescription(
key="energy_real_ac_minus",
name="Energy real AC minus",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
entity_registry_enabled_default=False,
),
SensorEntityDescription(
key="energy_real_ac_plus",
name="Energy real AC plus",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
entity_registry_enabled_default=False,
),
SensorEntityDescription(
key="energy_real_consumed",
name="Energy real consumed",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
SensorEntityDescription(
key="energy_real_produced",
name="Energy real produced",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
Expand Down Expand Up @@ -478,7 +478,7 @@ async def async_setup_entry(
SensorEntityDescription(
key="energy_real_ac_consumed",
name="Energy consumed",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
),
Expand All @@ -492,7 +492,7 @@ async def async_setup_entry(
SensorEntityDescription(
key="temperature_channel_1",
name="Temperature channel 1",
native_unit_of_measurement=TEMP_CELSIUS,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
Expand All @@ -517,23 +517,23 @@ async def async_setup_entry(
SensorEntityDescription(
key="energy_day",
name="Energy day",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
entity_registry_enabled_default=False,
),
SensorEntityDescription(
key="energy_year",
name="Energy year",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
entity_registry_enabled_default=False,
),
SensorEntityDescription(
key="energy_total",
name="Energy total",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
entity_registry_enabled_default=False,
Expand Down Expand Up @@ -591,13 +591,13 @@ async def async_setup_entry(
SensorEntityDescription(
key="capacity_maximum",
name="Capacity maximum",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
entity_category=EntityCategory.DIAGNOSTIC,
),
SensorEntityDescription(
key="capacity_designed",
name="Capacity designed",
native_unit_of_measurement=ENERGY_WATT_HOUR,
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
entity_category=EntityCategory.DIAGNOSTIC,
),
SensorEntityDescription(
Expand Down Expand Up @@ -644,7 +644,7 @@ async def async_setup_entry(
SensorEntityDescription(
key="temperature_cell",
name="Temperature cell",
native_unit_of_measurement=TEMP_CELSIUS,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
Expand Down

0 comments on commit 0f40a73

Please sign in to comment.