diff --git a/README.md b/README.md index 504ac3f..6609822 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,25 @@ The CLI will exit with 0 if a burner is found, 1 otherwise. python -m pyduro -b -s -p status ``` -This will output a list of burner parameters and their values. +The result will be output as a JSON object that you can then manipulate with +`jq` for example. + +The CLI will exit with the return code return by the burner (0 = success, >0 = +error). + +**Examples** + +```bash +python -m pyduro -b 192.168.1.250 -s 1234 -p 12345678 status + +> { +> "boiler_temp": "14.9", +> "boiler_ref": "20.0", +> "content": "-2038", +> "dhw_temp": "13.6", +> "dhw_ref": "0.0", +> [...] +> } ### Get information from a burner diff --git a/src/pyduro/__main__.py b/src/pyduro/__main__.py index 9d4c69e..9779dd8 100755 --- a/src/pyduro/__main__.py +++ b/src/pyduro/__main__.py @@ -132,11 +132,11 @@ def main(): if response: if args.action == "status": status = response.parse_payload().split(",") - i=0 + i = 0 for key in STATUS_PARAMS: - STATUS_PARAMS[key]=status[i] - i+=1 - print(str(STATUS_PARAMS)) + STATUS_PARAMS[key] = status[i] + i += 1 + print(json.dumps(STATUS_PARAMS)) elif args.action == "get": print(json.dumps(response.parse_payload(), sort_keys=True, indent=2)) else: