From 95bcbd2c4fb6e1677a4103f4928915d3b5311667 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Sat, 1 Feb 2025 21:00:00 +0100 Subject: [PATCH] Improve fully_kiosk sensor typing (#137079) --- homeassistant/components/fully_kiosk/sensor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/fully_kiosk/sensor.py b/homeassistant/components/fully_kiosk/sensor.py index ed95323547f..d92c5c17341 100644 --- a/homeassistant/components/fully_kiosk/sensor.py +++ b/homeassistant/components/fully_kiosk/sensor.py @@ -4,7 +4,7 @@ from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass -from typing import Any +from typing import TYPE_CHECKING, Any from homeassistant.components.sensor import ( SensorDeviceClass, @@ -152,6 +152,8 @@ class FullySensor(FullyKioskEntity, SensorEntity): value, extra_state_attributes = self.entity_description.state_fn(value) if self.entity_description.round_state_value: + if TYPE_CHECKING: + assert isinstance(value, int) value = round_storage(value) self._attr_native_value = value