mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Improve fully_kiosk sensor typing (#137079)
This commit is contained in:
parent
c35cd6fb76
commit
95bcbd2c4f
@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
SensorDeviceClass,
|
SensorDeviceClass,
|
||||||
@ -152,6 +152,8 @@ class FullySensor(FullyKioskEntity, SensorEntity):
|
|||||||
value, extra_state_attributes = self.entity_description.state_fn(value)
|
value, extra_state_attributes = self.entity_description.state_fn(value)
|
||||||
|
|
||||||
if self.entity_description.round_state_value:
|
if self.entity_description.round_state_value:
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
assert isinstance(value, int)
|
||||||
value = round_storage(value)
|
value = round_storage(value)
|
||||||
|
|
||||||
self._attr_native_value = value
|
self._attr_native_value = value
|
||||||
|
Loading…
x
Reference in New Issue
Block a user