diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConstraintChecker.kt b/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConstraintChecker.kt index 111dcd5b79..07b4f8f66b 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConstraintChecker.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConstraintChecker.kt @@ -18,6 +18,9 @@ class ConstraintChecker @Inject constructor(private val activePlugin: ActivePlug fun isClosedLoopAllowed(): Constraint = isClosedLoopAllowed(Constraint(true)) + fun isLgsAllowed(): Constraint = + isLgsAllowed(Constraint(true)) + fun isAutosensModeEnabled(): Constraint = isAutosensModeEnabled(Constraint(true)) @@ -77,6 +80,16 @@ class ConstraintChecker @Inject constructor(private val activePlugin: ActivePlug return value } + override fun isLgsAllowed(value: Constraint): Constraint { + val constraintsPlugins = activePlugin.getSpecificPluginsListByInterface(ConstraintsInterface::class.java) + for (p in constraintsPlugins) { + val constraint = p as ConstraintsInterface + if (!p.isEnabled(PluginType.CONSTRAINTS)) continue + constraint.isLgsAllowed(value) + } + return value + } + override fun isAutosensModeEnabled(value: Constraint): Constraint { val constraintsPlugins = activePlugin.getSpecificPluginsListByInterface(ConstraintsInterface::class.java) for (p in constraintsPlugins) {