From 0337b5d9752fca8d3e3e736106b0ce52e881188c Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Mon, 21 Nov 2022 18:07:30 +0100 Subject: [PATCH] Fix round typing [isy994] (#82435) --- homeassistant/components/isy994/cover.py | 4 ++-- homeassistant/components/isy994/light.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/isy994/cover.py b/homeassistant/components/isy994/cover.py index 7c82ea2459a..60027a31c89 100644 --- a/homeassistant/components/isy994/cover.py +++ b/homeassistant/components/isy994/cover.py @@ -1,7 +1,7 @@ """Support for ISY994 covers.""" from __future__ import annotations -from typing import Any +from typing import Any, cast from pyisy.constants import ISY_VALUE_UNKNOWN @@ -58,7 +58,7 @@ class ISYCoverEntity(ISYNodeEntity, CoverEntity): if self._node.status == ISY_VALUE_UNKNOWN: return None if self._node.uom == UOM_8_BIT_RANGE: - return round(self._node.status * 100.0 / 255.0) + return round(cast(float, self._node.status) * 100.0 / 255.0) return int(sorted((0, self._node.status, 100))[1]) @property diff --git a/homeassistant/components/isy994/light.py b/homeassistant/components/isy994/light.py index 4606ef7e8de..6e67ed32938 100644 --- a/homeassistant/components/isy994/light.py +++ b/homeassistant/components/isy994/light.py @@ -1,7 +1,7 @@ """Support for ISY994 lights.""" from __future__ import annotations -from typing import Any +from typing import Any, cast from pyisy.constants import ISY_VALUE_UNKNOWN from pyisy.helpers import NodeProperty @@ -70,7 +70,7 @@ class ISYLightEntity(ISYNodeEntity, LightEntity, RestoreEntity): return None # Special Case for ISY Z-Wave Devices using % instead of 0-255: if self._node.uom == UOM_PERCENTAGE: - return round(self._node.status * 255.0 / 100.0) + return round(cast(float, self._node.status) * 255.0 / 100.0) return int(self._node.status) async def async_turn_off(self, **kwargs: Any) -> None: