refactor state handling: uncouple failed and enabled flags

This commit is contained in:
Jakob Ketterl
2021-03-18 19:34:53 +01:00
parent 916f19ac60
commit b25a673829
7 changed files with 66 additions and 43 deletions

View File

@@ -1,7 +1,6 @@
from owrx.config import Config
from owrx.property import PropertyManager, PropertyDeleted, PropertyDelegator, PropertyLayer
from owrx.feature import FeatureDetector, UnknownFeatureException
from owrx.source import SdrSourceState
from functools import partial
import logging
@@ -114,5 +113,5 @@ class SdrService(object):
return {
key: s
for key, s in SdrService.sources.items()
if s.getState() not in [SdrSourceState.FAILED, SdrSourceState.DISABLED]
if not s.isFailed() and s.isEnabled()
}