From fe2df52403ff44011ebf1d2828807456ea198e62 Mon Sep 17 00:00:00 2001 From: Florent de Lamotte Date: Fri, 16 May 2025 09:42:44 +0200 Subject: [PATCH] import contact --- pyproject.toml | 2 +- src/meshcore/commands.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 758a391..b0a221c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "meshcore" -version = "1.9.8.dev4" +version = "1.9.8.dev5" authors = [ { name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, { name="Alex Wolden", email="awolden@gmail.com" }, diff --git a/src/meshcore/commands.py b/src/meshcore/commands.py index 16209b7..1784d9c 100644 --- a/src/meshcore/commands.py +++ b/src/meshcore/commands.py @@ -253,6 +253,10 @@ class CommandHandler: data = b"\x11" return await self.send(data, [EventType.CONTACT_URI, EventType.ERROR]) + async def import_contact(self, card_data) -> Event: + data = b"\x12" + card_data + return await self.send(data, [EventType.OK, EventType.ERROR]) + async def remove_contact(self, key: DestinationType) -> Event: key_bytes = _validate_destination(key, prefix_length=32) logger.debug(f"Removing contact: {key_bytes.hex()}")