def test_set_fan_mode_bad_attr(self): """Test setting fan mode without required attribute.""" state = self.hass.states.get(ENTITY_HVAC) self.assertEqual("On High", state.attributes.get('fan_mode')) hvac.set_fan_mode(self.hass, None, ENTITY_HVAC) self.hass.pool.block_till_done() self.assertEqual("On High", state.attributes.get('fan_mode'))
def test_set_fan_mode(self): """Test setting of new fan mode.""" hvac.set_fan_mode(self.hass, "On Low", ENTITY_HVAC) self.hass.pool.block_till_done() state = self.hass.states.get(ENTITY_HVAC) self.assertEqual("On Low", state.attributes.get('fan_mode'))