示例#1
0
 def test_set_swing_mode_bad_attr(self):
     """Test setting swing mode without required attribute."""
     state = self.hass.states.get(ENTITY_HVAC)
     self.assertEqual("Off", state.attributes.get('swing_mode'))
     hvac.set_swing_mode(self.hass, None, ENTITY_HVAC)
     self.hass.pool.block_till_done()
     self.assertEqual("Off", state.attributes.get('swing_mode'))
示例#2
0
 def test_set_swing_mode_bad_attr(self):
     """Test setting swing mode without required attribute."""
     state = self.hass.states.get(ENTITY_HVAC)
     self.assertEqual("Off", state.attributes.get('swing_mode'))
     hvac.set_swing_mode(self.hass, None, ENTITY_HVAC)
     self.hass.pool.block_till_done()
     self.assertEqual("Off", state.attributes.get('swing_mode'))
示例#3
0
 def test_set_swing(self):
     """Test setting of new swing mode."""
     hvac.set_swing_mode(self.hass, "Auto", ENTITY_HVAC)
     self.hass.pool.block_till_done()
     state = self.hass.states.get(ENTITY_HVAC)
     self.assertEqual("Auto", state.attributes.get('swing_mode'))
示例#4
0
 def test_set_swing(self):
     """Test setting of new swing mode."""
     hvac.set_swing_mode(self.hass, "Auto", ENTITY_HVAC)
     self.hass.pool.block_till_done()
     state = self.hass.states.get(ENTITY_HVAC)
     self.assertEqual("Auto", state.attributes.get('swing_mode'))