1
0
mirror of synced 2026-03-30 14:23:46 +00:00

Added ability to disable camera ping loop

This commit is contained in:
Cam Soper
2021-10-08 11:27:09 -05:00
parent 7bbe3cbcf4
commit 2b692c17ab
2 changed files with 7 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ It supports the following environment variables:
- `AMCREST_PORT` (optional, default = 80)
- `AMCREST_USERNAME` (optional, default = admin)
- `AMCREST_PASSWORD` (required)
- `CAMERA_PING_ENABLED` (optional, default = `true`)
- `MQTT_USERNAME` (required)
- `MQTT_PASSWORD` (optional, default = empty password)
- `MQTT_HOST` (optional, default = 'localhost')

View File

@@ -18,6 +18,7 @@ amcrest_port = int(os.getenv("AMCREST_PORT") or 80)
amcrest_username = os.getenv("AMCREST_USERNAME") or "admin"
amcrest_password = os.getenv("AMCREST_PASSWORD")
storage_poll_interval = int(os.getenv("STORAGE_POLL_INTERVAL") or 3600)
camera_ping_enabled = os.getenv("CAMERA_PING_ENABLED") == "true"
mqtt_host = os.getenv("MQTT_HOST") or "localhost"
mqtt_qos = int(os.getenv("MQTT_QOS") or 0)
@@ -330,7 +331,11 @@ mqtt_publish(topics["config"], {
if storage_poll_interval > 0:
refresh_storage_sensors()
ping_camera()
if camera_ping_enabled:
log("Setting up camera ping...")
ping_camera()
else:
log("Skipping camera ping...")
log("Listening for events...")