Skip to content

Commit

Permalink
use consts for units
Browse files Browse the repository at this point in the history
  • Loading branch information
pail23 committed Feb 3, 2024
1 parent 1c8cd01 commit 29fa7e0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions custom_components/stiebel_eltron_isg/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
UnitOfTemperature,
UnitOfPressure,
UnitOfEnergy,
UnitOfFrequency,
UnitOfVolumeFlowRate,
)

from .const import (
Expand Down Expand Up @@ -343,31 +345,33 @@ def create_volume_stream_entity_description(name, key):
name="Ventilation air actual fan speed",
icon="mdi:fan",
has_entity_name=True,
native_unit_of_measurement="Hz",
native_unit_of_measurement=UnitOfFrequency.HERTZ,
device_class=SensorDeviceClass.FREQUENCY,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
VENTILATION_AIR_TARGET_FLOW_RATE,
name="Ventilation air target fan speed",
icon="mdi:fan",
has_entity_name=True,
native_unit_of_measurement="m3/h",
native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
EXTRACT_AIR_ACTUAL_FAN_SPEED,
name="Extract air actual fan speed",
icon="mdi:fan",
has_entity_name=True,
native_unit_of_measurement="Hz",
native_unit_of_measurement=UnitOfFrequency.HERTZ,
device_class=SensorDeviceClass.FREQUENCY,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
EXTRACT_AIR_TARGET_FLOW_RATE,
name="Extract air target fan speed",
icon="mdi:fan",
has_entity_name=True,
native_unit_of_measurement="m3/h",
native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR,
state_class=SensorStateClass.MEASUREMENT,
),
create_humidity_entity_description("Extract air humidity", EXTRACT_AIR_HUMIDITY),
Expand Down

0 comments on commit 29fa7e0

Please sign in to comment.