Skip to content

Commit

Permalink
Actually assign new timestamps with proper timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
ep1cman committed Mar 18, 2022
1 parent 4eec2fd commit ae323e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions unifi_protect_backup/unifi_protect_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@ async def _backup_events(self) -> None:

# Fix timezones since pyunifiprotect sets all timestamps to UTC. Instead localize them to
# the timezone of the unifi protect NVR.
event.start.replace(tzinfo=pytz.utc).astimezone(self._protect.bootstrap.nvr.timezone)
event.end.replace(tzinfo=pytz.utc).astimezone(self._protect.bootstrap.nvr.timezone)
event.start = event.start.replace(tzinfo=pytz.utc).astimezone(self._protect.bootstrap.nvr.timezone)
event.end = event.end.replace(tzinfo=pytz.utc).astimezone(self._protect.bootstrap.nvr.timezone)

logger.info(f"Backing up event: {event.id}")
logger.debug(f"Remaining Queue: {self._download_queue.qsize()}")
Expand Down

0 comments on commit ae323e6

Please sign in to comment.