natekspencer / hacs-pura

Home Assistant integration for Pura smart fragrance diffusers
MIT License
18 stars 1 forks source link

400 Client Error #16

Closed theOrakle closed 1 year ago

theOrakle commented 1 year ago

Started getting this yesterday (been working for 30+ days):

2023-09-01 07:45:42.816 ERROR (SyncWorker_8) [pypura.pura] Status: 400 - {'message': 'getDevicesAndMigrate() Error'}
2023-09-01 07:45:42.817 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 "/opt/homeassistant/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 "/opt/python/versions/3.11.4/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/3.11.4/lib/python3.11/site-packages/pypura/pura.py", line 97, in get_devices
    return self.__get("users/devices")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/3.11.4/lib/python3.11/site-packages/pypura/pura.py", line 199, in __get
    return self.__request("get", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homeassistant/3.11.4/lib/python3.11/site-packages/pypura/pura.py", line 194, in __request
    response.raise_for_status()
  File "/opt/homeassistant/3.11.4/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
natekspencer commented 1 year ago

Looks like they made changes, I'll have to investigate later