aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2024-08-02 13:44:26 -0400
committerKevin O'Connor <kevin@koconnor.net>2024-08-14 22:17:10 -0400
commitd5e5a6da2defb357ac986fb2a79003a8e1dd738d (patch)
tree3f2ff7b99115b67fd2bef85326a553aaf338ebeb
parentc0edfbc4ea02d7d0fb5824a686b4376a05972266 (diff)
downloadkutter-d5e5a6da2defb357ac986fb2a79003a8e1dd738d.tar.gz
kutter-d5e5a6da2defb357ac986fb2a79003a8e1dd738d.tar.xz
kutter-d5e5a6da2defb357ac986fb2a79003a8e1dd738d.zip
hx71x: Update api header and docs to correctly note "value" field
Update both hx71x and ads1220 to reflect that there is a third "value" field in the reported data. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--docs/API_Server.md10
-rw-r--r--klippy/extras/ads1220.py4
-rw-r--r--klippy/extras/hx71x.py4
3 files changed, 10 insertions, 8 deletions
diff --git a/docs/API_Server.md b/docs/API_Server.md
index f29bbeba..3837f737 100644
--- a/docs/API_Server.md
+++ b/docs/API_Server.md
@@ -375,9 +375,10 @@ A request may look like:
`{"id": 123, "method":"hx71x/dump_hx71x",
"params": {"sensor": "load_cell", "response_template": {}}}`
and might return:
-`{"id": 123,"result":{"header":["time","counts"]}}`
+`{"id": 123,"result":{"header":["time","counts","value"]}}`
and might later produce asynchronous messages such as:
-`{"params":{"data":[[3292.432935, 562534], [3292.4394937, 5625322]]}}`
+`{"params":{"data":[[3292.432935, 562534, 0.067059278],
+[3292.4394937, 5625322, 0.670590639]]}}`
### ads1220/dump_ads1220
@@ -390,9 +391,10 @@ A request may look like:
`{"id": 123, "method":"ads1220/dump_ads1220",
"params": {"sensor": "load_cell", "response_template": {}}}`
and might return:
-`{"id": 123,"result":{"header":["time","counts"]}}`
+`{"id": 123,"result":{"header":["time","counts","value"]}}`
and might later produce asynchronous messages such as:
-`{"params":{"data":[[3292.432935, 562534], [3292.4394937, 5625322]]}}`
+`{"params":{"data":[[3292.432935, 562534, 0.067059278],
+[3292.4394937, 5625322, 0.670590639]]}}`
### pause_resume/cancel
diff --git a/klippy/extras/ads1220.py b/klippy/extras/ads1220.py
index fba74181..14d47581 100644
--- a/klippy/extras/ads1220.py
+++ b/klippy/extras/ads1220.py
@@ -69,9 +69,9 @@ class ADS1220():
self.printer, self._process_batch, self._start_measurements,
self._finish_measurements, UPDATE_INTERVAL)
# publish raw samples to the socket
+ hdr = {'header': ('time', 'counts', 'value')}
self.batch_bulk.add_mux_endpoint("ads1220/dump_ads1220", "sensor",
- self.name,
- {'header': ('time', 'counts')})
+ self.name, hdr)
# Command Configuration
mcu.add_config_cmd(
"config_ads1220 oid=%d spi_oid=%d data_ready_pin=%s"
diff --git a/klippy/extras/hx71x.py b/klippy/extras/hx71x.py
index 1b1128ac..85eff85f 100644
--- a/klippy/extras/hx71x.py
+++ b/klippy/extras/hx71x.py
@@ -53,8 +53,8 @@ class HX71xBase():
self._finish_measurements, UPDATE_INTERVAL)
# publish raw samples to the socket
dump_path = "%s/dump_%s" % (sensor_type, sensor_type)
- self.batch_bulk.add_mux_endpoint(dump_path, "sensor", self.name,
- {'header': ('time', 'counts')})
+ hdr = {'header': ('time', 'counts', 'value')}
+ self.batch_bulk.add_mux_endpoint(dump_path, "sensor", self.name, hdr)
# Command Configuration
self.query_hx71x_cmd = None
mcu.add_config_cmd(