Skip to content

Commit

Permalink
Use new UnitOf enums
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Jan 5, 2023
1 parent e00a23e commit 29bd0b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/jablotron100/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
SensorStateClass,
)
from homeassistant.const import (
ELECTRIC_CURRENT_MILLIAMPERE,
ELECTRIC_POTENTIAL_VOLT,
PERCENTAGE,
UnitOfElectricCurrent,
UnitOfElectricPotential,
UnitOfTemperature,
)
from homeassistant.config_entries import ConfigEntry
Expand Down Expand Up @@ -51,14 +51,14 @@
EntityType.VOLTAGE: SensorEntityDescription(
key=EntityType.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
device_class=SensorDeviceClass.VOLTAGE,
entity_category=EntityCategory.DIAGNOSTIC,
),
EntityType.CURRENT: SensorEntityDescription(
key=EntityType.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=ELECTRIC_CURRENT_MILLIAMPERE,
native_unit_of_measurement=UnitOfElectricCurrent.MILLIAMPERE,
device_class=SensorDeviceClass.CURRENT,
entity_category=EntityCategory.DIAGNOSTIC,
),
Expand Down

0 comments on commit 29bd0b2

Please sign in to comment.