print line cleanup 4a
This commit is contained in:
1 parent
6d6f837b1a
commit
f3d515d430
1 file changed
+4
-4
@@ -26,7 +26,7 @@ async def read_data(mac_address):
|
|||||||
device = next((d for d in devices if d.address.lower() == mac_address.lower()), None)
|
device = next((d for d in devices if d.address.lower() == mac_address.lower()), None)
|
||||||
if device:
|
if device:
|
||||||
# print(f"BleakScanner device variable loaded - {device.name}")
|
# print(f"BleakScanner device variable loaded - {device.name}")
|
||||||
print(f".. Found device: {device.name} ({device.address})")
|
print(f".. Found device: {device.name} ({device.address}) - connecting...")
|
||||||
fail_count = 0
|
fail_count = 0
|
||||||
# else:
|
# else:
|
||||||
# print("BleakScanner device not loaded yet")
|
# print("BleakScanner device not loaded yet")
|
||||||
@@ -43,14 +43,14 @@ async def read_data(mac_address):
|
|||||||
success = False
|
success = False
|
||||||
# Check if Mi service is available
|
# Check if Mi service is available
|
||||||
|
|
||||||
print(".. Waiting on client to connect...")
|
#print(".. Waiting on client to connect...")
|
||||||
while not client.is_connected:
|
while not client.is_connected:
|
||||||
await asyncio.sleep(0.1)
|
await asyncio.sleep(0.1)
|
||||||
while not success:
|
while not success:
|
||||||
try:
|
try:
|
||||||
print(".. Client connected, getting services")
|
#print(".. Client connected, getting services")
|
||||||
services = client.services
|
services = client.services
|
||||||
print(".. Services acquired, loading uuid matches")
|
#print(".. Services acquired, loading uuid matches")
|
||||||
mi_service = next((s for s in services if s.uuid.lower() == MI_SERVICE_UUID.lower()), None)
|
mi_service = next((s for s in services if s.uuid.lower() == MI_SERVICE_UUID.lower()), None)
|
||||||
success = True
|
success = True
|
||||||
#print("uuid matches loaded")
|
#print("uuid matches loaded")
|
||||||
|
|||||||
Reference in new issue
Block a user