AutotuneConfigProvider.swift 507 B

1234567891011121314151617181920
  1. import Combine
  2. extension AutotuneConfig {
  3. final class Provider: BaseProvider, AutotuneConfigProvider {
  4. @Injected() private var apsManager: APSManager!
  5. var autotune: Autotune? {
  6. try? storage.retrieve(OpenAPS.Settings.autotune, as: Autotune.self)
  7. }
  8. func runAutotune() -> AnyPublisher<Autotune?, Never> {
  9. apsManager.autotune()
  10. }
  11. func deleteAutotune() {
  12. try? storage.remove(OpenAPS.Settings.autotune)
  13. }
  14. }
  15. }