anotherjulien / OWNd

OpenWebNet daemon
GNU Lesser General Public License v3.0
30 stars 11 forks source link

Cooling related offset values crash event loop #9

Open michnovka opened 1 month ago

michnovka commented 1 month ago

The message in question was '*#4*2*13*6##'

This message has to do with Dimension 13 - local offset, specifically for cooling.

Local Offset (DIMENSION 13) According to the manual, the local offset (OL) can have these values:

00: knob on 0 01: knob on +1 (degree) 11: knob on -1 (degree) 02: knob on +2 (degree) 12: knob on -2 (degree) 03: knob on +3 (degree) 13: knob on -3 (degree) 4: knob on Local OFF 5: knob on Local protection 6: ON speed 1 (for fan coil) 7: ON speed 2 (for fan coil) 8: ON speed 3 (for fan coil)

The code supports only the first cases, it does not support options 4-8

homeassistant  | 2024-08-30 13:07:44.891 ERROR (MainThread) [custom_components.myhome] [MH202 gateway - 192.168.1.40] Event session crashed.
homeassistant  | Traceback (most recent call last):
homeassistant  |   File "/usr/local/lib/python3.12/site-packages/OWNd/connection.py", line 650, in get_next
homeassistant  |     _message = OWNMessage.parse(_decoded_data)
homeassistant  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/local/lib/python3.12/site-packages/OWNd/message.py", line 165, in parse
homeassistant  |     return OWNEvent.parse(data)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/local/lib/python3.12/site-packages/OWNd/message.py", line 354, in parse
homeassistant  |     return OWNHeatingEvent(data)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/local/lib/python3.12/site-packages/OWNd/message.py", line 777, in __init__
homeassistant  |     self._local_offset = -int(f"{self._dimension_value[0][1:]}")
homeassistant  |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  | ValueError: invalid literal for int() with base 10: ''