From 028e08c7f6932fd5277cf37036020a66bba5a0e4 Mon Sep 17 00:00:00 2001 From: Jason Swails Date: Mon, 13 Apr 2020 18:07:32 -0400 Subject: [PATCH] Improve rounding the light level conversion in Lutron Caseta (#34167) --- homeassistant/components/lutron_caseta/light.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/lutron_caseta/light.py b/homeassistant/components/lutron_caseta/light.py index ba4342ecfce..350c35fffa8 100644 --- a/homeassistant/components/lutron_caseta/light.py +++ b/homeassistant/components/lutron_caseta/light.py @@ -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):