thomasgermain / pymultiMATIC

Python interface with Vaillant multiMATIC
MIT License
56 stars 11 forks source link

KeyError: 'tuesday' #71

Closed dupondje closed 3 years ago

dupondje commented 3 years ago

Some entries fail to get added:

2021-06-22 15:47:25 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up multimatic platform for binary_sensor
Traceback (most recent call last):
  File "/opt/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 258, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/opt/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
    await asyncio.gather(*tasks)
  File "/opt/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/opt/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 615, in add_to_platform_finish
    self.async_write_ha_state()
  File "/opt/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 368, in async_write_ha_state
    self._async_write_ha_state()
  File "/opt/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 402, in _async_write_ha_state
    state = self._stringify_state()
  File "/opt/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity.py", line 374, in _stringify_state
    state = self.state
  File "/opt/homeassistant/lib/python3.8/site-packages/homeassistant/components/binary_sensor/__init__.py", line 162, in state
    return STATE_ON if self.is_on else STATE_OFF
  File "/home/homeassistant/.homeassistant/custom_components/multimatic/binary_sensor.py", line 77, in is_on
    a_mode = self.active_mode
  File "/home/homeassistant/.homeassistant/custom_components/multimatic/binary_sensor.py", line 95, in active_mode
    return self.coordinator.data.get_active_mode_circulation()
  File "/opt/homeassistant/lib/python3.8/site-packages/pymultimatic/model/system.py", line 228, in get_active_mode_circulation
    return circulation.active_mode
  File "/opt/homeassistant/lib/python3.8/site-packages/pymultimatic/model/common.py", line 52, in active_mode
    setting = self.time_program.get_for(datetime.now())
  File "/opt/homeassistant/lib/python3.8/site-packages/pymultimatic/model/timeprogram.py", line 107, in get_for
    tp_day = self.days[day]
KeyError: 'tuesday'
thomasgermain commented 3 years ago

please report the issue on vaillant-component (also note I cannot fix that, the API itself is returning wrong response)