Beispiel #1
0
    def test_is_on(self):
        """Test is on service call."""
        self.assertFalse(fan.is_on(self.hass, FAN_ENTITY_ID))

        fan.turn_on(self.hass, FAN_ENTITY_ID)
        self.hass.block_till_done()
        self.assertTrue(fan.is_on(self.hass, FAN_ENTITY_ID))
Beispiel #2
0
    def test_is_on(self):
        """Test is on service call."""
        self.assertFalse(fan.is_on(self.hass, FAN_ENTITY_ID))

        fan.turn_on(self.hass, FAN_ENTITY_ID)
        self.hass.pool.block_till_done()
        self.assertTrue(fan.is_on(self.hass, FAN_ENTITY_ID))
Beispiel #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.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)
Beispiel #4
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)
Beispiel #5
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)
    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)
Beispiel #7
0
    def test_turn_on(self):
        """Test turning on 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_on(self.hass, FAN_ENTITY_ID, fan.SPEED_HIGH)
        self.hass.block_till_done()
        self.assertEqual(STATE_ON, self.get_entity().state)
        self.assertEqual(fan.SPEED_HIGH,
                         self.get_entity().attributes[fan.ATTR_SPEED])
Beispiel #8
0
    def test_turn_on(self):
        """Test turning on 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_on(self.hass, FAN_ENTITY_ID, fan.SPEED_HIGH)
        self.hass.pool.block_till_done()
        self.assertEqual(STATE_ON, self.get_entity().state)
        self.assertEqual(fan.SPEED_HIGH,
                         self.get_entity().attributes[fan.ATTR_SPEED])