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

[Bug] Integration using 'soon' to be deprecated lovelace variable #961

Open
WhoDunDidIt opened this issue Feb 10, 2025 · 4 comments
Open
Labels
bug Something isn't working integration parked May be worked on in the future, but closing for now

Comments

@WhoDunDidIt
Copy link

Home Assistant Version

2025.2.1

Bambu Lab Integration Version

2.1.0

Describe the bug

Noticed the following in my HA logs after updating:

Detected that custom integration 'bambu_lab' accessed lovelace_data['resources'] instead of lovelace_data.resources at custom_components/bambu_lab/frontend/init.py, line 38: if self.hass.data["lovelace"]["resources"].loaded:. This will stop working in Home Assistant 2026.2

Detected that custom integration 'bambu_lab' accessed lovelace_data['resources'] instead of lovelace_data.resources at custom_components/bambu_lab/frontend/init.py, line 52: for resource in self.hass.data["lovelace"]["resources"].async_items(). This will stop working in Home Assistant 2026.2

Detected that custom integration 'bambu_lab' accessed lovelace_data['resources'] instead of lovelace_data.resources at custom_components/bambu_lab/frontend/init.py, line 81: await self.hass.data["lovelace"]["resources"].async_create_item({. This will stop working in Home Assistant 2026.2

To Reproduce

N/A

Expected Behaviour

N/A

What device are you using?

A1 Mini

Diagnostic Output

N/A

Log Extracts

Other Information

No response

@WhoDunDidIt WhoDunDidIt added the bug Something isn't working label Feb 10, 2025
@greghesp greghesp added the cards label Feb 10, 2025
@AdrianGarside
Copy link
Collaborator

AdrianGarside commented Feb 10, 2025

Not sure we can fix this yet. Maybe I'm misunderstanding the required change but it doesn't work in 2025.1.4. Need to upgrade my test instance of HA and see if it does then. Or find the breaking change notification to get more details of the change. But my guess is that this only got introduced in 2025.2.x as I don't see that error on 2025.1.4 and the 'soon' deprecation date is exactly one year out.

@WhoDunDidIt
Copy link
Author

No worries, as you said it'll be a while before it breaks anything. I've had bad experiences with errors like that, one of my integrations is weeks away from breaking with zero response from the developer, so I try to inform developers whenever I see that warning.

For the record, searching and replacing ["lovelace"]["resources"] with ["lovelace"].resources in frontend/init.py seemed to do the trick, though you may be right in that it has only been implemented in 2025.2.

If that's the case you'd either have to have selective code that checks the version of HA and executes the proper code. Not sure how feasible that is with HA integrations as I have very little knowledge of how they work.

@AdrianGarside
Copy link
Collaborator

AdrianGarside commented Feb 11, 2025

Yep, that’s what I tried and it gives runtime errors with 2025.1.4. I like you idea of adding version-dependent code paths. That way I don't have to remember to fix this in 6 months and update the min supported version of home assistant. I don't like to do that if I can avoid it because it's always a crapshoot about how many integrations will break horribly when you do and then you might find out that development on them is dead...

@greghesp greghesp added the parked May be worked on in the future, but closing for now label Feb 12, 2025
@DocRonB
Copy link

DocRonB commented Feb 24, 2025

I also have this issue. Following. Thank you for the info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working integration parked May be worked on in the future, but closing for now
Projects
None yet
Development

No branches or pull requests

4 participants