MQTT convert to async (#6064)
* Migrate mqtt to async * address paulus comment / convert it complet async * adress paulus comment / remove future * Automation triggers should be async * Fix MQTT async calls * Show that event helpers are callbacks * Fix tests * Lint
This commit is contained in:
parent
fa2c1dafdf
commit
e1cbd6b4c0
25 changed files with 356 additions and 231 deletions
|
@ -111,7 +111,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
alarm_control_panel.alarm_arm_home(self.hass)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(('alarm/command', 'ARM_HOME', 0, False),
|
||||
self.mock_publish.mock_calls[-1][1])
|
||||
self.mock_publish.mock_calls[-2][1])
|
||||
|
||||
def test_arm_home_not_publishes_mqtt_with_invalid_code(self):
|
||||
"""Test not publishing of MQTT messages with invalid code."""
|
||||
|
@ -146,7 +146,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
alarm_control_panel.alarm_arm_away(self.hass)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(('alarm/command', 'ARM_AWAY', 0, False),
|
||||
self.mock_publish.mock_calls[-1][1])
|
||||
self.mock_publish.mock_calls[-2][1])
|
||||
|
||||
def test_arm_away_not_publishes_mqtt_with_invalid_code(self):
|
||||
"""Test not publishing of MQTT messages with invalid code."""
|
||||
|
@ -181,7 +181,7 @@ class TestAlarmControlPanelMQTT(unittest.TestCase):
|
|||
alarm_control_panel.alarm_disarm(self.hass)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(('alarm/command', 'DISARM', 0, False),
|
||||
self.mock_publish.mock_calls[-1][1])
|
||||
self.mock_publish.mock_calls[-2][1])
|
||||
|
||||
def test_disarm_not_publishes_mqtt_with_invalid_code(self):
|
||||
"""Test not publishing of MQTT messages with invalid code."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue