Commit graph

63 commits

Author SHA1 Message Date
Milos Kozak 6f78223c0b add missing dependencies 2023-10-21 20:33:03 +02:00
Milos Kozak 9bd4a06b18 migrate to global kts plugin 2023-10-20 10:49:54 +02:00
Milos Kozak 741f3a9202 wear gradle -> kts 2023-10-19 22:48:49 +02:00
Milos Kozak 4ddef7a508 gradle -> kts 2023-10-18 17:04:02 +02:00
Milos Kozak 71d8ded857 remove android_dependecies 2023-10-16 15:20:50 +02:00
Milos Kozak 2200ce0afb :database:entities cleanup 2023-09-25 18:01:31 +02:00
Milos Kozak b982afbb49 :core:validators cleanup 2023-09-25 13:28:15 +02:00
Milos Kozak 866aaa25f6 tests: increase timeout 2023-09-11 20:04:25 +02:00
robertbuessow 5c34184723 Fixing flaky tests in combov2.comboctl.PumpIOTest. cmdCMDReadErrorWarningStatus and checkCMDHistoryDeltaRetrieval failed about 20% of time (run with @RepeatedTest(100)) since pumpIO.disconnect was send before processing last command was done. 2023-08-30 17:27:29 +02:00
Milos Kozak f2e86ae63c kotlin lints 2023-08-27 01:27:36 +02:00
Milos Kozak 8a458954a8 remove jacoco-android plugin in favor of jacoco-core 2023-07-19 13:53:43 +02:00
Carlos Rafael Giani d280a2bec5 comboctl-main: Allow fetching TDDs while the pump is suspended
There is no good reason for disallowing TDD retrieval while the Combo
is suspended - the TDD history screens are accessible, and TDD retrieval
does not cause any insulin delivery to take place.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-03-22 08:53:21 +01:00
Milos Kozak 438f384c67 lints 2023-03-16 18:36:47 +01:00
Carlos Rafael Giani 9979331ef0 comboctl-parser: Fix typo in E2BatteryEmptyErrorScreenParsing test
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-03-13 21:46:31 +01:00
Carlos Rafael Giani cc4cd2dc04 comboctl-parser: Don't try to interpret text in error screens
That text shows contents that are different to that of warning screens.
Instead of extending the interpretation logic to cover such contents as
well, just use a generic ERROR_TEXT AlertScreenState. That text won't
be interpreted by any program logic anyway, since error screens are
never dismissed automatically.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-03-12 22:40:54 +01:00
Carlos Rafael Giani c1058ad113 comboctl-android: Check that the adapter is available and enabled
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-03-11 19:00:25 +01:00
Carlos Rafael Giani 72819cbc53 comboctl-base: Add exceptions for disabled and missing Bluetooth adapters
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-03-11 19:00:25 +01:00
Carlos Rafael Giani 2cdc4c45ea comboctl-parser: Add Lithuanian support
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-03-11 19:00:25 +01:00
Carlos Rafael Giani 3f3884e513 comboctl-parser: Handle percent symbol in some TBR percentage screens
Some TBR percentage screens like the Lithuanian one show a % symbol
right after the text. Add an optional symbol parser to handle it.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-03-11 19:00:25 +01:00
Carlos Rafael Giani dbe72e72da comboctl-parser: Add Slovenian support
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-03-11 19:00:25 +01:00
Carlos Rafael Giani d2c0aba2b5 comboctl-main: Improve alert screen handling
* Check if the alert screen is the confirm or snooze screen, and press
  the CHECK button once or twice accordingly. This avoids fringe cases
  where the amount of button presses is incorrect.
* In rare cases, more alert screens may show up after dismissing the
  current one. Add code to keep observing remaining alerts and redo
  the dismissing logic after a while if necessary.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-03-11 19:00:25 +01:00
Carlos Rafael Giani 76dec4aad6 comboctl-parser: Also parse text in alert screens
This helps with distinguishing the "snooze" and "confirm" screens.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-03-11 19:00:25 +01:00
Carlos Rafael Giani 82bdb4df9a comboctl-main: Use the standard bolus' total amount as its immediate amount
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-02-09 18:50:27 +01:00
Carlos Rafael Giani 409852685e comboctl-base: Fix PumpIOTest
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-03 13:35:30 +01:00
Carlos Rafael Giani 4bb163a633 comboctl-main: Support extended/multiwave bolus in Pump.deliverBolus()
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-02 19:21:26 +01:00
Carlos Rafael Giani 83dce8bee3 comboctl-base: Handle ext/multiwave bolus in PumpIO.deliverCMDStandardBolus
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-02 19:21:26 +01:00
Carlos Rafael Giani 05674ba552 comboctl-base: Support automatic extended/multiwave boluses in history
When delivering extended and multiwave boluses through the command mode,
the boluses are marked as "automatic" by the Combo, and use different IDs
compared to extended/multiwave boluses that were initiated through the
remote terminal mode. Add support for these IDs, and extend the
CMDHistoryEventDetail subclasses for extended and multiwave boluses with
a field that specifies whether the bolus was manual or automatic.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-02 19:21:26 +01:00
Carlos Rafael Giani 916b847b21 comboctl-base: Add support for creating extended/multiwave bolus packets
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-02 19:21:26 +01:00
Carlos Rafael Giani 22a144416b comboctl-main: Parse ext bolus main screen instead of throwing exception
To support extended and multiwave boluses in the future, it is necessary
to properly parse the main screen when it shows extended/multiwave
content. This requires some rework. Most notably, the code needs to be
changed to no longer throw ExtendedOrMultiwaveBolusActiveException.

One problem with extended/multiwave content on the main screen is that
it does not show TBR details (percentage & remaining duration). For this
reason, it is necessary to actually navigate to the TBR percentage screen
and read those value there. This means that the setTbr() call is slower
when an extended/multiwave bolus is ongoing, but better to be slower than
to omit post-setTbr checks that may catch rare errors.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-02 19:21:26 +01:00
Carlos Rafael Giani 7f6f63bcf4 comboctl-main: Always move past skipped screens in navigateToRTScreen()
Without this, navigation gets stuck if an unrecognized screen
is encountered.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-02 19:21:26 +01:00
Carlos Rafael Giani 9af5499d70 comboctl-base: Rename CMDBolusType to CMDImmediateBolusType
This name is less confusing, especially if another enum class for the
bolus delivery is about to be introduced.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-02 19:21:26 +01:00
Carlos Rafael Giani 7598ae758c comboctl-parser: Fix battery in ExtendedAndMultiwaveBolusMainScreenParser
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-02 19:21:26 +01:00
Carlos Rafael Giani 8d9e5cc833 comboctl: Apply ktlint based fixes
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2023-01-02 19:21:22 +01:00
Carlos Rafael Giani 16a3b74f50 comboctl-main: Fix getBasalProfile() progress report and screen counting
The previous behavior was reading the profile correctly, but the progress
report was off by one factor. Also, blinking screens were considered as
separate ones, causing the short button press based fallback to kick in
unnecessarily often because that blinking screen behavior caused the
main long button press based reading loop to miss the last profile factor.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-12-10 19:18:30 +01:00
Carlos Rafael Giani e06ecaa7d8 comboctl-android: Remove some obsolete / unnecessary / solved TODOs
* device is unpaired while discovery is ongoing" does not happen because
  discovery only occurs if no device is paired.
* Using the second offered BluetoothDevice works reliably on all tested
  phones so far.
* AndroidBluetoothDevice throws a BluetoothException if all of its
  internal connect attempts fail.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-12-10 18:49:12 +01:00
Carlos Rafael Giani 6ecc1073df comboctl-main: Finish reading profile by pressing BACK to avoid vibration
When exiting the basal profile screens by pressing CHECK twice, a
vibration happens. This can be avoided by instead pressing BACK until
the main screen is reached.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-12-10 17:34:53 +01:00
Milos Kozak 53e29aaf33 minor cleanup 2022-12-09 14:21:28 +01:00
Carlos Rafael Giani ad381e3c26 comboctl: main: Improvements to Pump.setTbr()
* Don't set a fake 100% TBR again if the current fake 100% TBR
  is finished within 15 minutes (reduces number of TBR operations
  and allows the Combo to return to a non-TBR state).
* If the expected TBR percentage was a non-100% one, but not we see
  a non-TBR main screen, check if the expected TBR duration was <= 2
  minutes. This covers the edge case when the TBR ends at the same
  time when we run this check.
* Inform callers about the exact outcome of the setTbr() call. It could
  be that it set the TBR normally. Or, it might have set a fake 100% TBR
  (if the user requested a 100% TBR and force100Percent was set to false),
  and so on.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-12-07 12:38:59 +01:00
Carlos Rafael Giani 14c39ee05e Fix comboctl unit test integration
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-12-07 12:38:59 +01:00
Carlos Rafael Giani aa595fefcb combov2: Integrate comboctl unit tests
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-12-05 20:43:48 +01:00
Milos Kozak ff9cbe2cb0 Non transitive R classes 2022-12-02 10:56:11 +01:00
Milos Kozak 2b5e51c857 code cleanup 2022-11-30 19:30:46 +01:00
Carlos Rafael Giani b029814de5 comboctl-main: Adjust pump's local datetime when timezones change
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-11-28 14:19:01 +01:00
Milos Kozak ae52eb3402 resolve deprecation warnings 2022-11-27 22:42:33 +01:00
Carlos Rafael Giani 1131ad1195 comboctl-main: Refine waiting periods during long RT button press
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-11-25 00:26:32 +01:00
Carlos Rafael Giani 1e6b560199 combov2: Refer to correct comboctl source subdirectory in gradle script
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-11-25 00:26:30 +01:00
Carlos Rafael Giani ede5ad1cda comboctl-main: Rename variables such that currentQuantity is not shadowed
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-11-25 00:26:21 +01:00
Carlos Rafael Giani 5745e95244 Update combov2 code to match recent changes in dev branch
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-11-21 19:58:29 +01:00
Carlos Rafael Giani 90480ab1d9 comboctl-main: Add more argument checks to Pump.connect()
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-11-20 23:04:30 +01:00
Carlos Rafael Giani 605fe04d74 comboctl-main: Check for unchanging screen type in navigateToRTScreen()
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
2022-11-20 21:58:50 +01:00