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:
|
def _get_air_quality(device: Device) -> int | None:
|
||||||
"""Fetch the air quality value."""
|
"""Fetch the air quality value."""
|
||||||
|
assert device.air_purifier_control is not None
|
||||||
if (
|
if (
|
||||||
device.air_purifier_control.air_purifiers[0].air_quality == 65535
|
device.air_purifier_control.air_purifiers[0].air_quality == 65535
|
||||||
): # The sensor returns 65535 if the fan is turned off
|
): # 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:
|
def _get_filter_time_left(device: Device) -> int:
|
||||||
"""Fetch the filter's remaining life (in hours)."""
|
"""Fetch the filter's remaining life (in hours)."""
|
||||||
|
assert device.air_purifier_control is not None
|
||||||
return round(
|
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