Skip to content

Update Roomba to new STATE API#15779

Closed
arbreng wants to merge 1 commit intohome-assistant:devfrom
arbreng:roomba-state
Closed

Update Roomba to new STATE API#15779
arbreng wants to merge 1 commit intohome-assistant:devfrom
arbreng:roomba-state

Conversation

@arbreng
Copy link
Copy Markdown
Contributor

@arbreng arbreng commented Aug 1, 2018

Description:

Adds support for states to the Roomba Vacuum Platform, this can be merged after: #15573

It also introduce breaking changes, as it no longer uses:

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

turn_on (Use start_pause instead)
turn_off (Use return_to_dock instead)
toggle (No replacement)
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5939

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:

yield from self.async_resume()
if self.state == STATE_CLEANING: # vacuum is running
await self.async_pause()
elif self.state == STATE_PAUSED: # self._status == 'Stopped': # vacuum is stopped
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (91 > 79 characters)

async def async_pause(self, **kwargs):
"""Pause the cleaning cycle."""
yield from self.hass.async_add_job(self.vacuum.send_command, 'pause')
# TODO: What happens here if in DOCKED, PAUSED, IDLE, RETURNING, or ERROR?
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (82 > 79 characters)

async def async_resume(self, **kwargs):
"""Resume the cleaning cycle."""
yield from self.hass.async_add_job(self.vacuum.send_command, 'resume')
# TODO: What happens here if in CLEANING, DOCKED, IDLE, RETURNING, or ERROR?
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (84 > 79 characters)

}


async def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

line too long (85 > 79 characters)

@arbreng
Copy link
Copy Markdown
Contributor Author

arbreng commented Aug 1, 2018

Part of: home-assistant/architecture#29

@cnrd
Copy link
Copy Markdown
Contributor

cnrd commented Aug 1, 2018

Does it make sense to merge this first? #15751

@cnrd
Copy link
Copy Markdown
Contributor

cnrd commented Aug 12, 2018

@arbreng Please update your PR to support this: #15751

@arbreng
Copy link
Copy Markdown
Contributor Author

arbreng commented Aug 31, 2018

Will do; August was crazy. Finally sitting down to work on this this weekend

@balloob
Copy link
Copy Markdown
Member

balloob commented Nov 27, 2018

@arbreng I would love to see this PR land, would you be able to pick it up?

@arbreng
Copy link
Copy Markdown
Contributor Author

arbreng commented Nov 28, 2018 via email

@balloob
Copy link
Copy Markdown
Member

balloob commented Dec 14, 2018

This PR seems to have gone stale. Closing it.

@balloob balloob closed this Dec 14, 2018
@ghost ghost removed the in progress label Dec 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants