diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2023-12-16 14:31:32 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2023-12-26 11:47:21 -0500 |
commit | acde3720a4ee8caefacd39d39ea2e6d540e37453 (patch) | |
tree | cc5314123b436677786a272f9c1210cee2e52099 /klippy/extras/adxl345.py | |
parent | ffd44c02194ecabdd559cac1654aa9a65ecb2c28 (diff) | |
download | kutter-acde3720a4ee8caefacd39d39ea2e6d540e37453.tar.gz kutter-acde3720a4ee8caefacd39d39ea2e6d540e37453.tar.xz kutter-acde3720a4ee8caefacd39d39ea2e6d540e37453.zip |
bulk_sensor: New add_mux_endpoint() helper function in APIDumpHelper
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/adxl345.py')
-rw-r--r-- | klippy/extras/adxl345.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/klippy/extras/adxl345.py b/klippy/extras/adxl345.py index 6871ef53..d618598a 100644 --- a/klippy/extras/adxl345.py +++ b/klippy/extras/adxl345.py @@ -220,9 +220,9 @@ class ADXL345: self.api_dump = bulk_sensor.APIDumpHelper( self.printer, self._api_update, self._api_startstop, API_UPDATES) self.name = config.get_name().split()[-1] - wh = self.printer.lookup_object('webhooks') - wh.register_mux_endpoint("adxl345/dump_adxl345", "sensor", self.name, - self._handle_dump_adxl345) + hdr = ('time', 'x_acceleration', 'y_acceleration', 'z_acceleration') + self.api_dump.add_mux_endpoint("adxl345/dump_adxl345", "sensor", + self.name, {'header': hdr}) def _build_config(self): cmdqueue = self.spi.get_command_queue() self.query_adxl345_cmd = self.mcu.lookup_command( @@ -345,10 +345,6 @@ class ADXL345: self._start_measurements() else: self._finish_measurements() - def _handle_dump_adxl345(self, web_request): - self.api_dump.add_client(web_request) - hdr = ('time', 'x_acceleration', 'y_acceleration', 'z_acceleration') - web_request.send({'header': hdr}) def start_internal_client(self): cconn = self.api_dump.add_internal_client() return AccelQueryHelper(self.printer, cconn) |