mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 04:37:06 +00:00
Fix round typing [tradfri] (#82438)
This commit is contained in:
parent
71604f544b
commit
33e57c2e24
@ -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
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user