Repository navigation
fix: restore pyscript state on Home Assistant 2026.11 - #883
Open
markfrancisonly wants to merge 1 commit into
Open
markfrancisonly wants to merge 1 commit into
markfrancisonly wants to merge 1 commit into
Conversation
|
One caveat: this is still accessing Home Assistant's internal storage implementation, rather than a supported public API. A longer-term solution would be for Pyscript to manage its persistent entities through |
Author
|
Agreed, it's still internal, and it was before this change too: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #882
Home Assistant 2026.11 replaces
RestoreStateData.last_stateswithlast_states_by_entity_idandlast_states_by_entity_registry_id(home-assistant/core#183906), sorestore_state()raisesAttributeErrorand pyscript fails to set up. This readslast_states_by_entity_idwhen it exists and falls back tolast_stateson older versions. Pyscript's states have no registry entry, so that dict holds all of them.When it is needed: before Home Assistant 2026.11 reaches users. The beta is expected Wednesday 28 October and the release Wednesday 4 November. A pyscript release with this fix before then avoids an outage for everyone who upgrades.
Tested:
state.persistvariable set to a new value keeps that value across a restart.The test suite can exercise the new attribute only once pytest-homeassistant-custom-component publishes a 2026.11 build.