mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 21:25:13 +02:00
Fix round typing [tradfri] (#82438)
This commit is contained in:
@@ -54,6 +54,7 @@ class TradfriSensorEntityDescription(
|
||||
|
||||
def _get_air_quality(device: Device) -> int | None:
|
||||
"""Fetch the air quality value."""
|
||||
assert device.air_purifier_control is not None
|
||||
if (
|
||||
device.air_purifier_control.air_purifiers[0].air_quality == 65535
|
||||
): # The sensor returns 65535 if the fan is turned off
|
||||
@@ -64,8 +65,12 @@ def _get_air_quality(device: Device) -> int | None:
|
||||
|
||||
def _get_filter_time_left(device: Device) -> int:
|
||||
"""Fetch the filter's remaining life (in hours)."""
|
||||
assert device.air_purifier_control is not None
|
||||
return round(
|
||||
device.air_purifier_control.air_purifiers[0].filter_lifetime_remaining / 60
|
||||
cast(
|
||||
int, device.air_purifier_control.air_purifiers[0].filter_lifetime_remaining
|
||||
)
|
||||
/ 60
|
||||
)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user