Fix z-wave brightness off by one (#34170)
Z-wave would drop the floating point by calling int() instead of round() which would result in the brightness being off by one in many cases.
This commit is contained in:
1 parent
028e08c7f6
commit
29f50ddc9c
2 files changed
+12
-2
No files matched your search
@@ -104,7 +104,7 @@ def byte_to_zwave_brightness(value):
|
||||
`value` -- (int) Brightness byte value from 0-255.
|
||||
"""
|
||||
if value > 0:
|
||||
return max(1, int((value / 255) * 99))
|
||||
return max(1, round((value / 255) * 99))
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user