kodebach / hacs-idm-heatpump

HACS integration for IDM heat pumps
MIT License
20 stars 1 forks source link

Easy to solve issue - Status of activator for the rooms not working #123

Open AndyNew2 opened 1 week ago

AndyNew2 commented 1 week ago

Easy to fix issue:

When heatpump is in cooling mode used together with NavigatorPro with Zonemodules, the activator monitor do not work. I see in the "information - Zonemodules" the Status for each "Antrieb" is 2 instead of the documented 1. It seems they now destinguish between activating the motor because of heating (1) or cooling (2). So just allow both values 1 and 2 and everything should be fine. I try to find myself the place and try it and upload the changes needed.

AndyNew2 commented 1 week ago

In file sensor_addresses.py line 112 ff: def decode(self, decoder: BinaryPayloadDecoder) -> tuple[bool, bool]: """Decode this sensor's value.""" value = decoder.decode_16bit_uint() LOGGER.debug("raw value (uint16) for %s: %d", self.name, value) return (True, value == 1)

I would change to: def decode(self, decoder: BinaryPayloadDecoder) -> tuple[bool, bool]: """Decode this sensor's value.""" value = decoder.decode_16bit_uint() LOGGER.debug("raw value (uint16) for %s: %d", self.name, value) return (True, value >= 1)

This is Python Syntax I have problems. So it return True when the condition after the value given is true, correct? In in case the condition is false, it automatically return False? I would have written in the last line return (value>=1)
This is C, C++ logic, I am not so familar with Python.

I still need to learn Python. I can't test in the moment, since cooling is off. Will try tomorrow and report if this solves the issue.

Anyhow I fear you do not like my change and do it properly by changing the sensor type to Enum instead Binary?

AndyNew2 commented 1 week ago

Could test it today. Modification works as expected. I would be happy to change it that way.