Fix ProfileSwitch TimeShift option sent from watch

This commit is contained in:
Philoul 2023-10-04 08:59:34 +02:00
parent 1504cfffef
commit f2cd0166ff

View file

@ -179,7 +179,7 @@ class ProfileFunctionImpl @Inject constructor(
override fun createProfileSwitch(durationInMinutes: Int, percentage: Int, timeShiftInHours: Int): Boolean { override fun createProfileSwitch(durationInMinutes: Int, percentage: Int, timeShiftInHours: Int): Boolean {
val profile = repository.getPermanentProfileSwitch(dateUtil.now()) ?: return false val profile = repository.getPermanentProfileSwitch(dateUtil.now()) ?: return false
val profileStore = activePlugin.activeProfileSource.profile ?: return false val profileStore = activePlugin.activeProfileSource.profile ?: return false
val ps = buildProfileSwitch(profileStore, profile.profileName, durationInMinutes, percentage, 0, dateUtil.now()) ?: return false val ps = buildProfileSwitch(profileStore, profile.profileName, durationInMinutes, percentage, timeShiftInHours, dateUtil.now()) ?: return false
val validity = ProfileSealed.PS(ps).isValid( val validity = ProfileSealed.PS(ps).isValid(
rh.gs(app.aaps.core.ui.R.string.careportal_profileswitch), rh.gs(app.aaps.core.ui.R.string.careportal_profileswitch),
activePlugin.activePump, activePlugin.activePump,