Skip to content

Commit

Permalink
denote that settempraterequest not supported <15m or >250 percent
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoglom committed Dec 27, 2024
1 parent 70ddf92 commit 1f5f5b3
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import com.jwoglom.pumpx2.pump.messages.models.SupportedDevices;
import com.jwoglom.pumpx2.pump.messages.response.control.SetTempRateResponse;

/**
* Sets a temp rate for basal delivery. Note that ControlIQ must be off before setting a temp rate.
*/
@MessageProps(
opCode=-92,
size=6, // 30 with signed
Expand All @@ -32,6 +35,12 @@ public SetTempRateRequest(byte[] raw) {
parse(raw);
}

/**
* Sets a temp rate for basal delivery.
*
* @param minutes between 15 minutes and 72 hours. durations shorter than 15 minutes are not supported and the pump will return an error
* @param percent between 0 percent and 250 percent. values above 250% are not supported and the pump will return an error
*/
public SetTempRateRequest(int minutes, int percent) {
Preconditions.checkArgument(minutes >= 15 && minutes <= 72*60, "duration of temp rate must be between 15 and 4,320 minutes (72 hours)");
Preconditions.checkArgument(percent >= 0 && percent <= 250, "percent temp rate must be between 0-250%");
Expand Down

0 comments on commit 1f5f5b3

Please sign in to comment.