DRAFT: query for entry sensor status#18
DRAFT: query for entry sensor status#18LongLiveCHIEF wants to merge 14 commits intoAnnex-Engineering:wip-lane-entry-sensorsfrom
Conversation
…ead constructor is no longer compatible with older versions of Klipper anyway
swapped the positiion of the lane entry sensor status in the TR_QUERY_LANE_ENTRY_SENSORS
|
Since I'm new to Python, I wanted to get this out there in front of you as a draft while I wrap up some testing, so that you can give me any feedback you might have on my approach to the features you wanted for this. Hoping to do testing and validation of this tomorrow if all goes as planned. |
9be4fad to
73b9112
Compare
|
Thanks for working on this! This looks very good overall, but it looks like right now the To report the last state of the sensor instead, I think we'll need to add a "state" variable to the The document changes look good, I only have a few minor comments:
|
Yep, picked up on this last night when I finally got a chance to start actually testing the code.
I use M AIO as well... I will add a |
|
My inclination is to follow the existing convention. No reason to pollute the scope of this PR. |
I like this plan. I had been thinking along similar lines this morning before I checked for your feedback, so I think we're on the same page on all fronts. |
- Added extension recommendations for vscode - added .editorconfig to codify formatting support for most other editors I set the settings for the TOC to use `2..6`, which will cause all TOC create/updates to ignore the top level heading, and then will create an entry for H2 - H6. (cherry picked from commit 15101e8)
|
I'm looking over the functionality of the TradRackFilSensor. Am I right in seeing that since it is registered asa button, it acts as a sort of virtual pin, such that you can't directly read the digital signal of the registered pin, and have to trust in your callback logic to manage the pin state correctly? (klippy reference docs aren't great on the level of detail, and there's not even a lot of comments in module code, so I'm guessing each new module developer has to basically suss everything out on their own?) My first thought is to just import the |
|
disregard, I hadn't yet connected how the class was also making use of pins and endstops objects. |
I believe so. I couldn't really find documentation either so I looked at similar modules such as filament_switch_sensor. I figured for the lane entry sensors, we only really need to respond to state changes and we can store the last state internally if we need, so registering the pin as a button and just needing to write a callback function seemed convenient. The button callback also runs when klipper initially starts without the switch needing to change state, so we will always get the starting state (I tested this for Belay just to be sure since it relies on knowing the initial state). |
I've been doing a code deep dive on all the klippy modules, and yeah, Looks like all of an mcu's buttons get their own reactor thread, and they're all registered at once as non-iterrupts. During runtime, the "state" change callback execution is also asynchronous, so there isn't really a real-time digital read, but there is an available debouncing that does physical/virtual state tracking for you, so I'm wondering if the "active" state tracking implemented currently is redundant, and also if we needed to register the callback for these on the global reactor, since they're already on a reactor of their own when they're setup? |
n/m, we're using |
Adds gcode command
cmd_TR_QUERY_LANE_ENTRY_SENSORS, along with corresponding documentation updates.