Fix Onvif get_time_zone from device (#51620)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Pawel 2021-06-08 20:01:36 +02:00 committed by GitHub
parent 79da2bca3f
commit abbd4d1d16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -169,7 +169,9 @@ class ONVIFDevice:
cdate = device_time.UTCDateTime
else:
tzone = (
dt_util.get_time_zone(device_time.TimeZone)
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