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:
parent
b70e97e949
commit
1cb00cbb79
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user