diff --git a/owrx/source/pluto_sdr.py b/owrx/source/pluto_sdr.py index bcab81e0..21d9e378 100644 --- a/owrx/source/pluto_sdr.py +++ b/owrx/source/pluto_sdr.py @@ -1,4 +1,5 @@ from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription +from owrx.form.input import Input, TextInput from owrx.form.input.validator import Range from typing import List @@ -7,10 +8,32 @@ class PlutoSdrSource(SoapyConnectorSource): def getDriver(self): return "plutosdr" + def getEventNames(self): + return super().getEventNames() + ["hostname"] + + def buildSoapyDeviceParameters(self, parsed, values): + params = super().buildSoapyDeviceParameters(parsed, values) + if "hostname" in values: + params = [p for p in params if "hostname" not in p] + params += [{"hostname": values["hostname"]}] + return params + class PlutoSdrDeviceDescription(SoapyConnectorDeviceDescription): def getName(self): return "PlutoSDR" + def getInputs(self) -> List[Input]: + return super().getInputs() + [ + TextInput( + "hostname", + "Hostname", + infotext="Use this for PlutoSDR devices attached to the network" + ) + ] + + def getDeviceOptionalKeys(self): + return super().getDeviceOptionalKeys() + ["hostname"] + def getSampleRateRanges(self) -> List[Range]: return [Range(520833, 61440000)] diff --git a/owrx/source/soapy_remote.py b/owrx/source/soapy_remote.py index efbe5c63..f832ec4f 100644 --- a/owrx/source/soapy_remote.py +++ b/owrx/source/soapy_remote.py @@ -14,7 +14,7 @@ class SoapyRemoteSource(SoapyConnectorSource): def buildSoapyDeviceParameters(self, parsed, values): params = super().buildSoapyDeviceParameters(parsed, values) - params = [v for v in params if not "remote" in params] + params = [v for v in params if "remote" not in params] params += [{"remote": values["remote"]}] if "remote_driver" in values and values["remote_driver"] is not None: params += [{"remote:driver": values["remote_driver"]}]