Sha-Darim / brandriskute

The custom compontnet will get fire risks and fire prohibition from the Brandrisk Ute API for the supplied position.
5 stars 1 forks source link

Error while setting up brandriskute platform for sensor #4

Open ehn opened 3 years ago

ehn commented 3 years ago

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.

Sha-Darim commented 3 years ago

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

ehn commented 3 years ago

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