Use var for localhost

This commit is contained in:
Nick Mowen 2023-06-26 11:28:49 -06:00
parent ba3c7f59e5
commit b487e87352
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@ EXPORT_DIR = f"{BASE_DIR}/exports"
BIRDSEYE_PIPE = "/tmp/cache/birdseye"
CACHE_DIR = "/tmp/cache"
YAML_EXT = (".yaml", ".yml")
FRIGATE_LOCALHOST = "http://127.0.0.1:5000"
PLUS_ENV_VAR = "PLUS_API_KEY"
PLUS_API_HOST = "https://api.frigate.video"
BTBN_PATH = "/usr/lib/btbn-ffmpeg"

View File

@ -20,6 +20,7 @@ from frigate.const import (
AUDIO_MAX_BIT_RANGE,
AUDIO_SAMPLE_RATE,
CACHE_DIR,
FRIGATE_LOCALHOST,
)
from frigate.ffmpeg_presets import parse_preset_input
from frigate.log import LogPipe
@ -185,7 +186,7 @@ class AudioEventMaintainer(threading.Thread):
] = datetime.datetime.now().timestamp()
else:
resp = requests.post(
f"http://127.0.0.1:5000/api/events/{self.config.name}/{label}/create",
f"{FRIGATE_LOCALHOST}/api/events/{self.config.name}/{label}/create",
json={"duration": None},
)
@ -207,7 +208,7 @@ class AudioEventMaintainer(threading.Thread):
):
self.detections[detection["label"]] = None
requests.put(
f"http://127.0.0.1/api/events/{detection['id']}/end",
f"{FRIGATE_LOCALHOST}/api/events/{detection['id']}/end",
json={
"end_time": detection["last_detection"]
+ self.config.record.events.post_capture