add check for ha uri
This commit is contained in:
parent
fea32df8bc
commit
072ae9c267
1 changed files with 7 additions and 5 deletions
|
@ -239,11 +239,13 @@ if [ -n "${ntfy_server}" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
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}")
|
||||
return_code=$?
|
||||
if [ $return_code != 0 ]; then
|
||||
message "Error ${return_code} sending to Home Assistant '${ha_url}'"
|
||||
if [ -n "${ha_url}" ]; then
|
||||
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}")
|
||||
return_code=$?
|
||||
if [ $return_code != 0 ]; then
|
||||
message "Error ${return_code} sending to Home Assistant '${ha_url}'"
|
||||
fi
|
||||
fi
|
||||
|
||||
if ${remove_picture}; then
|
||||
|
|
Loading…
Reference in a new issue