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

This commit is contained in:
Jason Swails 2020-04-13 18:07:32 -04:00 committed by Paulus Schoutsen
parent 87504806b1
commit e365f807c1

View File

@ -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):