mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Improve rounding the light level conversion in Lutron Caseta (#34167)
This commit is contained in:
parent
b0bb125860
commit
028e08c7f6
@ -15,7 +15,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
def to_lutron_level(level):
|
||||
"""Convert the given Home Assistant light level (0-255) to Lutron (0-100)."""
|
||||
return int((level * 100) // 255)
|
||||
return int(round((level * 100) / 255))
|
||||
|
||||
|
||||
def to_hass_level(level):
|
||||
|
Loading…
x
Reference in New Issue
Block a user