Merge pull request #2864 from Philoul/Fix/TimeShiftFromWatch

Fix Timeshift for Profile Switches sent from watch
This commit is contained in:
Milos Kozak 2023-10-04 13:35:03 +02:00 committed by GitHub
commit 15459d1a45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -179,7 +179,7 @@ class ProfileFunctionImpl @Inject constructor(
override fun createProfileSwitch(durationInMinutes: Int, percentage: Int, timeShiftInHours: Int): Boolean {
val profile = repository.getPermanentProfileSwitch(dateUtil.now()) ?: 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(
rh.gs(app.aaps.core.ui.R.string.careportal_profileswitch),
activePlugin.activePump,