mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 05:24:53 +01:00
Bump tzlocal from 3.0 to 4.0.1 (#2553)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
This commit is contained in:
parent
b141aea4c0
commit
1468acfced
2 changed files with 3 additions and 7 deletions
|
@ -1,7 +1,6 @@
|
|||
import logging
|
||||
from importlib import resources
|
||||
from typing import Optional
|
||||
from datetime import timezone
|
||||
|
||||
import tzlocal
|
||||
|
||||
|
@ -66,14 +65,11 @@ def _extract_tz_string(tzfile: bytes) -> str:
|
|||
|
||||
|
||||
def detect_tz() -> str:
|
||||
localzone = tzlocal.get_localzone()
|
||||
if localzone is timezone.utc:
|
||||
return "UTC0"
|
||||
if not hasattr(localzone, "key"):
|
||||
iana_key = tzlocal.get_localzone_name()
|
||||
if iana_key is None:
|
||||
raise cv.Invalid(
|
||||
"Could not automatically determine timezone, please set timezone manually."
|
||||
)
|
||||
iana_key = localzone.key
|
||||
_LOGGER.info("Detected timezone '%s'", iana_key)
|
||||
tzfile = _load_tzdata(iana_key)
|
||||
if tzfile is None:
|
||||
|
|
|
@ -3,7 +3,7 @@ PyYAML==6.0
|
|||
paho-mqtt==1.6.1
|
||||
colorama==0.4.4
|
||||
tornado==6.1
|
||||
tzlocal==3.0 # from time
|
||||
tzlocal==4.0.1 # from time
|
||||
tzdata>=2021.1 # from time
|
||||
pyserial==3.5
|
||||
platformio==5.2.2 # When updating platformio, also update Dockerfile
|
||||
|
|
Loading…
Reference in a new issue