-
-
Notifications
You must be signed in to change notification settings - Fork 37.2k
Vacuum component: start_pause to individual start and pause commands. #15751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,7 +83,7 @@ def test_supported_features(self): | |
| self.assertEqual(STATE_OFF, state.state) | ||
|
|
||
| state = self.hass.states.get(ENTITY_VACUUM_STATE) | ||
| self.assertEqual(5244, state.attributes.get(ATTR_SUPPORTED_FEATURES)) | ||
| self.assertEqual(13436, state.attributes.get(ATTR_SUPPORTED_FEATURES)) | ||
| self.assertEqual(STATE_DOCKED, state.state) | ||
| self.assertEqual(100, state.attributes.get(ATTR_BATTERY_LEVEL)) | ||
| self.assertEqual("medium", state.attributes.get(ATTR_FAN_SPEED)) | ||
|
|
@@ -158,12 +158,12 @@ def test_methods(self): | |
| self.assertIn("spot", state.attributes.get(ATTR_STATUS)) | ||
| self.assertEqual(STATE_ON, state.state) | ||
|
|
||
| vacuum.start_pause(self.hass, ENTITY_VACUUM_STATE) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I should have commented here instead...
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it is covered by: https://github.com/cnrd/home-assistant/blob/5a6b52779dc3b9fc08bc4fe5b095fcd2cdaf2b4e/tests/components/vacuum/test_demo.py#L123-L129 and https://github.com/cnrd/home-assistant/blob/5a6b52779dc3b9fc08bc4fe5b095fcd2cdaf2b4e/tests/components/vacuum/test_demo.py#L223-L225 |
||
| vacuum.start(self.hass, ENTITY_VACUUM_STATE) | ||
| self.hass.block_till_done() | ||
| state = self.hass.states.get(ENTITY_VACUUM_STATE) | ||
| self.assertEqual(STATE_CLEANING, state.state) | ||
|
|
||
| vacuum.start_pause(self.hass, ENTITY_VACUUM_STATE) | ||
| vacuum.pause(self.hass, ENTITY_VACUUM_STATE) | ||
| self.hass.block_till_done() | ||
| state = self.hass.states.get(ENTITY_VACUUM_STATE) | ||
| self.assertEqual(STATE_PAUSED, state.state) | ||
|
|
@@ -247,6 +247,23 @@ def test_unsupported_methods(self): | |
| self.assertNotIn("spot", state.attributes.get(ATTR_STATUS)) | ||
| self.assertEqual(STATE_OFF, state.state) | ||
|
|
||
| # VacuumDevice should not support start and pause methods. | ||
| self.hass.states.set(ENTITY_VACUUM_COMPLETE, STATE_ON) | ||
| self.hass.block_till_done() | ||
| self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)) | ||
|
|
||
| vacuum.pause(self.hass, ENTITY_VACUUM_COMPLETE) | ||
| self.hass.block_till_done() | ||
| self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)) | ||
|
|
||
| self.hass.states.set(ENTITY_VACUUM_COMPLETE, STATE_OFF) | ||
| self.hass.block_till_done() | ||
| self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)) | ||
|
|
||
| vacuum.start(self.hass, ENTITY_VACUUM_COMPLETE) | ||
| self.hass.block_till_done() | ||
| self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)) | ||
|
|
||
| # StateVacuumDevice does not support on/off | ||
| vacuum.turn_on(self.hass, entity_id=ENTITY_VACUUM_STATE) | ||
| self.hass.block_till_done() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any tests for this method and service now that we've moved it from base to legacy vaccum entity class.