mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-06-11 11:56:18 +00:00
Change contract for commands to return full event
This commit is contained in:
@@ -45,7 +45,11 @@ async def main():
|
||||
print("Connected to MeshCore device")
|
||||
|
||||
# Get contacts
|
||||
contacts = await meshcore.commands.get_contacts()
|
||||
result = await meshcore.commands.get_contacts()
|
||||
if result.type == EventType.ERROR:
|
||||
print(f"Error fetching contacts: {result.payload}")
|
||||
return
|
||||
contacts = result.payload
|
||||
if contacts:
|
||||
print(f"\nFound {len(contacts)} contacts:")
|
||||
for name, contact in contacts.items():
|
||||
|
||||
Reference in New Issue
Block a user