Esempio n. 1
0
    def test_methods(self):
        """Test if methods call the services as expected."""
        self.hass.states.set(ENTITY_VACUUM_BASIC, STATE_ON)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_BASIC)

        self.hass.states.set(ENTITY_VACUUM_BASIC, STATE_OFF)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_BASIC)

        self.hass.states.set(ENTITY_ID_ALL_VACUUMS, STATE_ON)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass)

        self.hass.states.set(ENTITY_ID_ALL_VACUUMS, STATE_OFF)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass)

        common.turn_on(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.turn_off(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.toggle(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.start_pause(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.start_pause(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.stop(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        assert state.attributes.get(ATTR_BATTERY_LEVEL) < 100
        assert "Charging" != state.attributes.get(ATTR_STATUS)

        common.locate(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        assert "I'm over here" in state.attributes.get(ATTR_STATUS)

        common.return_to_base(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        assert "Returning home" in state.attributes.get(ATTR_STATUS)

        common.set_fan_speed(self.hass, FAN_SPEEDS[-1],
                             entity_id=ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        assert FAN_SPEEDS[-1] == state.attributes.get(ATTR_FAN_SPEED)

        common.clean_spot(self.hass, entity_id=ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        assert "spot" in state.attributes.get(ATTR_STATUS)
        assert STATE_ON == state.state

        common.start(self.hass, ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_CLEANING == state.state

        common.pause(self.hass, ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_PAUSED == state.state

        common.stop(self.hass, ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_IDLE == state.state

        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert state.attributes.get(ATTR_BATTERY_LEVEL) < 100
        assert STATE_DOCKED != state.state

        common.return_to_base(self.hass, ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_RETURNING == state.state

        common.set_fan_speed(self.hass, FAN_SPEEDS[-1],
                             entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert FAN_SPEEDS[-1] == state.attributes.get(ATTR_FAN_SPEED)

        common.clean_spot(self.hass, entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_CLEANING == state.state
Esempio n. 2
0
    def test_unsupported_methods(self):
        """Test service calls for unsupported vacuums."""
        self.hass.states.set(ENTITY_VACUUM_NONE, STATE_ON)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        common.turn_off(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        common.stop(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        self.hass.states.set(ENTITY_VACUUM_NONE, STATE_OFF)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        common.turn_on(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        common.toggle(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        # Non supported methods:
        common.start_pause(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        common.locate(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_NONE)
        assert state.attributes.get(ATTR_STATUS) is None

        common.return_to_base(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_NONE)
        assert state.attributes.get(ATTR_STATUS) is None

        common.set_fan_speed(self.hass, FAN_SPEEDS[-1],
                             entity_id=ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_NONE)
        assert FAN_SPEEDS[-1] != \
            state.attributes.get(ATTR_FAN_SPEED)

        common.clean_spot(self.hass, entity_id=ENTITY_VACUUM_BASIC)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_BASIC)
        assert "spot" not in state.attributes.get(ATTR_STATUS)
        assert 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()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.pause(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        self.hass.states.set(ENTITY_VACUUM_COMPLETE, STATE_OFF)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.start(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        # StateVacuumDevice does not support on/off
        common.turn_on(self.hass, entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_CLEANING != state.state

        common.turn_off(self.hass, entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_RETURNING != state.state

        common.toggle(self.hass, entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_CLEANING != state.state
Esempio n. 3
0
    def test_methods(self):
        """Test if methods call the services as expected."""
        self.hass.states.set(ENTITY_VACUUM_BASIC, STATE_ON)
        self.hass.block_till_done()
        self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_BASIC))

        self.hass.states.set(ENTITY_VACUUM_BASIC, STATE_OFF)
        self.hass.block_till_done()
        self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_BASIC))

        self.hass.states.set(ENTITY_ID_ALL_VACUUMS, STATE_ON)
        self.hass.block_till_done()
        self.assertTrue(vacuum.is_on(self.hass))

        self.hass.states.set(ENTITY_ID_ALL_VACUUMS, STATE_OFF)
        self.hass.block_till_done()
        self.assertFalse(vacuum.is_on(self.hass))

        common.turn_on(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE))

        common.turn_off(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE))

        common.toggle(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE))

        common.start_pause(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE))

        common.start_pause(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE))

        common.stop(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE))

        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        self.assertLess(state.attributes.get(ATTR_BATTERY_LEVEL), 100)
        self.assertNotEqual("Charging", state.attributes.get(ATTR_STATUS))

        common.locate(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        self.assertIn("I'm over here", state.attributes.get(ATTR_STATUS))

        common.return_to_base(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        self.assertIn("Returning home", state.attributes.get(ATTR_STATUS))

        common.set_fan_speed(self.hass, FAN_SPEEDS[-1],
                             entity_id=ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        self.assertEqual(FAN_SPEEDS[-1], state.attributes.get(ATTR_FAN_SPEED))

        common.clean_spot(self.hass, entity_id=ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        self.assertIn("spot", state.attributes.get(ATTR_STATUS))
        self.assertEqual(STATE_ON, state.state)

        common.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)

        common.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)

        common.stop(self.hass, ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        self.assertEqual(STATE_IDLE, state.state)

        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        self.assertLess(state.attributes.get(ATTR_BATTERY_LEVEL), 100)
        self.assertNotEqual(STATE_DOCKED, state.state)

        common.return_to_base(self.hass, ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        self.assertEqual(STATE_RETURNING, state.state)

        common.set_fan_speed(self.hass, FAN_SPEEDS[-1],
                             entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        self.assertEqual(FAN_SPEEDS[-1], state.attributes.get(ATTR_FAN_SPEED))

        common.clean_spot(self.hass, entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        self.assertEqual(STATE_CLEANING, state.state)
Esempio n. 4
0
    def test_unsupported_methods(self):
        """Test service calls for unsupported vacuums."""
        self.hass.states.set(ENTITY_VACUUM_NONE, STATE_ON)
        self.hass.block_till_done()
        self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_NONE))

        common.turn_off(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_NONE))

        common.stop(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_NONE))

        self.hass.states.set(ENTITY_VACUUM_NONE, STATE_OFF)
        self.hass.block_till_done()
        self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_NONE))

        common.turn_on(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_NONE))

        common.toggle(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_NONE))

        # Non supported methods:
        common.start_pause(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_NONE))

        common.locate(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_NONE)
        self.assertIsNone(state.attributes.get(ATTR_STATUS))

        common.return_to_base(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_NONE)
        self.assertIsNone(state.attributes.get(ATTR_STATUS))

        common.set_fan_speed(self.hass, FAN_SPEEDS[-1],
                             entity_id=ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_NONE)
        self.assertNotEqual(FAN_SPEEDS[-1],
                            state.attributes.get(ATTR_FAN_SPEED))

        common.clean_spot(self.hass, entity_id=ENTITY_VACUUM_BASIC)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_BASIC)
        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))

        common.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))

        common.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
        common.turn_on(self.hass, entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        self.assertNotEqual(STATE_CLEANING, state.state)

        common.turn_off(self.hass, entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        self.assertNotEqual(STATE_RETURNING, state.state)

        common.toggle(self.hass, entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        self.assertNotEqual(STATE_CLEANING, state.state)
Esempio n. 5
0
    def test_unsupported_methods(self):
        """Test service calls for unsupported vacuums."""
        self.hass.states.set(ENTITY_VACUUM_NONE, STATE_ON)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        common.turn_off(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        common.stop(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        self.hass.states.set(ENTITY_VACUUM_NONE, STATE_OFF)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        common.turn_on(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        common.toggle(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        # Non supported methods:
        common.start_pause(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_NONE)

        common.locate(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_NONE)
        assert state.attributes.get(ATTR_STATUS) is None

        common.return_to_base(self.hass, ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_NONE)
        assert state.attributes.get(ATTR_STATUS) is None

        common.set_fan_speed(self.hass,
                             FAN_SPEEDS[-1],
                             entity_id=ENTITY_VACUUM_NONE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_NONE)
        assert FAN_SPEEDS[-1] != state.attributes.get(ATTR_FAN_SPEED)

        common.clean_spot(self.hass, entity_id=ENTITY_VACUUM_BASIC)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_BASIC)
        assert "spot" not in state.attributes.get(ATTR_STATUS)
        assert 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()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.pause(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        self.hass.states.set(ENTITY_VACUUM_COMPLETE, STATE_OFF)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.start(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        # StateVacuumDevice does not support on/off
        common.turn_on(self.hass, entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_CLEANING != state.state

        common.turn_off(self.hass, entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_RETURNING != state.state

        common.toggle(self.hass, entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_CLEANING != state.state
Esempio n. 6
0
    def test_methods(self):
        """Test if methods call the services as expected."""
        self.hass.states.set(ENTITY_VACUUM_BASIC, STATE_ON)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_BASIC)

        self.hass.states.set(ENTITY_VACUUM_BASIC, STATE_OFF)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_BASIC)

        self.hass.states.set(ENTITY_ID_ALL_VACUUMS, STATE_ON)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass)

        self.hass.states.set(ENTITY_ID_ALL_VACUUMS, STATE_OFF)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass)

        common.turn_on(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.turn_off(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.toggle(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.start_pause(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.start_pause(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        common.stop(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        assert not vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE)

        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        assert state.attributes.get(ATTR_BATTERY_LEVEL) < 100
        assert "Charging" != state.attributes.get(ATTR_STATUS)

        common.locate(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        assert "I'm over here" in state.attributes.get(ATTR_STATUS)

        common.return_to_base(self.hass, ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        assert "Returning home" in state.attributes.get(ATTR_STATUS)

        common.set_fan_speed(self.hass,
                             FAN_SPEEDS[-1],
                             entity_id=ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        assert FAN_SPEEDS[-1] == state.attributes.get(ATTR_FAN_SPEED)

        common.clean_spot(self.hass, entity_id=ENTITY_VACUUM_COMPLETE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
        assert "spot" in state.attributes.get(ATTR_STATUS)
        assert STATE_ON == state.state

        common.start(self.hass, ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_CLEANING == state.state

        common.pause(self.hass, ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_PAUSED == state.state

        common.stop(self.hass, ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_IDLE == state.state

        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert state.attributes.get(ATTR_BATTERY_LEVEL) < 100
        assert STATE_DOCKED != state.state

        common.return_to_base(self.hass, ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_RETURNING == state.state

        common.set_fan_speed(self.hass,
                             FAN_SPEEDS[-1],
                             entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert FAN_SPEEDS[-1] == state.attributes.get(ATTR_FAN_SPEED)

        common.clean_spot(self.hass, entity_id=ENTITY_VACUUM_STATE)
        self.hass.block_till_done()
        state = self.hass.states.get(ENTITY_VACUUM_STATE)
        assert STATE_CLEANING == state.state