aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/lis2dw.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2023-12-17 00:15:55 -0500
committerKevin O'Connor <kevin@koconnor.net>2023-12-26 11:47:21 -0500
commitc716edafe291a3d32700becfb67cb1504cd6902b (patch)
tree35a3fe64f505406e4ab11b672a5724a0bcc1a16f /klippy/extras/lis2dw.py
parent337013459303a220e1c3552583676c35b4800dd0 (diff)
downloadkutter-c716edafe291a3d32700becfb67cb1504cd6902b.tar.gz
kutter-c716edafe291a3d32700becfb67cb1504cd6902b.tar.xz
kutter-c716edafe291a3d32700becfb67cb1504cd6902b.zip
bulk_sensor: Simplify the registration of internal clients in BatchBulkHelper
Previously, the BatchBulkHelper class was designed primarily to register webhook clients, and internal clients used a wrapper class that emulated a webhooks client. Change BatchBulkHelper to support regular internal callbacks, and introduce a new BatchWebhooksClient class that can translate these internal callback to webhooks client messages. This makes it easier to register internal clients that can process the bulk messages every batch interval. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/lis2dw.py')
-rw-r--r--klippy/extras/lis2dw.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/klippy/extras/lis2dw.py b/klippy/extras/lis2dw.py
index 739c3641..28591c21 100644
--- a/klippy/extras/lis2dw.py
+++ b/klippy/extras/lis2dw.py
@@ -97,8 +97,9 @@ class LIS2DW:
"(e.g. faulty wiring) or a faulty lis2dw chip." % (
reg, val, stored_val))
def start_internal_client(self):
- cconn = self.bulk_batch.add_internal_client()
- return adxl345.AccelQueryHelper(self.printer, cconn)
+ aqh = adxl345.AccelQueryHelper(self.printer)
+ self.batch_bulk.add_client(aqh.handle_batch)
+ return aqh
# Measurement decoding
def _extract_samples(self, raw_samples):
# Load variables to optimize inner loop below