From e897c8c47ca2f25ceee6de01fe03f8b4df104f48 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Sun, 20 Nov 2022 22:45:34 +0100 Subject: [PATCH] Fix round typing [shelly] (#82436) --- homeassistant/components/shelly/light.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/shelly/light.py b/homeassistant/components/shelly/light.py index dda9a41bb89..805b8147ba5 100644 --- a/homeassistant/components/shelly/light.py +++ b/homeassistant/components/shelly/light.py @@ -184,16 +184,17 @@ class BlockShellyLight(ShellyBlockEntity, LightEntity): @property def brightness(self) -> int: """Return the brightness of this light between 0..255.""" + brightness_pct: int if self.mode == "color": if self.control_result: brightness_pct = self.control_result["gain"] else: - brightness_pct = self.block.gain + brightness_pct = cast(int, self.block.gain) else: if self.control_result: brightness_pct = self.control_result["brightness"] else: - brightness_pct = self.block.brightness + brightness_pct = cast(int, self.block.brightness) return round(255 * brightness_pct / 100)