Migrate callbacks to use schedule_update_ha_state (#4426)

* Migrate callbacks to use schedule_update_ha_state

* Migrate MQTT sensor callback to async

* Migrate wemo to not update inside schedule_update_ha_state

* Make MQTT switch async

* Fix nx584 test

* Migrate tellstick callback

* Migrate vera callback

* Alarm control panel - manual: use async callbacks

* Run the switch rest tests that work
This commit is contained in:
Paulus Schoutsen authored and GitHub committed 2016-11-17 07:34:46 -08:00
1 parent 38d201a54a
commit 0f59bb208c
19 files changed
+54 -43

No files matched your search

+2 -2
View File
@@ -137,7 +137,7 @@ class TestNX584ZoneSensor(unittest.TestCase):
class TestNX584Watcher(unittest.TestCase):
"""Test the NX584 watcher."""
@mock.patch.object(nx584.NX584ZoneSensor, 'update_ha_state')
@mock.patch.object(nx584.NX584ZoneSensor, 'schedule_update_ha_state')
def test_process_zone_event(self, mock_update):
"""Test the processing of zone events."""
zone1 = {'number': 1, 'name': 'foo', 'state': True}
@@ -151,7 +151,7 @@ class TestNX584Watcher(unittest.TestCase):
self.assertFalse(zone1['state'])
self.assertEqual(1, mock_update.call_count)
@mock.patch.object(nx584.NX584ZoneSensor, 'update_ha_state')
@mock.patch.object(nx584.NX584ZoneSensor, 'schedule_update_ha_state')
def test_process_zone_event_missing_zone(self, mock_update):
"""Test the processing of zone events with missing zones."""
watcher = nx584.NX584Watcher(None, {})
-1
View File
@@ -12,7 +12,6 @@ from homeassistant.bootstrap import setup_component
from tests.common import get_test_home_assistant, assert_setup_component
@pytest.mark.skip
class TestRestSwitchSetup(unittest.TestCase):
"""Tests for setting up the REST switch platform."""