Skip to content

Remove CoreState.starting#6194

Closed
balloob wants to merge 1 commit into
devfrom
feature/remove-state-starting
Closed

Remove CoreState.starting#6194
balloob wants to merge 1 commit into
devfrom
feature/remove-state-starting

Conversation

@balloob
Copy link
Copy Markdown
Member

@balloob balloob commented Feb 24, 2017

Followup to #6189. Should not go into 0.39.

Hass has an enum for states. One of them is CoreState.starting. However, due to the way the system is setup, we will never be in this state and neither do we have any code that depends on it.

@mention-bot
Copy link
Copy Markdown

@balloob, thanks for your PR! By analyzing the history of the files in this pull request, we identified @kellerza, @fabaff and @pvizeli to be potential reviewers.

Comment thread homeassistant/helpers/restore_state.py Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to clear the cache if cache is just an empty dict

@balloob balloob force-pushed the feature/remove-state-starting branch from 08597c3 to 5b7428c Compare February 24, 2017 04:11
Comment thread homeassistant/helpers/restore_state.py Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enforce that when we're running, we don't restore.

Comment thread homeassistant/helpers/restore_state.py Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All paths ensure _load_restore_cache is set.

@balloob balloob force-pushed the feature/remove-state-starting branch from 5b7428c to 4ae1d75 Compare February 24, 2017 04:15
@pvizeli
Copy link
Copy Markdown
Member

pvizeli commented Feb 24, 2017

I like this state and it can sugestion that we are in bootstrap. I think we can use that also in future. Why we not use starting on HomeAssistant.init and after call hass.start in is in state running (like it is)? So we know that the start is not calling jet and we stay inside bootstrap process.

@balloob
Copy link
Copy Markdown
Member Author

balloob commented Feb 24, 2017

@pvizeli in that case we should also change not_running to stopped. In that case we start with starting (or maybe rename it init):

  • init
  • running
  • stopping
  • stopped

@pvizeli
Copy link
Copy Markdown
Member

pvizeli commented Feb 24, 2017

👍 realy greate idea. Since we are async everey state is finally and can not revert. So we loop over this state flow and know where we stay inside processs. I'm allready thinking to future for splitung up into multiproccesing.

@balloob balloob closed this Mar 3, 2017
@balloob balloob deleted the feature/remove-state-starting branch March 3, 2017 16:32
@home-assistant home-assistant locked and limited conversation to collaborators Jun 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants