Improve rounding the light level conversion in Lutron Caseta (#34167)

This commit is contained in:
Jason Swails authored and Paulus Schoutsen committed 2020-04-13 17:01:32 -07:00
1 parent 87504806b1
commit e365f807c1
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):