Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Technical upgrade for HA 2023.1
Browse files Browse the repository at this point in the history
Use enumerators UnitOfElectricPotential, UnitOfElectricCurrent instead of respective constants
  • Loading branch information
a529987659852 committed Jan 5, 2023
1 parent a1fc21e commit f351ea2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions custom_components/openwbmqtt/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
)
from homeassistant.components.switch import SwitchDeviceClass, SwitchEntityDescription
from homeassistant.const import (
ELECTRIC_CURRENT_AMPERE,
ELECTRIC_POTENTIAL_VOLT,
PERCENTAGE,
Platform,
UnitOfEnergy,
UnitOfLength,
UnitOfPower,
UnitOfElectricPotential,
UnitOfElectricCurrent,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import EntityCategory
Expand Down Expand Up @@ -434,7 +434,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
key="AConfigured",
name="Ladestromvorgabe",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
state_class=SensorStateClass.MEASUREMENT,
),
openwbSensorEntityDescription(
Expand Down Expand Up @@ -537,40 +537,40 @@ class openWBNumberEntityDescription(NumberEntityDescription):
key="VPhase1",
name="Spannung (Phase 1)",
device_class=SensorDeviceClass.VOLTAGE,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
entity_registry_enabled_default=False,
),
openwbSensorEntityDescription(
key="VPhase2",
name="Spannung (Phase 2)",
device_class=SensorDeviceClass.VOLTAGE,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
entity_registry_enabled_default=False,
),
openwbSensorEntityDescription(
key="VPhase3",
name="Spannung (Phase 3)",
device_class=SensorDeviceClass.VOLTAGE,
native_unit_of_measurement=ELECTRIC_POTENTIAL_VOLT,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
entity_registry_enabled_default=False,
),
openwbSensorEntityDescription(
key="APhase1",
name="Stromstärke (Phase 1)",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
),
openwbSensorEntityDescription(
key="APhase2",
name="Stromstärke (Phase 2)",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
),
openwbSensorEntityDescription(
key="APhase3",
name="Stromstärke (Phase 3)",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
),
]

Expand Down Expand Up @@ -720,7 +720,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
openWBNumberEntityDescription(
key="minCurrentMinPv",
name="Mindestladestrom (Modus Min+PV-Laden)",
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
device_class="Power",
native_min_value=6.0,
native_max_value=16.0,
Expand All @@ -738,7 +738,7 @@ class openWBNumberEntityDescription(NumberEntityDescription):
openWBNumberEntityDescription(
key="current",
name="Ladestromvorgabe (Modus Sofortladen)",
native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
device_class="Power",
native_min_value=6.0,
native_max_value=16.0,
Expand Down

0 comments on commit f351ea2

Please sign in to comment.