zigul/HomeAssistant-CEZdistribuce

Not working since upgrade to Home Assistant 2023.10.0

Closed this issue · 2 comments

On startup, this error is logged and the sensor is not available...

Logger: homeassistant.components.binary_sensor
Source: helpers/entity_platform.py:507
Integration: Binárny snímač (documentation, issues)
First occurred: 12:28:04 (1 occurrences)
Last logged: 12:28:04

Error adding entities for domain binary_sensor with platform cezdistribuce
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1057, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 779, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 879, in _async_write_ha_state
state, attr = self._async_generate_attributes()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 820, in _async_generate_attributes
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 785, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/binary_sensor/init.py", line 218, in state
if (is_on := self.is_on) is None:
^^^^^^^^^^
File "/config/custom_components/cezdistribuce/binary_sensor.py", line 62, in is_on
return downloader.isHdo(self.responseJson["data"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/cezdistribuce/downloader.py", line 53, in isHdo
dayCalendar = jsonCalendar[0]
~~~~~~~~~~~~^^^
IndexError: list index out of range

Same problem in HA 2023.11.1

duplicate #19