add check for ha uri
This commit is contained in:
parent
fea32df8bc
commit
072ae9c267
1 changed files with 7 additions and 5 deletions
|
@ -239,12 +239,14 @@ if [ -n "${ntfy_server}" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "${ha_url}" ]; then
|
||||||
message "Sending event to Home Assistant ..."
|
message "Sending event to Home Assistant ..."
|
||||||
result=$(curl -s -X POST -H "Authorization: Bearer ${ha_token}" -H "Content-Type: application/json" "${ha_url}/api/events/motion_event" -d "${data}")
|
result=$(curl -s -X POST -H "Authorization: Bearer ${ha_token}" -H "Content-Type: application/json" "${ha_url}/api/events/motion_event" -d "${data}")
|
||||||
return_code=$?
|
return_code=$?
|
||||||
if [ $return_code != 0 ]; then
|
if [ $return_code != 0 ]; then
|
||||||
message "Error ${return_code} sending to Home Assistant '${ha_url}'"
|
message "Error ${return_code} sending to Home Assistant '${ha_url}'"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if ${remove_picture}; then
|
if ${remove_picture}; then
|
||||||
file_dirname=$(dirname "${file}")
|
file_dirname=$(dirname "${file}")
|
||||||
|
|
Loading…
Reference in a new issue