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

@ -16,9 +16,9 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ELECTRIC_POTENTIAL_VOLT,
ENERGY_KILO_WATT_HOUR,
FREQUENCY_HERTZ,
PERCENTAGE,
UnitOfElectricCurrent,
UnitOfFrequency,
UnitOfPower,
)
from homeassistant.core import HomeAssistant
@ -80,7 +80,7 @@ POWERWALL_INSTANT_SENSORS = (
name="Frequency Now",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.FREQUENCY,
native_unit_of_measurement=FREQUENCY_HERTZ,
native_unit_of_measurement=UnitOfFrequency.HERTZ,
entity_registry_enabled_default=False,
value_fn=_get_meter_frequency,
),