Skip to content

Update neato to support new StateVacuumDevice#16035

Merged
MartinHjelmare merged 5 commits intohome-assistant:devfrom
dshokouhi:neato_states
Aug 18, 2018
Merged

Update neato to support new StateVacuumDevice#16035
MartinHjelmare merged 5 commits intohome-assistant:devfrom
dshokouhi:neato_states

Conversation

@dshokouhi
Copy link
Copy Markdown
Member

@dshokouhi dshokouhi commented Aug 17, 2018

Description:

This PR updates the neato vacuum component to support the latest states from PR #15573

Architecture issue: home-assistant/architecture#29

This is also a breaking change as the component no longer uses STATE_ON and STATE_OFF.

Also removes any functions related to ToggleEntity, which results in the following services no longer working:

  • turn_on (Use start instead)
  • turn_off (Use return_to_dock instead)
  • toggle (No replacement)

Related issue (if applicable): fixes #

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#6036

Example entry for configuration.yaml (if applicable):

neato:
  username: username
  password: password

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

return self._clean_state

@property
def state_attributes(self):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please also fix this old code and use device_state_attributes here instead. State attributes will be updated with device_state_attributes in the base entity.

def turn_on(self, **kwargs):
def start(self):
"""Turn the vacuum on and start cleaning."""
self._clean_state = STATE_CLEANING
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

update will be called directly after the method call when handling the service call, so it's better to let update handle the state update.

@dshokouhi
Copy link
Copy Markdown
Member Author

Thanks for the review @MartinHjelmare :) I have made the requested changes, removed a couple more updates that were not necessary. Fixed resume cleaning since I forgot to add it back and adjusted the docs. All changes were tested and verified locally.

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Nice!

@MartinHjelmare MartinHjelmare merged commit c105045 into home-assistant:dev Aug 18, 2018
@ghost ghost removed the in progress label Aug 18, 2018
@dshokouhi dshokouhi deleted the neato_states branch August 19, 2018 08:07
@balloob balloob mentioned this pull request Aug 29, 2018
girlpunk pushed a commit to girlpunk/home-assistant that referenced this pull request Sep 4, 2018
* Update neato to support new vacuum states

* Remove changes submitted in error

* Lint

* Review comments and fix resume cleaning

* Lint
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
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.

3 participants