def test_set_operation(self): """Test setting of new operation mode.""" hvac.set_operation_mode(self.hass, "Heat", ENTITY_HVAC) self.hass.pool.block_till_done() self.assertEqual("Heat", self.hass.states.get(ENTITY_HVAC).state)
def test_set_operation_bad_attr(self): """Test setting operation mode without required attribute.""" self.assertEqual("Cool", self.hass.states.get(ENTITY_HVAC).state) hvac.set_operation_mode(self.hass, None, ENTITY_HVAC) self.hass.pool.block_till_done() self.assertEqual("Cool", self.hass.states.get(ENTITY_HVAC).state)