mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
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:
@@ -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, {})
|
||||
|
||||
Reference in New Issue
Block a user