Skip to content

Commit

Permalink
increasing only for lwz
Browse files Browse the repository at this point in the history
  • Loading branch information
pail23 committed Apr 1, 2024
1 parent c93ebf3 commit 08fe9da
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions custom_components/stiebel_eltron_isg/lwz_coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,52 +290,52 @@ def read_modbus_energy(self) -> dict:
decoder = BinaryPayloadDecoder.fromRegisters(
inverter_data.registers, byteorder=Endian.BIG
)
produced_heating_today = decoder.decode_16bit_uint()
produced_heating_today = self.assign_if_increased(decoder.decode_16bit_uint(), PRODUCED_HEATING_TODAY)
produced_heating_total_low = decoder.decode_16bit_uint()
produced_heating_total_high = decoder.decode_16bit_uint()
produced_water_today = decoder.decode_16bit_uint()
produced_water_today = self.assign_if_increased(decoder.decode_16bit_uint(), PRODUCED_WATER_HEATING_TODAY)
produced_water_total_low = decoder.decode_16bit_uint()
produced_water_total_high = decoder.decode_16bit_uint()

result[PRODUCED_HEATING_TODAY] = produced_heating_today
result[PRODUCED_HEATING_TOTAL] = (
produced_heating_total_high * 1000 + produced_heating_total_low
)
result[PRODUCED_HEATING] = (
result[PRODUCED_HEATING_TOTAL] + result[PRODUCED_HEATING_TODAY]
result[PRODUCED_HEATING] = self.assign_if_increased(
result[PRODUCED_HEATING_TOTAL] + result[PRODUCED_HEATING_TODAY], PRODUCED_HEATING
)

result[PRODUCED_WATER_HEATING_TODAY] = produced_water_today
result[PRODUCED_WATER_HEATING_TOTAL] = (
produced_water_total_high * 1000 + produced_water_total_low
)
result[PRODUCED_WATER_HEATING] = (
result[PRODUCED_WATER_HEATING] = self.assign_if_increased(
result[PRODUCED_WATER_HEATING_TOTAL]
+ result[PRODUCED_WATER_HEATING_TODAY]
+ result[PRODUCED_WATER_HEATING_TODAY], PRODUCED_WATER_HEATING
)

decoder.skip_bytes(30)
consumed_heating_today = decoder.decode_16bit_uint()
consumed_heating_today = self.assign_if_increased(decoder.decode_16bit_uint(), CONSUMED_HEATING_TODAY)
consumed_heating_total_low = decoder.decode_16bit_uint()
consumed_heating_total_high = decoder.decode_16bit_uint()
consumed_water_today = decoder.decode_16bit_uint()
consumed_water_today = self.assign_if_increased(decoder.decode_16bit_uint(), CONSUMED_WATER_HEATING_TODAY)
consumed_water_total_low = decoder.decode_16bit_uint()
consumed_water_total_high = decoder.decode_16bit_uint()
result[CONSUMED_HEATING_TODAY] = consumed_heating_today
result[CONSUMED_HEATING_TOTAL] = (
consumed_heating_total_high * 1000 + consumed_heating_total_low
)
result[CONSUMED_HEATING] = (
result[CONSUMED_HEATING_TOTAL] + result[CONSUMED_HEATING_TODAY]
result[CONSUMED_HEATING] = self.assign_if_increased(
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
)
result[CONSUMED_WATER_HEATING] = (
result[CONSUMED_WATER_HEATING] = self.assign_if_increased(
result[CONSUMED_WATER_HEATING_TOTAL]
+ result[CONSUMED_WATER_HEATING_TODAY]
+ result[CONSUMED_WATER_HEATING_TODAY], CONSUMED_WATER_HEATING
)

result[COMPRESSOR_HEATING] = decoder.decode_16bit_uint()
Expand Down

0 comments on commit 08fe9da

Please sign in to comment.