felixchenier / NextWheel

Apache License 2.0
0 stars 0 forks source link

Python module's REST API should return "return codes" in dicts #10

Closed felixchenier closed 12 months ago

felixchenier commented 12 months ago
>>> nw.start_recording()

<Response [200]>

It would be more helpful that the REST API returns a json string after each request, so that the Python module returns its decoded dict. I think that functions that do not explicitly return something could return the full state of the wheel systematically, e.g.:

>>> nw.start_recording()

{
    "streaming": True,
    "recording": True,
    "adc_sample_rate": 2000,
    "etc."
}
felixchenier commented 12 months ago

Nevermind, I just have to do .content.decode() and json.loads().