increasing freedom degree precision

This commit is contained in:
matt committed 2026-10-15 23:51:37 -07:00
1 parent d22a26d2dc
commit 3a35f93791
1 file changed
+4 -12
+4 -12
View File
@@ -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: