Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug in decoding RetrieveScheduleResponse (#363)
Fixes a bug decoding an integer in the wrong base. Currently able to reproduce when using a rain delay above 10: ``` Unexpected error fetching x.x.x.x Schedule data: invalid literal for int() with base 10: '0E' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/rainbird/coordinator.py", line 150, in _async_update_data return await self._controller.get_schedule() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrainbird/async_client.py", line 428, in get_schedule result = await self._process_command( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrainbird/async_client.py", line 489, in _process_command decoded = rainbird.decode(decrypted_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrainbird/rainbird.py", line 187, in decode return {TYPE: cmd_template[TYPE], **decoder(data, cmd_template)} ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyrainbird/rainbird.py", line 45, in decode_schedule "rainDelay": int(rest[4:6]), ^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '0E' ```
- Loading branch information