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))
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))
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)
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)
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_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])
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])