Просмотр исходного кода

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 лет назад
Родитель
Сommit
f2fed71fdd
1 измененных файлов с 1 добавлено и 1 удалено
  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]):
                 if d.id not in keys or not _typematch(d.type, dps[d.id]):
                     return 0
                     return 0
                 keys.remove(d.id)
                 keys.remove(d.id)
-        return (total - len(keys)) * 100 / total
+        return round((total - len(keys)) * 100 / total)
 
 
 
 
 class TuyaEntityConfig:
 class TuyaEntityConfig: