natekspencer / hacs-pura

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

Error with integration #27

Closed lux4rd0 closed 11 months ago

lux4rd0 commented 11 months ago

The problem

Getting errors after noticing that my Puras were no longer functional in HA:

This error originated from a custom integration.

Logger: custom_components.pura.coordinator
Source: custom_components/pura/coordinator.py:50
Integration: Pura (documentation, issues)
First occurred: 11:55:12 AM (735 occurrences)
Last logged: 6:46:41 PM

Unknown exception while updating Pura data: 400 Client Error: Bad Request for url: https://trypura.io/mobile/api/users/devices?types=wall%2Ccar%2Ctabletop
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", params={"types": "wall,car,tabletop"})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  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?types=wall%2Ccar%2Ctabletop
Logger: pypura.pura
Source: /usr/local/lib/python3.11/site-packages/pypura/pura.py:193
First occurred: 11:55:12 AM (735 occurrences)
Last logged: 6:46:41 PM

Status: 400 - {'message': 'query.types must be car, wall, plus, or 1, 2, 3'}
Status: 400 - {'message': 'query.types must be car, wall, plus, mini, 1, 2, 3, or 4'}

What version of Home Assistant Core are you running?

2023.9.3

What was the last working version of Home Assistant Core?

2023.9.3

Diagnostics information

No response

Anything in the logs that might be useful?

No response

Additional information

No response

natekspencer commented 11 months ago

Please update your integration. This has already been resolved.