diff --git a/custom_components/stiebel_eltron_isg/wpm_coordinator.py b/custom_components/stiebel_eltron_isg/wpm_coordinator.py index 3610dc2..9e791f1 100644 --- a/custom_components/stiebel_eltron_isg/wpm_coordinator.py +++ b/custom_components/stiebel_eltron_isg/wpm_coordinator.py @@ -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 = {} @@ -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 @@ -719,7 +718,8 @@ 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 @@ -727,15 +727,19 @@ def read_modbus_energy(self) -> dict: 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 diff --git a/requirements.txt b/requirements.txt index 2bb5d47..68022cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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