Improve rounding the light level conversion in Lutron Caseta (#34167)
This commit is contained in:
1 parent
b0bb125860
commit
028e08c7f6
1 file changed
+1
-1
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user