Skip to content

Commit

Permalink
Replaced deprecated units to remove warning
Browse files Browse the repository at this point in the history
  • Loading branch information
gndean committed Jan 21, 2024
1 parent 87029fc commit ae01469
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions custom_components/hypervolt_charger/sensor.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
from dataclasses import dataclass
import logging
from typing import Optional

from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorStateClass,
)
from dataclasses import dataclass
from typing import Optional
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.const import (
UnitOfEnergy,
PERCENTAGE,
UnitOfElectricCurrent,
UnitOfElectricPotential,
UnitOfEnergy,
UnitOfMass,
UnitOfPower,
ELECTRIC_CURRENT_AMPERE,
ELECTRIC_POTENTIAL_VOLT,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity

from .const import DOMAIN
from .hypervolt_device_state import HypervoltReleaseState
from .hypervolt_update_coordinator import HypervoltUpdateCoordinator
from .hypervolt_entity import HypervoltEntity
from .const import DOMAIN
from .hypervolt_update_coordinator import HypervoltUpdateCoordinator

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -70,7 +70,7 @@ async def async_setup_entry(
"current_session_current_milliamps",
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
unit_of_measure=ELECTRIC_CURRENT_AMPERE,
unit_of_measure=UnitOfElectricCurrent.AMPERE,
scale_factor=0.001,
),
HypervoltSensor(
Expand All @@ -79,7 +79,7 @@ async def async_setup_entry(
"current_session_ct_current",
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
unit_of_measure=ELECTRIC_CURRENT_AMPERE,
unit_of_measure=UnitOfElectricCurrent.AMPERE,
scale_factor=0.001,
),
HypervoltSensor(
Expand All @@ -96,7 +96,7 @@ async def async_setup_entry(
"current_session_voltage",
device_class=SensorDeviceClass.VOLTAGE,
state_class=SensorStateClass.MEASUREMENT,
unit_of_measure=ELECTRIC_POTENTIAL_VOLT,
unit_of_measure=UnitOfElectricPotential.VOLT,
),
HypervoltSensor(
coordinator,
Expand Down

0 comments on commit ae01469

Please sign in to comment.