mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
update login script and drastically reduce chattiness of debug logs for setups with a lot of subscriptions
This commit is contained in:
parent
8d805de78d
commit
68dda3aba2
2 changed files with 7 additions and 5 deletions
|
|
@ -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...")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue