openwebrx-clone/owrx/controllers/api.py

16 lines
507 B
Python
Raw Normal View History

from . import Controller
from owrx.feature import FeatureDetector
2020-05-10 15:27:46 +00:00
from owrx.details import ReceiverDetails
import json
class ApiController(Controller):
def indexAction(self):
data = json.dumps(FeatureDetector().feature_report())
self.send_response(data, content_type="application/json")
def receiverDetails(self):
2020-05-10 15:27:46 +00:00
receiver_details = ReceiverDetails()
data = json.dumps(receiver_details.__dict__())
self.send_response(data, content_type="application/json")