mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 20:55:10 +02:00
Fix get_time_zone annotations in dt_util (#129050)
This commit is contained in:
@@ -95,7 +95,7 @@ def set_default_time_zone(time_zone: dt.tzinfo) -> None:
|
|||||||
get_default_time_zone.cache_clear()
|
get_default_time_zone.cache_clear()
|
||||||
|
|
||||||
|
|
||||||
def get_time_zone(time_zone_str: str) -> dt.tzinfo | None:
|
def get_time_zone(time_zone_str: str) -> zoneinfo.ZoneInfo | None:
|
||||||
"""Get time zone from string. Return None if unable to determine.
|
"""Get time zone from string. Return None if unable to determine.
|
||||||
|
|
||||||
Must be run in the executor if the ZoneInfo is not already
|
Must be run in the executor if the ZoneInfo is not already
|
||||||
@@ -107,7 +107,7 @@ def get_time_zone(time_zone_str: str) -> dt.tzinfo | None:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
async def async_get_time_zone(time_zone_str: str) -> dt.tzinfo | None:
|
async def async_get_time_zone(time_zone_str: str) -> zoneinfo.ZoneInfo | None:
|
||||||
"""Get time zone from string. Return None if unable to determine.
|
"""Get time zone from string. Return None if unable to determine.
|
||||||
|
|
||||||
Async friendly.
|
Async friendly.
|
||||||
|
Reference in New Issue
Block a user