mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Migrate legacy typehints in core to PEP-526 (#26403)
* Migrate legacy typehints in core to PEP-526 * Fix one type
This commit is contained in:
committed by
Paulus Schoutsen
parent
2dc90be94f
commit
2f0eb07624
@ -75,7 +75,7 @@ class UnitSystem:
|
||||
pressure: str,
|
||||
) -> None:
|
||||
"""Initialize the unit system object."""
|
||||
errors = ", ".join(
|
||||
errors: str = ", ".join(
|
||||
UNIT_NOT_RECOGNIZED_TEMPLATE.format(unit, unit_type)
|
||||
for unit, unit_type in [
|
||||
(temperature, TEMPERATURE),
|
||||
@ -85,7 +85,7 @@ class UnitSystem:
|
||||
(pressure, PRESSURE),
|
||||
]
|
||||
if not is_valid_unit(unit, unit_type)
|
||||
) # type: str
|
||||
)
|
||||
|
||||
if errors:
|
||||
raise ValueError(errors)
|
||||
|
Reference in New Issue
Block a user