From c716edafe291a3d32700becfb67cb1504cd6902b Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 17 Dec 2023 00:15:55 -0500 Subject: 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 --- klippy/extras/lis2dw.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'klippy/extras/lis2dw.py') 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 -- cgit v1.2.3-70-g09d2