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

Fix issues accessing the ZHA gateway #252

Closed

Conversation

wbyoung
Copy link
Contributor

@wbyoung wbyoung commented Aug 8, 2024

The gateway could now also be a gateway proxy object that stores the HASS object under hass instead of _hass and the HASS object is no longer available in the non-proxy object since it lives in the new ZHA (non-HA) library.

Having access to the proxy object is useful to get the hass object, but accessing the application controller needs to be done through the actual gateway. Therefore, a helper method has been added with simple duck-type checking to reach the gateway through the gateway property of the proxy.

Fixes: #251

The gateway could now also be a gateway proxy object that stores
the HASS object under `hass` instead of `_hass` and the HASS object
is no longer available in the non-proxy object since it lives in
the new ZHA (non-HA) library.

Having access to the proxy object is useful to get the `hass`
object, but accessing the application controller needs to be done
through the actual gateway. Therefore, a helper method has been
added with simple duck-type checking to reach the gateway through
the `gateway` property of the proxy.

Fixes: mdeweerd#251
@mdeweerd
Copy link
Owner

mdeweerd commented Aug 8, 2024

Hello.
Thank you for your PR.
I had already coded another approach, it's on the dev branch but I prepared a PR for it #253 .

Can you test that ?

I am setting up a third home-assistant (I have two locations) so that I can test the latest version with a gateway without breaking the operationnal versions - I had to hack a device for that first.

@wbyoung
Copy link
Contributor Author

wbyoung commented Aug 9, 2024

#253 was merged, so I'm closing this.

@wbyoung wbyoung closed this Aug 9, 2024
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

Successfully merging this pull request may close these issues.

AttributeError: 'HAZHAData' object has no attribute 'gateway'
2 participants