diff --git a/pyproject.toml b/pyproject.toml index 45ce8bc..460e175 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "meshcore" -version = "2.3.7" +version = "2.3.8" authors = [ { name="Florent de Lamotte", email="florent@frizoncorrea.fr" }, { name="Alex Wolden", email="awolden@gmail.com" }, diff --git a/src/meshcore/commands/messaging.py b/src/meshcore/commands/messaging.py index b696c9c..5f6c43e 100644 --- a/src/meshcore/commands/messaging.py +++ b/src/meshcore/commands/messaging.py @@ -353,7 +353,12 @@ class MessagingCommands(CommandHandlerBase): else: raise TypeError(f"set_flood_scope: unsupported scope type {type(scope).__name__}") - logger.debug(f"Setting scope to {scope_key.hex()}") + if force_unscoped: + logger.debug("Forcing unscoped messages") + elif scope_key is None: + logger.debug(f"Resetting scope") + else: + logger.debug(f"Setting scope to {scope_key.hex()}") cmd_data = bytearray([CommandType.SET_FLOOD_SCOPE.value]) if force_unscoped: @@ -398,6 +403,9 @@ class MessagingCommands(CommandHandlerBase): return await self.send(cmd_data, [EventType.OK, EventType.ERROR]) + async def reset_default_flood_scope(self): + return await self.set_default_flood_scope(None) + async def get_default_flood_scope(self): logger.debug(f"Getting default flood scope") cmd_data = bytearray([CommandType.GET_DEFAULT_FLOOD_SCOPE.value])