Skip to content

Commit

Permalink
Merge pull request #223 from CSchlipp/bugfix/energy-sensors2
Browse files Browse the repository at this point in the history
Split Total/Total_Increasing sensors
  • Loading branch information
pail23 authored Apr 1, 2024
2 parents ad38a5b + acba186 commit 76a0810
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions custom_components/stiebel_eltron_isg/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,6 @@ def create_volume_stream_entity_description(name, key):


ENERGY_SENSOR_TYPES = [
create_daily_energy_entity_description(
"Produced Heating Today",
PRODUCED_HEATING_TODAY,
),
create_energy_entity_description(
"Produced Heating Total",
PRODUCED_HEATING_TOTAL,
Expand All @@ -331,10 +327,6 @@ def create_volume_stream_entity_description(name, key):
"Produced Heating",
PRODUCED_HEATING,
),
create_daily_energy_entity_description(
"Produced Water Heating Today",
PRODUCED_WATER_HEATING_TODAY,
),
create_energy_entity_description(
"Produced Water Heating Total",
PRODUCED_WATER_HEATING_TOTAL,
Expand All @@ -343,10 +335,6 @@ def create_volume_stream_entity_description(name, key):
"Produced Water Heating",
PRODUCED_WATER_HEATING
),
create_daily_energy_entity_description(
"Consumed Heating Today",
CONSUMED_HEATING_TODAY,
),
create_energy_entity_description(
"Consumed Heating Total",
CONSUMED_HEATING_TOTAL,
Expand All @@ -355,10 +343,6 @@ def create_volume_stream_entity_description(name, key):
"Consumed Heating",
CONSUMED_HEATING,
),
create_daily_energy_entity_description(
"Consumed Water Heating Today",
CONSUMED_WATER_HEATING_TODAY,
),
create_energy_entity_description(
"Consumed Water Heating Total",
CONSUMED_WATER_HEATING_TOTAL,
Expand All @@ -369,6 +353,25 @@ def create_volume_stream_entity_description(name, key):
),
]

ENERGY_DAILY_SENSOR_TYPES = [
create_daily_energy_entity_description(
"Produced Heating Today",
PRODUCED_HEATING_TODAY,
),
create_daily_energy_entity_description(
"Produced Water Heating Today",
PRODUCED_WATER_HEATING_TODAY,
),
create_daily_energy_entity_description(
"Consumed Heating Today",
CONSUMED_HEATING_TODAY,
),
create_daily_energy_entity_description(
"Consumed Water Heating Today",
CONSUMED_WATER_HEATING_TODAY,
),
]


COMPRESSOR_SENSOR_TYPES = [
SensorEntityDescription(
Expand Down Expand Up @@ -472,6 +475,14 @@ async def async_setup_entry(hass, entry, async_add_devices):
entities.append(sensor)

for description in ENERGY_SENSOR_TYPES:
sensor = StiebelEltronISGSensor(
coordinator,
entry,
description,
)
entities.append(sensor)

for description in ENERGY_DAILY_SENSOR_TYPES:
sensor = StiebelEltronISGEnergySensor(
coordinator,
entry,
Expand Down

0 comments on commit 76a0810

Please sign in to comment.