From 1f8b2f7909360cc193a5e41fd61fa33acf0c9b4d Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Tue, 21 Jul 2020 19:57:23 +0200 Subject: [PATCH] always send busy state event, even when always-on, closes #147 --- owrx/source/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/owrx/source/__init__.py b/owrx/source/__init__.py index 407f0bc..a55f0ee 100644 --- a/owrx/source/__init__.py +++ b/owrx/source/__init__.py @@ -251,13 +251,14 @@ class SdrSource(ABC): except ValueError: pass + hasUsers = self.hasClients(SdrSource.CLIENT_USER) + self.setBusyState(SdrSource.BUSYSTATE_BUSY if hasUsers else SdrSource.BUSYSTATE_IDLE) + # no need to check for users if we are always-on if self.isAlwaysOn(): return - hasUsers = self.hasClients(SdrSource.CLIENT_USER) hasBackgroundTasks = self.hasClients(SdrSource.CLIENT_BACKGROUND) - self.setBusyState(SdrSource.BUSYSTATE_BUSY if hasUsers else SdrSource.BUSYSTATE_IDLE) if not hasUsers and not hasBackgroundTasks: self.stop()