Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 899, in _async_registry_updated
await self.platform.async_add_entities([self])
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 673, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 776, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 570, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 969, in state
if (is_on := self.is_on) is None:
File "/config/custom_components/mila/entities/appliance/fan.py", line 66, in is_on
return self.speed is not None and self.speed > 0
File "/config/custom_components/mila/entities/appliance/fan.py", line 57, in speed
return sensor["latest"]["value"] if sensor else None
TypeError: 'NoneType' object is not subscriptable
I'm getting a large number of errors appearing in the logs
The relevant code:
ha-mila/custom_components/mila/entities/appliance/fan.py
Lines 53 to 57 in c097220