sanjoyg / dirigera_platform

HomeAssistant Integration for Dirigera Platform
MIT License
122 stars 16 forks source link

v2.3 Failed to setup #94

Open Edluund opened 1 month ago

Edluund commented 1 month ago

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/dirigera_platform/__init__.py", line 117, in async_setup_entry await platform.make_devices(hass,hass_data[CONF_IP_ADDRESS], hass_data[CONF_TOKEN]) File "/config/custom_components/dirigera_platform/ikea_gateway.py", line 97, in make_devices motion_sensors = await hass.async_add_executor_job(hub.get_motion_sensors) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 256, in get_motion_sensors return [dict_to_motion_sensor(sensor, self) for sensor in sensors] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/devices/motion_sensor.py", line 34, in dict_to_motion_sensor return MotionSensor(dirigeraClient=dirigera_client, **data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__ pydantic.error_wrappers.ValidationError: 1 validation error for MotionSensor attributes -> isOn field required (type=value_error.missing)

sanjoyg commented 1 month ago

It seems the motion sensor you have doesnt have isOn field. What kind of motion sensors do you have in your installation

Edluund commented 1 month ago

Its the old motion sensor: Firmware: 24.4.5 Model: TRADFRI motion sensor Product-ID: E1745

sanjoyg commented 1 month ago

That is why its failing as it doesnt have isOn property. Would u want it to be ignored... i can put in a fix

Edluund commented 1 month ago

As long as I'm still able to get data from the motion sensor a fix is fine