Skip to content

state.persist is broken in HA 2022.3 #331

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

Closed
LeszekSwirski opened this issue Mar 3, 2022 · 8 comments · Fixed by #332
Closed

state.persist is broken in HA 2022.3 #331

LeszekSwirski opened this issue Mar 3, 2022 · 8 comments · Fixed by #332

Comments

@LeszekSwirski
Copy link

home-assistant/core#66068 changed the signature of async_restore_entity_added from taking an entity str to taking a RestoreEntity

@dlashua
Copy link
Contributor

dlashua commented Mar 3, 2022

It looks like we'll need an "Entity" that extends "RestoreEntity". But we aren't actually using "Entity" at the moment.

I believe this will require us to treat all entities similar to how they were handled in PR #129

@jrowberg
Copy link

jrowberg commented Mar 3, 2022

Confirm that I am unable to create persistent state vars with the latest versions of everything installed. This is my first day playing with PyScript and I'm glad to see it's not just me!

@dlashua
Copy link
Contributor

dlashua commented Mar 4, 2022

I haven't tested this with any of my actual pyscripts because I'm not quite ready for a 2022.3 upgrade yet. But if any brave souls want to try PR #332 and let me know if it works for you that'd be great.

@jrowberg
Copy link

jrowberg commented Mar 4, 2022

Thanks, @dlashua! I just pulled the modified file into my custom_components location, restarted HASS, and boom! The problem is gone, and persisting states appears to work.

@dlashua
Copy link
Contributor

dlashua commented Mar 4, 2022

@jrowberg glad to hear it. Hopefully, this weekend I'll have some time to fix this properly if @craigbarratt doesn't beat me to it.

@selmaohneh
Copy link

Another thanks to @dlashua! I tried the temporary fix, as well. Seems to work :-)

  • Most of my pyscript services were missing after the update --> they are now back
  • All persisted states were missing after the update --> they are now back

Note: My persisted states all were on "unknown" after the HASS restart. This is my default value from state.persist. That's why I triggered some state changes manually to get the states up to date again. But I guess I could have just waited some longer for the actual state changes.^^

@craigbarratt
Copy link
Member

The github master version has @dlashua's fix. I'm leaving this open until it's released.

@piyushparkash
Copy link

Sorry about commenting on an old issue.

I am still facing this issue. Can anyone confirm if this is working?

I am using 2024.1 homeassistant.

image

image

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 a pull request may close this issue.

6 participants