Added ability to disable camera ping loop
This commit is contained in:
@@ -9,6 +9,7 @@ It supports the following environment variables:
|
|||||||
- `AMCREST_PORT` (optional, default = 80)
|
- `AMCREST_PORT` (optional, default = 80)
|
||||||
- `AMCREST_USERNAME` (optional, default = admin)
|
- `AMCREST_USERNAME` (optional, default = admin)
|
||||||
- `AMCREST_PASSWORD` (required)
|
- `AMCREST_PASSWORD` (required)
|
||||||
|
- `CAMERA_PING_ENABLED` (optional, default = `true`)
|
||||||
- `MQTT_USERNAME` (required)
|
- `MQTT_USERNAME` (required)
|
||||||
- `MQTT_PASSWORD` (optional, default = empty password)
|
- `MQTT_PASSWORD` (optional, default = empty password)
|
||||||
- `MQTT_HOST` (optional, default = 'localhost')
|
- `MQTT_HOST` (optional, default = 'localhost')
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ amcrest_port = int(os.getenv("AMCREST_PORT") or 80)
|
|||||||
amcrest_username = os.getenv("AMCREST_USERNAME") or "admin"
|
amcrest_username = os.getenv("AMCREST_USERNAME") or "admin"
|
||||||
amcrest_password = os.getenv("AMCREST_PASSWORD")
|
amcrest_password = os.getenv("AMCREST_PASSWORD")
|
||||||
storage_poll_interval = int(os.getenv("STORAGE_POLL_INTERVAL") or 3600)
|
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_host = os.getenv("MQTT_HOST") or "localhost"
|
||||||
mqtt_qos = int(os.getenv("MQTT_QOS") or 0)
|
mqtt_qos = int(os.getenv("MQTT_QOS") or 0)
|
||||||
@@ -330,7 +331,11 @@ mqtt_publish(topics["config"], {
|
|||||||
if storage_poll_interval > 0:
|
if storage_poll_interval > 0:
|
||||||
refresh_storage_sensors()
|
refresh_storage_sensors()
|
||||||
|
|
||||||
|
if camera_ping_enabled:
|
||||||
|
log("Setting up camera ping...")
|
||||||
ping_camera()
|
ping_camera()
|
||||||
|
else:
|
||||||
|
log("Skipping camera ping...")
|
||||||
|
|
||||||
log("Listening for events...")
|
log("Listening for events...")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user