golles / ha-kamstrup_403

Custom component that integrates the Kamstrup 403 heating system into Home Assistant. This component does also support a few other heating systems
MIT License
73 stars 12 forks source link

Make scan interval user configurable #15

Closed golles closed 2 years ago

golles commented 2 years ago

Requested in #14

golles commented 2 years ago

Found an issue:

2022-06-12 10:34:10 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform kamstrup_403
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 809, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 324, in async_added_to_hass
    self.coordinator.async_add_listener(self._handle_coordinator_update)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 93, in async_add_listener
    self._schedule_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 131, in _schedule_refresh
    utcnow().replace(microsecond=0) + self.update_interval,
TypeError: unsupported operand type(s) for +: 'datetime.datetime' and 'int'
2022-06-12 10:34:10 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up kamstrup_403 platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 257, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 809, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 324, in async_added_to_hass
    self.coordinator.async_add_listener(self._handle_coordinator_update)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 93, in async_add_listener
    self._schedule_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 131, in _schedule_refresh
    utcnow().replace(microsecond=0) + self.update_interval,
TypeError: unsupported operand type(s) for +: 'datetime.datetime' and 'int'