예제 #1
0
    def test_turn_off(self):
        """Test turning off the device."""
        self.assertEqual(STATE_OFF, self.get_entity().state)

        fan.turn_on(self.hass, FAN_ENTITY_ID)
        self.hass.block_till_done()
        self.assertNotEqual(STATE_OFF, self.get_entity().state)

        fan.turn_off(self.hass, FAN_ENTITY_ID)
        self.hass.block_till_done()
        self.assertEqual(STATE_OFF, self.get_entity().state)
예제 #2
0
    def test_turn_off_without_entity_id(self):
        """Test turning off all fans."""
        self.assertEqual(STATE_OFF, self.get_entity().state)

        fan.turn_on(self.hass, FAN_ENTITY_ID)
        self.hass.block_till_done()
        self.assertNotEqual(STATE_OFF, self.get_entity().state)

        fan.turn_off(self.hass)
        self.hass.block_till_done()
        self.assertEqual(STATE_OFF, self.get_entity().state)
예제 #3
0
    def test_turn_off(self):
        """Test turning off the device."""
        self.assertEqual(STATE_OFF, self.get_entity().state)

        fan.turn_on(self.hass, FAN_ENTITY_ID)
        self.hass.pool.block_till_done()
        self.assertNotEqual(STATE_OFF, self.get_entity().state)

        fan.turn_off(self.hass, FAN_ENTITY_ID)
        self.hass.pool.block_till_done()
        self.assertEqual(STATE_OFF, self.get_entity().state)
예제 #4
0
    def test_turn_off_without_entity_id(self):
        """Test turning off all fans."""
        self.assertEqual(STATE_OFF, self.get_entity().state)

        fan.turn_on(self.hass, FAN_ENTITY_ID)
        self.hass.block_till_done()
        self.assertNotEqual(STATE_OFF, self.get_entity().state)

        fan.turn_off(self.hass)
        self.hass.block_till_done()
        self.assertEqual(STATE_OFF, self.get_entity().state)