From e66a8d1dff8cfb249ffedc0e080fde4f2930d89a Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Mon, 29 Jan 2024 23:33:41 +0100 Subject: [PATCH] handle changes to the always-on option --- owrx/source/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/owrx/source/__init__.py b/owrx/source/__init__.py index 7da39e94..1a500471 100644 --- a/owrx/source/__init__.py +++ b/owrx/source/__init__.py @@ -161,6 +161,8 @@ class SdrSource(ABC): if self.isAlwaysOn() and self.isEnabled(): self.start() + props.filter("always-on").wire(self._handleAlwaysOnChanged) + def isEnabled(self): return self.enabled @@ -177,6 +179,12 @@ class SdrSource(ABC): else: c.onDisable() + def _handleAlwaysOnChanged(self, changes): + if self.isAlwaysOn(): + self.start() + else: + self.checkStatus() + def isFailed(self): return self.failed