diff --git a/examples/tcp_login_status.py b/examples/tcp_login_status.py index 97e4069..698de64 100644 --- a/examples/tcp_login_status.py +++ b/examples/tcp_login_status.py @@ -58,10 +58,13 @@ async def main(): login_result = await mc.wait_for_event(EventType.LOGIN_SUCCESS, filter, timeout=10) print(f"Login result: {login_result}") - - # Wait a bit for the login response - print("Waiting for login events...") - await asyncio.sleep(3) + send_ver = await mc.commands.send_cmd(repeater, "ver") + if send_ver.type == EventType.ERROR: + print(f"Error sending version command: {send_ver.payload}") + return + await mc.wait_for_event(EventType.MESSAGES_WAITING) + ver_msg = await mc.commands.get_msg() + print(f"Version message: {ver_msg.payload}") # Send status request print("Sending status request...") diff --git a/src/meshcore/events.py b/src/meshcore/events.py index 94da1e3..525615f 100644 --- a/src/meshcore/events.py +++ b/src/meshcore/events.py @@ -118,7 +118,6 @@ class EventDispatcher: event = await self.queue.get() logger.debug(f"Dispatching event: {event.type}, {event.payload}, {event.attributes}") for subscription in self.subscriptions.copy(): - logger.debug(f"Checking subscription: {subscription.event_type}, {subscription.attribute_filters}") # Check if event type matches if subscription.event_type is None or subscription.event_type == event.type: # Check if all attribute filters match