Log warning if unable to fetch storage sensors
This commit is contained in:
@@ -88,11 +88,13 @@ def refresh_storage_sensors():
|
|||||||
Timer(storage_sensors_interval, refresh_storage_sensors).start()
|
Timer(storage_sensors_interval, refresh_storage_sensors).start()
|
||||||
log("Fetching storage sensors...")
|
log("Fetching storage sensors...")
|
||||||
|
|
||||||
storage = camera.storage_all
|
try:
|
||||||
mqtt_publish(topics["storage_used_percent"], str(storage["used_percent"]))
|
storage = camera.storage_all
|
||||||
mqtt_publish(topics["storage_used"], str(storage["used"][0]))
|
mqtt_publish(topics["storage_used_percent"], str(storage["used_percent"]))
|
||||||
mqtt_publish(topics["storage_total"], str(storage["total"][0]))
|
mqtt_publish(topics["storage_used"], str(storage["used"][0]))
|
||||||
|
mqtt_publish(topics["storage_total"], str(storage["total"][0]))
|
||||||
|
except AmcrestError as error:
|
||||||
|
log(f"Error fetching storage information {error}", level="WARNING")
|
||||||
|
|
||||||
def signal_handler(sig, frame):
|
def signal_handler(sig, frame):
|
||||||
# exit immediately upon receiving a second SIGINT
|
# exit immediately upon receiving a second SIGINT
|
||||||
|
|||||||
Reference in New Issue
Block a user