Add on/off supported feature to climate (#11379)

* Add on/off supported feature to climate

* Lint
This commit is contained in:
Andrey authored and Lukas Barth committed 2018-01-03 23:10:54 +01:00
1 parent ec700c2cd6
commit eb00e54eba
5 files changed
+125 -17

No files matched your search

+17
View File
@@ -250,3 +250,20 @@ class TestDemoClimate(unittest.TestCase):
self.hass.block_till_done()
state = self.hass.states.get(ENTITY_CLIMATE)
self.assertEqual('off', state.attributes.get('aux_heat'))
def test_set_on_off(self):
"""Test on/off service."""
state = self.hass.states.get(ENTITY_ECOBEE)
self.assertEqual('auto', state.state)
self.hass.services.call(climate.DOMAIN, climate.SERVICE_TURN_OFF,
{climate.ATTR_ENTITY_ID: ENTITY_ECOBEE})
self.hass.block_till_done()
state = self.hass.states.get(ENTITY_ECOBEE)
self.assertEqual('off', state.state)
self.hass.services.call(climate.DOMAIN, climate.SERVICE_TURN_ON,
{climate.ATTR_ENTITY_ID: ENTITY_ECOBEE})
self.hass.block_till_done()
state = self.hass.states.get(ENTITY_ECOBEE)
self.assertEqual('auto', state.state)