diff --git a/mccli.py b/mccli.py index 4d2c0df..48f5558 100755 --- a/mccli.py +++ b/mccli.py @@ -61,11 +61,12 @@ class MeshCore: def match_meshcore_device(_: BLEDevice, adv: AdvertisementData): """ Filter to mach MeshCore devices """ if not adv.local_name is None\ - and adv.local_name.startswith("MeshCore") : + and adv.local_name.startswith("MeshCore")\ + and (self.address is None or self.address in adv.local_name) : return True return False - if self.address is None or self.address == "" : + if self.address is None or self.address == "" or len(self.address.split(":")) != 6 : scanner = BleakScanner() printerr("Scanning for devices") device = await scanner.find_device_by_filter(match_meshcore_device) @@ -304,7 +305,8 @@ def usage () : Arguments : -h : prints this help - -a
: specifies device address + -a : specifies device address (can be a name) + -d