Skip to content

get_scenes() fails with invalid type error #119

Description

@BenoitGodin

Whenver I call get_scenes, I get the following error

import dirigera
dirigera_hub = dirigera.Hub(token="XXXXXXXXX", ip_address="XXXXXXXXX")
dirigera_hub.get_scenes()
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.10/dist-packages/dirigera/hub/hub.py", line 347, in get_scenes
return [dict_to_scene(scene, self) for scene in scenes]
File "/usr/local/lib/python3.10/dist-packages/dirigera/hub/hub.py", line 347, in
return [dict_to_scene(scene, self) for scene in scenes]
File "/usr/local/lib/python3.10/dist-packages/dirigera/devices/scene.py", line 148, in dict_to_scene
return Scene(dirigeraClient=dirigera_client, **data)
File "/usr/local/lib/python3.10/dist-packages/pydantic/main.py", line 253, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Scene
commands.0
Input should be a valid string [type=string_type, input_value={'type': 'device', 'id': ...e_open', 'volume': 93}]}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.11/v/string_type

It seems attributes of one of the device is not correctly parsed.

According to input_type value, this is about an open/close sensor for which I configured to play a chime (volume 93) when the state changes to open. Can you have a look at this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions