Enable Ruff PYI041 (#115229)
This commit is contained in:
parent
cbbadf6256
commit
9cbed10372
22 changed files with 54 additions and 55 deletions
|
@ -401,14 +401,14 @@ def cleanup_name_for_homekit(name: str | None) -> str:
|
|||
return name.translate(HOMEKIT_CHAR_TRANSLATIONS)[:MAX_NAME_LENGTH]
|
||||
|
||||
|
||||
def temperature_to_homekit(temperature: float | int, unit: str) -> float:
|
||||
def temperature_to_homekit(temperature: float, unit: str) -> float:
|
||||
"""Convert temperature to Celsius for HomeKit."""
|
||||
return round(
|
||||
TemperatureConverter.convert(temperature, unit, UnitOfTemperature.CELSIUS), 1
|
||||
)
|
||||
|
||||
|
||||
def temperature_to_states(temperature: float | int, unit: str) -> float:
|
||||
def temperature_to_states(temperature: float, unit: str) -> float:
|
||||
"""Convert temperature back from Celsius to Home Assistant unit."""
|
||||
return (
|
||||
round(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue