Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown exception while updating Pura data: 'Pura' object has no attribute 'get_devices_v2' #77

Closed
NoMacSec opened this issue Dec 2, 2024 · 5 comments

Comments

@NoMacSec
Copy link

NoMacSec commented Dec 2, 2024

The problem

Have had this error for a bit now. Tried removing integration from HA devices and HACS. Cleared data for the integration. Then, reinstalled integration through HACS. Still getting error and integration does not work.

What version of Home Assistant Core are you running?

2024.11.3

What was the last working version of Home Assistant Core?

No response

Diagnostics information

No response

Anything in the logs that might be useful?

This error originated from a custom integration.

Logger: custom_components.pura.coordinator
Source: custom_components/pura/coordinator.py:52
integration: Pura (documentation, issues)
First occurred: 4:47:15 PM (10 occurrences)
Last logged: 4:55:31 PM

Unknown exception while updating Pura data: 'Pura' object has no attribute 'get_devices_v2'
Traceback (most recent call last):
  File "/config/custom_components/pura/coordinator.py", line 52, in _async_update_data
    self.api.get_devices_v2
AttributeError: 'Pura' object has no attribute 'get_devices_v2'. Did you mean: 'get_devices'?

Additional information

No response

@natekspencer
Copy link
Owner

How do you have Home Assistant deployed? It looks like you aren't getting the new pypura library installed.

@NoMacSec
Copy link
Author

NoMacSec commented Dec 3, 2024

How do you have Home Assistant deployed? It looks like you aren't getting the new pypura library installed.

Thank you for the fast reply. I am running it in kubernetes using the homeassistant/home-assistant:latest image.

@natekspencer
Copy link
Owner

Can you bash into your home assistant instance and run pip list | grep pura. If it doesn't show as 0.2.0, then the library hasn't been downloaded appropriately. You may need to try downgrading the integration, then upgrading and see if there is an error or dependency conflict.

@NoMacSec
Copy link
Author

NoMacSec commented Dec 3, 2024

I did not have pypura nor ruff installed. After downgrading to 1.1.0 and upgrading to 1.2.0, I now have those python packages.

# pip list | grep -E "homeassistant|numpy|PyTurboJPEG|pypura|deepdiff|ical|colorlog|ruff" | sort -fd
anel-pwrctrl-homeassistant       0.0.1.dev2
atomicwrites-homeassistant       1.4.1
colorlog                         6.8.2
deepdiff                         6.7.1
homeassistant                    2024.11.3         /usr/src/homeassistant
ical                             8.2.0
icalendar                        6.0.1
numpy                            1.26.4
pypura                           0.2.0
python-homeassistant-analytics   0.8.0
PyTurboJPEG                      1.7.5
recurring-ical-events            3.3.3
ruff                             0.8.1

However, I am still getting the same error. I made sure to restart HA, and I also removed and re-added the pura device. I did not see anything in the logs when I installed the integration with HACS.

@NoMacSec
Copy link
Author

NoMacSec commented Dec 14, 2024

I was able to resolve the issue. I removed my /config/deps folder, and I set an env var for my pod PYTHONPATH="/config/deps". The following git issues helped me out:

Thanks for you help @natekspencer !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants