diff --git a/owrx/controllers/settings/sdr.py b/owrx/controllers/settings/sdr.py index 0f1c23c..6ce60c7 100644 --- a/owrx/controllers/settings/sdr.py +++ b/owrx/controllers/settings/sdr.py @@ -4,10 +4,7 @@ from owrx.controllers.settings import SettingsFormController from owrx.source import SdrDeviceDescription, SdrDeviceDescriptionMissing from owrx.config import Config from urllib.parse import quote, unquote - -import logging - -logger = logging.getLogger(__name__) +from owrx.sdr import SdrService class SdrDeviceListController(AuthorizationMixin, WebpageController): @@ -25,18 +22,22 @@ class SdrDeviceListController(AuthorizationMixin, WebpageController): def render_devices(self): def render_device(device_id, config): + # TODO: this only returns non-failed sources... + source = SdrService.getSource(device_id) + return """ -
  • - -

    {device_name}

    -
    -
    - some more device info here -
    -
  • - """.format( +
  • + +

    {device_name}

    +
    +
    State: {state}
    +
    {num_profiles} profile(s)
    +
  • + """.format( device_name=config["name"], device_link="{}/{}".format(self.request.path, quote(device_id)), + state="Unknown" if source is None else source.getState(), + num_profiles=len(config["profiles"]), ) return """