1
0
mirror of https://github.com/undera/pylgbst.git synced 2020-11-18 19:37:26 -08:00
Fixes #10
This commit is contained in:
Andrey Pohilko 2019-01-16 10:42:52 +03:00
parent f4efb30133
commit f078d188ae
3 changed files with 3 additions and 3 deletions

View File

@ -100,7 +100,7 @@ class GattConnection(Connection):
for dev in devices:
address = dev.mac_address
name = dev.alias()
if name == LEGO_MOVE_HUB or hub_mac == address:
if (not hub_mac and name == LEGO_MOVE_HUB) or hub_mac == address:
logging.info("Found %s at %s", name, address)
self._device = CustomDevice(address, self._manager)
break

View File

@ -70,7 +70,7 @@ class GattLibConnection(Connection):
log.debug("Devices: %s", devices)
for address, name in devices.items():
if name == LEGO_MOVE_HUB or hub_mac == address:
if (not hub_mac and name == LEGO_MOVE_HUB) or hub_mac == address:
logging.info("Found %s at %s", name, address)
self.requester = Requester(address, True, self._iface)
break

View File

@ -34,7 +34,7 @@ class GattoolConnection(Connection):
for dev in devices:
address = dev['address']
name = dev['name']
if name == LEGO_MOVE_HUB or hub_mac == address:
if (not hub_mac and name == LEGO_MOVE_HUB) or hub_mac == address:
logging.info("Found %s at %s", name, address)
self._conn_hnd = adapter.connect(address)
break