Sha-Darim/brandriskute

Error while setting up brandriskute platform for sensor

ehn opened this issue · 2 comments

ehn commented

I'm getting this traceback in the log:

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 587, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 711, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 464, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 498, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 470, in _stringify_state
    state = self.state
  File "/config/custom_components/brandriskute/sensor.py", line 179, in state
    return self._api.prohibition['status']
TypeError: 'NoneType' object is not subscriptable

Running Home Assistant 2021.8.8 and brandriskute 1.1.3 installed through HACS.

Thank you for the feedback. I'll take a look at this.

ehn commented

Thanks! Let me know if you need any additional input or if I can help you debug!