Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pail23 committed May 30, 2024
1 parent 6806e26 commit a3314f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 11 additions & 7 deletions custom_components/stiebel_eltron_isg/wpm_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,6 @@ def read_modbus_system_paramter(self) -> dict:
result["system_paramaters"] = list(inverter_data.registers)
return result



def read_modbus_energy(self) -> dict:
"""Read the energy consumption related values from the ISG."""
result = {}
Expand Down Expand Up @@ -710,7 +708,8 @@ def read_modbus_energy(self) -> dict:
produced_heating_total_high * 1000 + produced_heating_total_low
)
result[PRODUCED_HEATING] = self.assign_if_increased(
result[PRODUCED_HEATING_TOTAL] + result[PRODUCED_HEATING_TODAY], PRODUCED_HEATING
result[PRODUCED_HEATING_TOTAL] + result[PRODUCED_HEATING_TODAY],
PRODUCED_HEATING,
)

result[PRODUCED_WATER_HEATING_TODAY] = produced_water_today
Expand All @@ -719,23 +718,28 @@ def read_modbus_energy(self) -> dict:
)
result[PRODUCED_WATER_HEATING] = self.assign_if_increased(
result[PRODUCED_WATER_HEATING_TOTAL]
+ result[PRODUCED_WATER_HEATING_TODAY], PRODUCED_WATER_HEATING
+ result[PRODUCED_WATER_HEATING_TODAY],
PRODUCED_WATER_HEATING,
)

result[CONSUMED_HEATING_TODAY] = consumed_heating_today
result[CONSUMED_HEATING_TOTAL] = (
consumed_heating_total_high * 1000 + consumed_heating_total_low
)
result[CONSUMED_HEATING] = self.assign_if_increased(
result[CONSUMED_HEATING_TOTAL] + result[CONSUMED_HEATING_TODAY], CONSUMED_HEATING
result[CONSUMED_HEATING_TOTAL] + result[CONSUMED_HEATING_TODAY],
CONSUMED_HEATING,
)

result[CONSUMED_WATER_HEATING_TODAY] = consumed_water_today
result[CONSUMED_WATER_HEATING_TOTAL] = consumed_water_total_high * 1000 + consumed_water_total_low, CONSUMED_WATER_HEATING_TOTAL
result[CONSUMED_WATER_HEATING_TOTAL] = (
consumed_water_total_high * 1000 + consumed_water_total_low
)

result[CONSUMED_WATER_HEATING] = self.assign_if_increased(
result[CONSUMED_WATER_HEATING_TOTAL]
+ result[CONSUMED_WATER_HEATING_TODAY], CONSUMED_WATER_HEATING
+ result[CONSUMED_WATER_HEATING_TODAY],
CONSUMED_WATER_HEATING,
)
return result

Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
colorlog==6.8.2
pip>=21.0,<24.1
pymodbus>=3.6.8
ruff==0.4.5
pytest-homeassistant-custom-component==0.13.109
ruff==0.4.6
pytest-homeassistant-custom-component==0.13.125

0 comments on commit a3314f6

Please sign in to comment.