From 3a35f937917d6774a2a3304e462157880f36590f Mon Sep 17 00:00:00 2001 From: matt Date: Thu, 15 Oct 2026 23:51:37 -0700 Subject: [PATCH] increasing freedom degree precision --- api/ble.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/api/ble.py b/api/ble.py index c21e2fd..1cdd675 100644 --- a/api/ble.py +++ b/api/ble.py @@ -78,14 +78,6 @@ async def _discover_device(mac: str) -> Optional[str]: except asyncio.TimeoutError: log.warning("Discover call timed out after %.1fs for %s", SCAN_TIMEOUT + 2.0, mac) return None - - #for d in devices: - # if d.address.lower() == mac.lower(): - # log.info("Found device %s (%s)", d.name or d.address, d.address) - # return d.address - #log.warning("Device %s not found in scan", mac) - #return None - def _parse_sensor_data(raw: bytes) -> (float, int): """Parse the 3-byte Mi packet into temperature & humidity.""" @@ -268,14 +260,14 @@ def test(test_count = 0) -> None: if len(mac_list) == len(passed_list): print(f" Test run {test_count} completed, yee-haw") for sensor in sensors: - temp_f = (sensor['temp'] * 1.8) + 32 - print(f" {sensor['name']} - Temp: {round(temp_f,0)} | Humidity: {sensor['humidity']}") + temp_f = (sensor['temp'] * 1.80) + 32.0 + print(f" {sensor['name']} - Temp: {round(temp_f,1)} | Humidity: {sensor['humidity']}") test_result = True else: print(f" Test run incomplete/failed, re-running, loop {test_loop_count}. Updating test list") for sensor in sensors: - temp_f = (sensor['temp'] * 1.8) + 32 - print(f" {sensor['name']} - Temp: {round(temp_f,0)} | Humidity: {sensor['humidity']}") + temp_f = (sensor['temp'] * 1.80) + 32.0 + print(f" {sensor['name']} - Temp: {round(temp_f,1)} | Humidity: {sensor['humidity']}") mac_list_new = [] for mac in mac_list: if mac not in passed_list: