HTTP Internal Error 500 on finished linking with refactor
notcat opened this issue · 1 comments
notcat commented
Describe the bug
When trying to add the bridge to either the Hue app, Hue Essentials, or even Home Assistant, I get a Internal Server 500 HTTP error from Hue Essentials and also Home Assistant. In the log in the docker container, I can see the error as such:
2022-01-27 09:03:27,161 INFO emulated_hue.config -- Link mode is enabled for the next 5 minutes.
2022-01-27 09:03:28,176 INFO emulated_hue.apiv1 -- Client Hue Essentials#SM-A515W registered
2022-01-27 09:03:28,259 ERROR aiohttp.server -- Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/app/emulated_hue/apiv1.py", line 69, in wrapped_func
return await func(cls, request)
File "/app/emulated_hue/apiv1.py", line 444, in get_full_state
"lights": await self.__async_get_all_lights(),
File "/app/emulated_hue/apiv1.py", line 748, in __async_get_all_lights
device = await async_get_device(
File "/app/emulated_hue/controllers/devices.py", line 424, in async_get_device
device_obj = RGBWDevice(
File "/app/emulated_hue/controllers/devices.py", line 124, in __init__
self._config_state: EntityState = EntityState.from_config(
File "/app/emulated_hue/controllers/models.py", line 80, in from_config
return EntityState(**save_state)
File "pydantic/main.py", line 331, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 2 validation errors for EntityState
power_state
none is not an allowed value (type=type_error.none.not_allowed)
reachable
none is not an allowed value (type=type_error.none.not_allowed)
Steps to Reproduce
Expected behavior
The app/hass to connect
Logs
Provided above in the bug description
Hardware Info:
- Architecture (Ex: x86, ARM): x86
- Addon version (Ex: stable or dev): stable
- Value of "tag_commit_or_branch" if using dev: hass-emulated-hue/core:refactor-2341482f82518bb02da0ecf2d69a0ca5b899a1d`
- OS (Ex: Windows 10, Ubuntu Buster): debian
- Hardware (Ex: PC, Raspberry Pi 1/2/3/Zero): PC
Additional context
alexyao2015 commented
Thanks for testing! I just pushed a new fix that should resolve the issue. Additionally, do NOT add the bridge to home assistant as it will cause problems. I am working on preventing it from being discovered by home assistant.