Bugfix restore loading cache with startup state#6189
Merged
Conversation
Member
Author
|
starting only happens on hass.start(), before that it is not_running |
balloob
reviewed
Feb 24, 2017
| None, _load_restore_cache, hass) | ||
|
|
||
| return hass.data[DATA_RESTORE_CACHE].get(entity_id) | ||
| return hass.data.get(DATA_RESTORE_CACHE, {}).get(entity_id) |
Member
There was a problem hiding this comment.
Why did you change this? There are no paths in _load_restore_cache that do not set the cache
Member
|
Merging this to make it to 0.39. For 0.40 I will have a PR to remove CoreState.starting. Due to the way asyncio works, it will actually never be "starting" as it is immediately overwritten. (the responses to the event are being executed after that method is done) |
balloob
reviewed
Feb 24, 2017
| @asyncio.coroutine | ||
| def async_get_last_state(hass, entity_id: str): | ||
| """Helper to restore state.""" | ||
| if (_RECORDER not in hass.config.components or |
Member
There was a problem hiding this comment.
We shouldn't have done this as we now will allow restoring from cache if we are running?
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description:
Fix #4614.
I always test with hass.restart and have got "commented" out invalid config items, so never really tested this because of no restart on validation failures :-(
Related issue (if applicable): fixes #6172
Checklist:
If the code does not interact with devices:
toxrun successfully. Your PR cannot be merged unless tests pass