Leggin / dirigera

This repository provides an unofficial Python client for controlling the IKEA Dirigera Smart Home Hub.
MIT License
119 stars 23 forks source link

Error for pydantic post scene changes #100

Open sanjoyg opened 4 weeks ago

sanjoyg commented 4 weeks ago

Getting the following errors while executing get_scenes @Leggin

2024-10-16 00:28:17.656 ERROR (MainThread) [homeassistant.components.scene] Error while setting up dirigera_platform platform for scene Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/dirigera_platform/scene.py", line 38, in async_setup_entry scenes: list[DirigeraScene] = await hass.async_add_executor_job(hub.get_scenes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/hub/hub.py", line 337, in get_scenes return [dict_to_scene(scene, self) for scene in scenes] ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/devices/scene.py", line 148, in dict_to_scene return Scene(dirigeraClient=dirigera_client, **data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__ File "pydantic/main.py", line 1074, in pydantic.main.validate_model File "pydantic/fields.py", line 892, in pydantic.fields.ModelField.validate File "pydantic/fields.py", line 925, in pydantic.fields.ModelField._validate_sequence_like File "pydantic/fields.py", line 1091, in pydantic.fields.ModelField._validate_singleton File "pydantic/fields.py", line 881, in pydantic.fields.ModelField.validate File "pydantic/fields.py", line 1098, in pydantic.fields.ModelField._validate_singleton File "pydantic/fields.py", line 1154, in pydantic.fields.ModelField._apply_validators File "pydantic/class_validators.py", line 337, in pydantic.class_validators._generic_validator_basic.lambda13 File "pydantic/main.py", line 711, in pydantic.main.BaseModel.validate File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__ File "pydantic/main.py", line 1074, in pydantic.main.validate_model File "pydantic/fields.py", line 881, in pydantic.fields.ModelField.validate File "pydantic/fields.py", line 1098, in pydantic.fields.ModelField._validate_singleton File "pydantic/fields.py", line 1154, in pydantic.fields.ModelField._apply_validators File "pydantic/class_validators.py", line 337, in pydantic.class_validators._generic_validator_basic.lambda13 File "pydantic/main.py", line 711, in pydantic.main.BaseModel.validate File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__ File "pydantic/main.py", line 1074, in pydantic.main.validate_model File "pydantic/fields.py", line 857, in pydantic.fields.ModelField.validate pydantic.errors.ConfigError: field "trigger" not yet prepared so type is still a ForwardRef, you might need to call EndTriggerEvent.update_forward_refs().

Leggin commented 4 weeks ago

Hey @sanjoyg I tried to reproduce this with various configurations of scenes, but was not able to. Can you provide the scene that is causing this?