Skip to content

Commit

Permalink
Fix unsuspend (#542)
Browse files Browse the repository at this point in the history
* move unsuspend_if_no_temp somewhere it can actually be executed

* move unsuspend_if_no_temp somewhere it can actually be executed

* typo

* move unsuspend_if_no_temp somewhere it can actually be executed

* if smb_verify_enacted, check if suspended
  • Loading branch information
scottleibrand authored Jul 12, 2017
1 parent 4719c41 commit ace821f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions bin/oref0-pump-loop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,8 @@ function smb_check_everything {
&& smb_verify_status \
|| ( echo Retrying SMB checks
wait_for_silence 10
if grep -q '"suspended": true' monitor/status.json; then
echo -n "Pump suspended; "
unsuspend_if_no_temp
fi
smb_verify_status
smb_reservoir_before \
smb_verify_status \
&& smb_reservoir_before \
&& smb_enact_temp \
&& ( smb_verify_suggested || smb_suggest ) \
&& smb_verify_reservoir \
Expand Down Expand Up @@ -145,7 +141,7 @@ function smb_enact_temp {
else
echo -n "No smb_enact needed. "
fi \
&& smb_verify_enacted
&& ( smb_verify_enacted || ( smb_verify_status; smb_verify_enacted) )
}
function smb_verify_enacted {
Expand Down Expand Up @@ -197,7 +193,10 @@ function smb_verify_status {
&& cat monitor/status.json | jq -C -c . \
&& grep -q '"status": "normal"' monitor/status.json \
&& grep -q '"bolusing": false' monitor/status.json \
&& grep -q '"suspended": false' monitor/status.json
&& if grep -q '"suspended": true' monitor/status.json; then
echo -n "Pump suspended; "
unsuspend_if_no_temp
fi
}
function smb_bolus {
Expand Down

0 comments on commit ace821f

Please sign in to comment.