Use UnitOfFrequency in integrations (#83915)

This commit is contained in:
epenet 2022-12-13 11:47:06 +01:00 committed by GitHub
parent 0f5c678708
commit 946d5535b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 21 deletions

View file

@ -13,12 +13,12 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ELECTRIC_POTENTIAL_VOLT,
ENERGY_WATT_HOUR,
FREQUENCY_HERTZ,
PERCENTAGE,
POWER_VOLT_AMPERE_REACTIVE,
TEMP_CELSIUS,
UnitOfApparentPower,
UnitOfElectricCurrent,
UnitOfFrequency,
UnitOfPower,
)
from homeassistant.core import HomeAssistant, callback
@ -101,7 +101,7 @@ INVERTER_ENTITY_DESCRIPTIONS: list[SensorEntityDescription] = [
SensorEntityDescription(
key="frequency_ac",
name="Frequency AC",
native_unit_of_measurement=FREQUENCY_HERTZ,
native_unit_of_measurement=UnitOfFrequency.HERTZ,
device_class=SensorDeviceClass.FREQUENCY,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
@ -285,7 +285,7 @@ METER_ENTITY_DESCRIPTIONS: list[SensorEntityDescription] = [
SensorEntityDescription(
key="frequency_phase_average",
name="Frequency phase average",
native_unit_of_measurement=FREQUENCY_HERTZ,
native_unit_of_measurement=UnitOfFrequency.HERTZ,
device_class=SensorDeviceClass.FREQUENCY,
state_class=SensorStateClass.MEASUREMENT,
),