def test_current_alarm(mocker): alarm = Paradox(None) mocker.spy(alarm.storage, 'update_container_object') alarm.panel = Panel_EVO192(alarm, 5) send_initial_status(alarm) payload = binascii.unhexlify('e2ff1cc414130b010f2c1801030000000000024f66666963652020202020202020202000d9') raw = LiveEvent.parse(payload) alarm.handle_event_message(raw) alarm.storage.update_container_object.assert_any_call('partition', 'Partition_1', { 'current_state': 'triggered' })
async def test_current_alarm(mocker): mocker.patch('paradox.lib.utils.main_thread_loop', asyncio.get_event_loop()) alarm = Paradox(None) alarm.panel = Panel_EVO192(alarm, 5) mocker.spy(alarm.storage, 'update_container_object') send_initial_status(alarm) payload = binascii.unhexlify('e2ff1cc414130b010f2c1801030000000000024f66666963652020202020202020202000d9') raw = LiveEvent.parse(payload) alarm.handle_event_message(raw) await asyncio.sleep(0.01) alarm.storage.update_container_object.assert_any_call('partition', 'Partition_1', { 'current_state': 'triggered' }) alarm.panel = None
async def test_current_alarm(mocker): mocker.patch("paradox.lib.utils.main_thread_loop", asyncio.get_event_loop()) alarm = Paradox(None) alarm.panel = create_evo192_panel(alarm) mocker.spy(alarm.storage, "update_container_object") send_initial_status(alarm) payload = binascii.unhexlify( "e2ff1cc414130b010f2c1801030000000000024f66666963652020202020202020202000d9" ) raw = LiveEvent.parse(payload) alarm.handle_event_message(raw) await asyncio.sleep(0.01) alarm.storage.update_container_object.assert_any_call( "partition", "Partition_1", {"current_state": "triggered"}) alarm.panel = None