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:
dependabot[bot] 2021-10-21 22:46:05 +02:00 committed by GitHub
parent b141aea4c0
commit 1468acfced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -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:

View File

@ -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