1
mirror of https://github.com/home-assistant/core synced 2024-09-03 08:14:07 +02:00

Fix timezone issue on onvif integration (#70473)

This commit is contained in:
Marvin ROGER 2022-05-12 16:23:18 +02:00 committed by GitHub
parent b70e97e949
commit 1cb00cbb79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,17 +165,13 @@ class ONVIFDevice:
)
return
tzone = dt_util.DEFAULT_TIME_ZONE
cdate = device_time.LocalDateTime
if device_time.UTCDateTime:
tzone = dt_util.UTC
cdate = device_time.UTCDateTime
else:
tzone = (
dt_util.get_time_zone(
device_time.TimeZone or str(dt_util.DEFAULT_TIME_ZONE)
)
or dt_util.DEFAULT_TIME_ZONE
)
cdate = device_time.LocalDateTime
elif device_time.TimeZone:
tzone = dt_util.get_time_zone(device_time.TimeZone.TZ) or tzone
if cdate is None:
LOGGER.warning("Could not retrieve date/time on this camera")