فهرست منبع

Don't truncate scaled range

Some ranges are supposed to be fractional, so should not be truncated.
Previous change went too far and caused test failures.
Jason Rumney 2 سال پیش
والد
کامیت
007313dcd6
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      custom_components/tuya_local/helpers/device_config.py

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

@@ -44,7 +44,7 @@ def _scale_range(r, s):
     "Scale range r by factor s"
     "Scale range r by factor s"
     if s == 1:
     if s == 1:
         return r
         return r
-    return {"min": int(r["min"] / s), "max": int(r["max"] / s)}
+    return {"min": r["min"] / s, "max": r["max"] / s}
 
 
 
 
 _unsigned_fmts = {
 _unsigned_fmts = {