diff --git a/app-wear-shared/shared/src/main/java/info/nightscout/rx/events/EventFoodChanged.kt b/app-wear-shared/shared/src/main/java/info/nightscout/rx/events/EventFoodChanged.kt new file mode 100644 index 0000000000..6121d315cd --- /dev/null +++ b/app-wear-shared/shared/src/main/java/info/nightscout/rx/events/EventFoodChanged.kt @@ -0,0 +1,3 @@ +package info.nightscout.rx.events + +class EventFoodChanged : Event() \ No newline at end of file diff --git a/app-wear-shared/shared/src/main/java/info/nightscout/rx/events/EventFoodDatabaseChanged.kt b/app-wear-shared/shared/src/main/java/info/nightscout/rx/events/EventFoodDatabaseChanged.kt deleted file mode 100644 index 845df25de7..0000000000 --- a/app-wear-shared/shared/src/main/java/info/nightscout/rx/events/EventFoodDatabaseChanged.kt +++ /dev/null @@ -1,3 +0,0 @@ -package info.nightscout.rx.events - -class EventFoodDatabaseChanged : Event() \ No newline at end of file diff --git a/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt b/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt index 22751eca68..8ae06882a8 100644 --- a/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt +++ b/implementation/src/main/java/info/nightscout/implementation/db/CompatDBHelper.kt @@ -19,7 +19,7 @@ import info.nightscout.rx.bus.RxBus import info.nightscout.rx.events.EventDeviceStatusChange import info.nightscout.rx.events.EventEffectiveProfileSwitchChanged import info.nightscout.rx.events.EventExtendedBolusChange -import info.nightscout.rx.events.EventFoodDatabaseChanged +import info.nightscout.rx.events.EventFoodChanged import info.nightscout.rx.events.EventNewBG import info.nightscout.rx.events.EventNewHistoryData import info.nightscout.rx.events.EventOfflineChange @@ -101,7 +101,7 @@ class CompatDBHelper @Inject constructor( } it.filterIsInstance().firstOrNull()?.let { food -> aapsLogger.debug(LTag.DATABASE, "Firing EventFoodDatabaseChanged $food") - rxBus.send(EventFoodDatabaseChanged()) + rxBus.send(EventFoodChanged()) } it.filterIsInstance().firstOrNull()?.let { ps -> aapsLogger.debug(LTag.DATABASE, "Firing EventProfileSwitchChanged $ps") diff --git a/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt b/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt index b9e3f6a094..223ab1b841 100644 --- a/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt +++ b/plugins/main/src/main/java/info/nightscout/plugins/general/food/FoodFragment.kt @@ -28,7 +28,7 @@ import info.nightscout.plugins.databinding.FoodFragmentBinding import info.nightscout.plugins.databinding.FoodItemBinding import info.nightscout.rx.AapsSchedulers import info.nightscout.rx.bus.RxBus -import info.nightscout.rx.events.EventFoodDatabaseChanged +import info.nightscout.rx.events.EventFoodChanged import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag import info.nightscout.shared.extensions.toVisibility @@ -92,7 +92,7 @@ class FoodFragment : DaggerFragment() { override fun onResume() { super.onResume() disposable += rxBus - .toObservable(EventFoodDatabaseChanged::class.java) + .toObservable(EventFoodChanged::class.java) .observeOn(aapsSchedulers.main) .debounce(1L, TimeUnit.SECONDS) .subscribe({ swapAdapter() }, fabricPrivacy::logException) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt index c8f4bf44f9..24bea20168 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclient/services/NSClientService.kt @@ -183,6 +183,14 @@ import javax.inject.Inject .toObservable(EventDeviceStatusChange::class.java) .observeOn(aapsSchedulers.io) .subscribe({ resend("EventDeviceStatusChange") }, fabricPrivacy::logException) + disposable += rxBus + .toObservable(EventTempTargetChange::class.java) + .observeOn(aapsSchedulers.io) + .subscribe({ resend("EventTempTargetChange") }, fabricPrivacy::logException) + disposable += rxBus + .toObservable(EventProfileSwitchChanged::class.java) + .observeOn(aapsSchedulers.io) + .subscribe({ resend("EventProfileSwitchChanged") }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventTherapyEventChange::class.java) .observeOn(aapsSchedulers.io) diff --git a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt index 5269b0d05c..022efe1499 100644 --- a/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt +++ b/plugins/sync/src/main/java/info/nightscout/plugins/sync/nsclientV3/NSClientV3Plugin.kt @@ -72,7 +72,9 @@ import info.nightscout.rx.events.EventNSClientNewLog import info.nightscout.rx.events.EventNewHistoryData import info.nightscout.rx.events.EventOfflineChange import info.nightscout.rx.events.EventPreferenceChange +import info.nightscout.rx.events.EventProfileSwitchChanged import info.nightscout.rx.events.EventSWSyncStatus +import info.nightscout.rx.events.EventTempTargetChange import info.nightscout.rx.events.EventTherapyEventChange import info.nightscout.rx.logging.AAPSLogger import info.nightscout.rx.logging.LTag @@ -228,6 +230,14 @@ class NSClientV3Plugin @Inject constructor( .toObservable(EventNewHistoryData::class.java) .observeOn(aapsSchedulers.io) .subscribe({ executeUpload("NEW_DATA", forceNew = false) }, fabricPrivacy::logException) + disposable += rxBus + .toObservable(EventTempTargetChange::class.java) + .observeOn(aapsSchedulers.io) + .subscribe({ executeUpload("EventTempTargetChange", forceNew = false) }, fabricPrivacy::logException) + disposable += rxBus + .toObservable(EventProfileSwitchChanged::class.java) + .observeOn(aapsSchedulers.io) + .subscribe({ executeUpload("EventProfileSwitchChanged", forceNew = false) }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventDeviceStatusChange::class.java) .observeOn(aapsSchedulers.io)