Răsfoiți Sursa

Round the quality.

It doesn't really affect anything other than the debug ouput looking nicer.

I don't think it is possible to have 100+ dps, so the rounding shouldn't make
off-by-one mismatches appear falsely as matches.
Jason Rumney 4 ani în urmă
părinte
comite
f2fed71fdd
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      custom_components/tuya_local/helpers/device_config.py

+ 1 - 1
custom_components/tuya_local/helpers/device_config.py

@@ -100,7 +100,7 @@ class TuyaDeviceConfig:
                 if d.id not in keys or not _typematch(d.type, dps[d.id]):
                     return 0
                 keys.remove(d.id)
-        return (total - len(keys)) * 100 / total
+        return round((total - len(keys)) * 100 / total)
 
 
 class TuyaEntityConfig: