hass-emulated-hue/core

Error obtaining entity_id for some entities

alexyao2015 opened this issue · 0 comments

Describe the bug

Occasionally after ring periods of runtime, this error will crop up in the logs. Not sure if the causes or the exact method of reproduction, but this has happened more than once.

Restarts will typically fix the issue immediately.

Steps to Reproduce

Expected behavior

Logs

Hardware Info:

  • Architecture (Ex: x86, ARM):
  • Addon version (Ex: stable or dev):
    • Value of "tag_commit_or_branch" if using dev:
  • OS (Ex: Windows 10, Ubuntu Buster):
  • Hardware (Ex: PC, Raspberry Pi 1/2/3/Zero):

Additional context

2021-10-08 07:22:37,545 ERROR aiohttp.server -- Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/app/emulated_hue/api.py", line 92, in wrapped_func
    return await func(cls, request)
  File "/app/emulated_hue/api.py", line 498, in get_full_state
    "lights": await self.__async_get_all_lights(),
  File "/app/emulated_hue/api.py", line 938, in __async_get_all_lights
    entity_id = entity["entity_id"]
TypeError: 'NoneType' object is not subscriptable