RenierM26 / hass_ids_hyyp

Home Assistant integration for IDS Hyyp (Beta)
GNU General Public License v3.0
4 stars 5 forks source link

Two sites #7

Open Owewolf opened 1 year ago

Owewolf commented 1 year ago

I have two sites on my ids Hyyp app. My log in returns E7AF40B9-CE7D-4982-96BC-21439F267E26

Owewolf commented 1 year ago

This is the Trace error I receive Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/ids_hyyp/coordinator.py", line 35, in _async_update_data return await self.hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/pyhyypapi/client.py", line 138, in load_alarm_infos return HyypAlarmInfos(self).status() File "/usr/local/lib/python3.10/site-packages/pyhyypapi/alarm_info.py", line 124, in status formatted_data: dict[Any, Any] = self._format_data() File "/usr/local/lib/python3.10/site-packages/pyhyypapi/alarm_info.py", line 79, in _format_data site_ids[site]["partitions"][partition]["zones"] = { File "/usr/local/lib/python3.10/site-packages/pyhyypapi/alarm_info.py", line 82, in if key in site_ids[site]["partitions"][partition]["zoneIds"] KeyError: 1638155 2023-01-24 20:57:40.429 WARNING (MainThread) [homeassistant.config_entries] Config entry 'sgmohaud@me.com' for ids_hyyp integration not ready yet: 1638155; Retrying in background 2023-01-24 20:57:46.520 ERROR (MainThread) [custom_components.ids_hyyp.coordinator] Unexpected error fetching ids_hyyp data: 1638155 Traceback (most recent call last):

The error message is indicating that there is a KeyError being raised in the _format_data method of the pyhyypapi.alarm_info module. This error is caused when the key variable, which is supposed to be a zone ID, is not found in the site_ids[site]["partitions"][partition]["zoneIds"] dictionary.

The error message also shows that the error is occurring in the HyypDataUpdateCoordinator class in the _async_update_data method. This class is used to update the data of the ids_hyyp component and this error is likely caused by an issue with the data returned by the ids_hyyp API.

It appears that the site_ids[site]["partitions"][partition]["zoneIds"] dictionary is missing a key with the value of 1638155. This zoneId is not present in the data returned by the API, the code is trying to access it, which is causing the KeyError.

You can try to check the API response if it's missing the key, or if there is any other issue with the data. It could also be caused by an issue with the API client configuration or the API endpoint.

I recommend checking the API documentation, ensuring that you are using the correct endpoint and that the API client is configured correctly. If the issue persists, please reach out to the API provider for further assistance.