Closed akalderon closed 1 year ago
Please make sure you've upgraded to the latest version that I released a few hours ago. They did make a change that broke things (now fixed). But I don't have any Pura 4 devices to test with at the moment to see if there is a different issue.
Works like a champ - thank you very much as always for providing this integration!
I bought and installed two Pura 4 devices in addition to 4 Pura 3 devices that pre-existed - all was fine for a couple of days and now the integration fails to initialize. Not sure if the Pura 4 addition caused this or if Pura mangled their API yet once again but as it stands now the integration is inoperable.
excerpt from the log file is below
<File "/config/custom_components/pura/coordinator.py", line 50, in _async_update_data if devices := await self.hass.async_add_executor_job(self.api.get_devices): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pypura/pura.py", line 97, in get_devices return self.get("users/devices") ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pypura/pura.py", line 199, in get return self.__request("get", url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pypura/pura.py", line 194, in __request response.raise_for_status() File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://trypura.io/mobile/api/users/devices 2023-09-01 14:33:24.788 ERROR (SyncWorker_11) [pypura.pura] Status: 400 - {'message': 'getDevicesAndMigrate() Error'} 2023-09-01 14:33:24.793 ERROR (MainThread) [custom_components.pura.coordinator] Unknown exception while updating Pura data: 400 Client Error: Bad Request for url: https://trypura.io/mobile/api/users/devices Traceback (most recent call last): File "/config/custom_components/pura/coordinator.py", line 50, in _async_update_data if devices := await self.hass.async_add_executor_job(self.api.get_devices): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pypura/pura.py", line 97, in get_devices return self.get("users/devices") ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pypura/pura.py", line 199, in get return self.__request("get", url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pypura/pura.py", line 194, in __request response.raise_for_status() File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://trypura.io/mobile/api/users/devices