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:
J. Nick Koston authored and GitHub committed 2020-04-13 17:51:35 -05:00
1 parent 028e08c7f6
commit 29f50ddc9c
2 files changed
+12 -2

No files matched your search

+1 -1
View File
@@ -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