I think these remaining 4 else ifs need to have another && condition that your service is in idle state so that we don't change back into one of these 4 states while a bolus is in progress.
I think these remaining 4 else ifs need to have another && condition that your service is in idle state so that we don't change back into one of these 4 states while a bolus is in progress.