Add myuplink sensor descriptions for current and frequency sensors (#109784)

Add device_descriptions for current and frequency sensors
This commit is contained in:
Åke Strandberg 2024-02-06 12:40:03 +01:00 committed by GitHub
parent 5de76c0be0
commit 25f065a980
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,7 +9,11 @@ from homeassistant.components.sensor import (
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import UnitOfTemperature
from homeassistant.const import (
UnitOfElectricCurrent,
UnitOfFrequency,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType
@ -25,6 +29,18 @@ DEVICE_POINT_DESCRIPTIONS = {
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
),
"A": SensorEntityDescription(
key="ampere",
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
),
"Hz": SensorEntityDescription(
key="hertz",
device_class=SensorDeviceClass.FREQUENCY,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfFrequency.HERTZ,
),
}