print line cleanup 3

This commit is contained in:
matt committed 2026-10-13 04:26:35 -07:00
1 parent f00ba3fefc
commit 55f30af700
2 files changed
+8 -10

No files matched your search

+6 -6
View File
@@ -26,14 +26,14 @@ async def read_data(mac_address):
device = next((d for d in devices if d.address.lower() == mac_address.lower()), None)
if device:
# print(f"BleakScanner device variable loaded - {device.name}")
print(f"-- Found device: {device.name} ({device.address})")
print(f"-- Found device: {device.name} ({device.address})")
fail_count = 0
# else:
# print("BleakScanner device not loaded yet")
fail_count = fail_count - 1
if not device:
print(f"!! Device with MAC {mac_address} not found")
print(f"!! Device with MAC {mac_address} not found")
return None
# Connect to the device
@@ -43,14 +43,14 @@ async def read_data(mac_address):
success = False
# Check if Mi service is available
print("?? Waiting on client to connect...")
print("-- Waiting on client to connect...")
while not client.is_connected:
await asyncio.sleep(0.1)
while not success:
try:
print("..Client connected, getting services")
print(".. Client connected, getting 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)
success = True
#print("uuid matches loaded")
@@ -68,7 +68,7 @@ async def read_data(mac_address):
temp = temp / 100
hum = sensor_data[2]
print(f"-- Temperature: {temp:.1f}°C, Humidity: {hum}%")
print(f"-- Temperature: {temp:.1f}°C, Humidity: {hum}%")
return temp, hum
def sensor_data_query(mac_list):