Hi,
I found bug. When I connected new type SOMRIG shortcut button i got error in validation.
Traceback (most recent call last):
File "/Users/slajob/git/dirigera_local/test.py", line 10, in <module>
print(dirigera_hub.get_controllers())
File "/Users/slajob/git/dirigera_local/venv/lib/python3.9/site-packages/dirigera/hub/hub.py", line 237, in get_controllers
return [dict_to_controller(controller, self) for controller in controllers]
File "/Users/slajob/git/dirigera_local/venv/lib/python3.9/site-packages/dirigera/hub/hub.py", line 237, in <listcomp>
return [dict_to_controller(controller, self) for controller in controllers]
File "/Users/slajob/git/dirigera_local/venv/lib/python3.9/site-packages/dirigera/devices/controller.py", line 34, in dict_to_controller
return Controller(dirigeraClient=dirigera_client, **data)
File "/Users/slajob/git/dirigera_local/venv/lib/python3.9/site-packages/pydantic/main.py", line 171, in __init__
self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Controller
room
Field required [type=missing, input_value={'dirigeraClient': <dirig...: [], 'isHidden': False}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.6/v/missing
Hi, I found bug. When I connected new type SOMRIG shortcut button i got error in validation.
So I checked my raw api return https://192.168.0.74:8443/v1/devices and old TRADFRI shortcut button json is:
and new SOMRIG shortcut button json is:
So you can notice there is a room parameter missing. After this small change Room to optional I received controllers correctly: