diff --git a/paradox/interfaces/text/gsm.py b/paradox/interfaces/text/gsm.py index 36ae872..229e831 100644 --- a/paradox/interfaces/text/gsm.py +++ b/paradox/interfaces/text/gsm.py @@ -2,6 +2,7 @@ import json import logging import os +from typing import Callable, Optional import serial_asyncio @@ -90,7 +91,7 @@ def on_message(self, message: bytes): else: self.queue.put_nowait(message) - def set_recv_callback(self, callback): + def set_recv_callback(self, callback: Optional[Callable[[str], bool]]): self.recv_callback = callback def open_timeout(self): @@ -219,7 +220,7 @@ async def run(self): await asyncio.sleep(5) - async def data_received(self, data: str) -> bool: + def data_received(self, data: str) -> bool: logger.debug(f"Data Received: {data}") data = data.decode() diff --git a/tests/interfaces/test_gsm.py b/tests/interfaces/test_gsm.py index 89406b3..efc2a7e 100644 --- a/tests/interfaces/test_gsm.py +++ b/tests/interfaces/test_gsm.py @@ -104,7 +104,7 @@ async def control_partition(partition, command): interface.modem_connected = True data = b"+CMT: test_data" - await interface.data_received(data) + interface.data_received(data) assert interface.message_cmt == data.decode() # level = EventLevel.INFO