mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-02 17:25:22 +03:00
Use datetime.datetime and remove unused imports
This commit is contained in:
parent
27618d6f81
commit
ab575cd090
@ -1,29 +1,24 @@
|
||||
import base64
|
||||
import copy
|
||||
import datetime
|
||||
import hashlib
|
||||
import itertools
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import queue
|
||||
import threading
|
||||
import time
|
||||
from collections import Counter, defaultdict
|
||||
from statistics import mean, median
|
||||
from statistics import median
|
||||
from typing import Callable
|
||||
|
||||
import cv2
|
||||
import numpy as np
|
||||
|
||||
from frigate.config import CameraConfig, SnapshotsConfig, RecordConfig, FrigateConfig
|
||||
from frigate.const import CACHE_DIR, CLIPS_DIR, RECORD_DIR
|
||||
from frigate.const import CLIPS_DIR
|
||||
from frigate.util import (
|
||||
SharedMemoryFrameManager,
|
||||
calculate_region,
|
||||
draw_box_with_label,
|
||||
draw_timestamp,
|
||||
load_labels,
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -857,10 +852,10 @@ class TrackedObjectProcessor(threading.Thread):
|
||||
)
|
||||
|
||||
# always updated latest motion
|
||||
self.last_motion_updates[camera] = int(time.time())
|
||||
self.last_motion_updates[camera] = datetime.datetime.now().timestamp
|
||||
elif not motion_boxes and self.last_motion_updates.get(camera, 0) != 0:
|
||||
mqtt_delay = self.config.cameras[camera].motion.mqtt_off_delay
|
||||
now = int(time.time())
|
||||
now = datetime.datetime.now().timestamp
|
||||
|
||||
# If no motion, make sure the off_delay has passed
|
||||
if now - self.last_motion_updates.get(camera, 0) >= mqtt_delay:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user