Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show filament sensor state even when the sensor is disabled #1656

Conversation

EiNSTeiN-
Copy link
Contributor

Description

This PR changes the FilamentSensor view so the filament state (detected or empty) is shown regardless of whether the sensor is enabled or disabled. I added the "disabled" state next to the presence state simply because I'm unaware of an alternative way to show both together, let me know if there is an existing pattern I can re-use here.

I sometimes disable my filament motion sensors but I would still like to see whether the sensor reports motion or not. This can be useful when debugging filament run-out issues, for example when the detection length is too short and the filament sensor keeps triggering but the print is actually going fine.

Mobile & Desktop Screenshots/Recordings

Screenshot from 2023-11-15 16-09-04

@EiNSTeiN- EiNSTeiN- force-pushed the filament-sensor-separate-disabled-state branch from 5fbf62d to 84b782e Compare November 15, 2023 21:35
@meteyou
Copy link
Member

meteyou commented Dec 3, 2023

@EiNSTeiN- are you sure that the status will be updated even if it is disabled? i'm not sure right now and would have to reproduce and test it. i think it was a problem back then why we didn't implement it.

@EiNSTeiN-
Copy link
Contributor Author

are you sure that the status will be updated even if it is disabled?

Yes I verified this happen, you can see in the screenshot too that the status is detected even though the sensor is disabled. The relevant code is linked below, you can see self.filament_present is always updated and self.sensor_enabled is checked 2 lines below and is only used to determine whether the runout gcode is executed or not.

https://github.com/Klipper3d/klipper/blob/795ce490a05b2ebae724cff634317f38bc38d721/klippy/extras/filament_switch_sensor.py#L65

What you may be remembering is the fact that the sensor status is not updated when the filament is not moving. But as long as the filament is moving, for instance whenever the printer is printing, then the internal status is updated regardless of whether the sensor is enabled or not.

Signed-off-by: Stefan Dej <meteyou@gmail.com>
Signed-off-by: Stefan Dej <meteyou@gmail.com>
Signed-off-by: Stefan Dej <meteyou@gmail.com>
Signed-off-by: Stefan Dej <meteyou@gmail.com>
Signed-off-by: Stefan Dej <meteyou@gmail.com>
Copy link
Contributor

github-actions bot commented Dec 8, 2023

Language file analysis report:

File Missing Keys Unused Keys
de.json 0 0
en.json 0 0
fr.json 2 1
nl.json 123 8

Signed-off-by: Stefan Dej <meteyou@gmail.com>
Copy link
Contributor

github-actions bot commented Dec 8, 2023

Language file analysis report:

File Missing Keys Unused Keys
de.json 0 0
en.json 0 0
fr.json 2 1
nl.json 123 8

@meteyou meteyou merged commit 9395a81 into mainsail-crew:develop Dec 8, 2023
10 checks passed
@meteyou
Copy link
Member

meteyou commented Dec 8, 2023

Thx for your PR! i only fixed some issues in this module (some older issues i found while reviewing it. not your fault). i also removed the disabled text, because it is already visible with the switch itself. and now the text "empty" is also colored. this was a bug of the old code (so my fault)

4rnoP pushed a commit to 4rnoP/mainsail that referenced this pull request Dec 13, 2023
4rnoP pushed a commit to 4rnoP/mainsail that referenced this pull request Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants