mirror of
https://github.com/home-assistant/core
synced 2024-08-02 23:40:32 +02:00
Convert better from byte value to percentage in futurenow (#45042)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
c8e04ee960
commit
bed29fd4b1
@ -51,7 +51,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
|
||||
def to_futurenow_level(level):
|
||||
"""Convert the given Home Assistant light level (0-255) to FutureNow (0-100)."""
|
||||
return int((level * 100) / 255)
|
||||
return round((level * 100) / 255)
|
||||
|
||||
|
||||
def to_hass_level(level):
|
||||
|
Loading…
Reference in New Issue
Block a user