Fix ZWave light brightness (#14261)

* Fix ZWave light brightness
* The brightness should always be an integer
* Changed to round
This commit is contained in:
cdce8p 2018-05-03 23:28:03 +02:00 committed by GitHub
parent 15e75b07d8
commit 8cabec7ac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,7 @@ def get_device(node, values, node_config, **kwargs):
def brightness_state(value): def brightness_state(value):
"""Return the brightness and state.""" """Return the brightness and state."""
if value.data > 0: if value.data > 0:
return round((value.data / 99) * 255, 0), STATE_ON return round((value.data / 99) * 255), STATE_ON
return 0, STATE_OFF return 0, STATE_OFF