From 24c47412153d9c6cd92eb58c35f8797ff10ab574 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Mon, 8 May 2023 18:23:34 +0200 Subject: [PATCH] simplify --- owrx/sdr.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/owrx/sdr.py b/owrx/sdr.py index 3ada8016..ae4523ad 100644 --- a/owrx/sdr.py +++ b/owrx/sdr.py @@ -39,9 +39,6 @@ class SdrService(object): @staticmethod def getAllSources(): - def isDeviceValid(device): - return sdrTypeAvailable(device) and hasProfiles(device) - def hasProfiles(device): return "profiles" in device and device["profiles"] and len(device["profiles"]) > 0 @@ -70,7 +67,10 @@ class SdrService(object): return cls(props) if SdrService.sources is None: - SdrService.sources = Config.get()["sdrs"].filter(isDeviceValid).map(buildNewSource) + SdrService.sources = Config.get()["sdrs"] \ + .filter(sdrTypeAvailable) \ + .filter(hasProfiles) \ + .map(buildNewSource) return SdrService.sources @staticmethod