Skip to content

fix: hall filament width sensor toggle - #1982

Merged
pedrolamas merged 1 commit into
fluidd-core:developfrom
pedrolamas:pedrolamas/hall-filament-width-sensor-toggle
Oct 12, 2026
Merged

pedrolamas merged 1 commit into
fluidd-core:developfrom
pedrolamas:pedrolamas/hall-filament-width-sensor-toggle

Conversation

@pedrolamas

Copy link
Copy Markdown
Member

Follow-up to #1981.

The switch for hall_filament_width_sensor in the Runout Sensors card only sent SET_FILAMENT_SENSOR, which toggles runout detection but never starts the width sensor itself. With Klipper's default enable: False the sensor stayed inactive, so nothing was measured.

The switch now sends ENABLE_FILAMENT_WIDTH_SENSOR / DISABLE_FILAMENT_WIDTH_SENSOR followed by SET_FILAMENT_SENSOR, in a single script. Klipper only started syncing the runout state with the width sensor state in April 2026, so sending both keeps them in step on older versions too. Other runout sensors are unchanged.

Lint and type-check pass. Not tested against a printer with this sensor.

Resolves #1781

Signed-off-by: Pedro Lamas pedrolamas@gmail.com

🤖 Generated with Claude Code

SET_FILAMENT_SENSOR only toggles runout detection, so also send
ENABLE/DISABLE_FILAMENT_WIDTH_SENSOR to start and stop the sensor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas pedrolamas added the FR - Enhancement New feature or request label Oct 12, 2026
@pedrolamas pedrolamas added this to the 1.37.7 milestone Oct 12, 2026
@pedrolamas
pedrolamas requested a balanced review from Copilot October 12, 2026 16:58
@github-actions

Copy link
Copy Markdown

Bundle size report (gzip)

Chunk Base Head Δ
assets/BeaconCard-*.js 4.3 kB 4.4 kB +64 B
assets/Dashboard-*.js 63.2 kB 63.2 kB +5 B
assets/index-*.js 161.9 kB 161.9 kB -5 B
assets/Console-*.js 370 B 366 B -4 B
assets/Configure-*.js 778 B 775 B -3 B
assets/History-*.js 3.8 kB 3.8 kB +3 B
assets/System-*.js 2.4 kB 2.4 kB -3 B
assets/Tune-*.js 3.4 kB 3.4 kB +3 B
assets/FullscreenCamera-*.js 424 B 426 B +2 B
assets/GcodePreview-*.js 366 B 368 B +2 B
assets/GcodePreviewCard-*.js 13.2 kB 13.2 kB -2 B
assets/Settings-*.js 23.3 kB 23.3 kB -2 B
sw.js 11.2 kB 11.2 kB -2 B
assets/AppColorPicker-*.js 13.0 kB 13.0 kB +1 B
assets/AppNamedSlider-*.js 1.7 kB 1.7 kB +1 B
assets/ConsoleCard-*.js 2.0 kB 2.0 kB +1 B
assets/Diagnostics-*.js 15.9 kB 15.9 kB +1 B
assets/FileSystem-*.js 31.9 kB 31.9 kB -1 B
assets/JobHistoryItemStatus-*.js 1.2 kB 1.2 kB +1 B
assets/Jobs-*.js 501 B 502 B +1 B
assets/MacroCategorySettings-*.js 2.0 kB 2.0 kB -1 B
Total 2.9 MB 2.9 MB +62 B

119 chunks compared, 21 changed. Sizes are gzip, matching what nginx serves.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is small, scoped to the hall width sensor, consistent with the getRunoutSensors naming and the existing multi-line sendGcode pattern, with no identified defects.

0 open findings

What changed in this PR

This PR is a follow-up to #1981 and fixes the enable/disable switch for [hall_filament_width_sensor] in the Runout Sensors card. Previously the switch only sent SET_FILAMENT_SENSOR, which toggles runout detection but never activates the width sensor itself (Klipper defaults the width sensor to enable: False), so the sensor measured nothing. The fix additionally sends ENABLE_FILAMENT_WIDTH_SENSOR / DISABLE_FILAMENT_WIDTH_SENSOR only for the hall width sensor, keeping runout and width-sensor state in step even on older Klipper versions that don't sync them automatically. Other runout sensors keep their existing behavior.

Changes:

  • Refactor changeSensor to build a list of G-code commands and send them as one \n-joined script.
  • For hall_filament_width_sensor, prepend ENABLE_FILAMENT_WIDTH_SENSOR/DISABLE_FILAMENT_WIDTH_SENSOR before SET_FILAMENT_SENSOR.
File Description
src/​components/​widgets/​runout-sensors/​RunoutSensorsCard.vue Sends the width-sensor enable/disable command alongside SET_FILAMENT_SENSOR for the hall width sensor so the sensor actually starts measuring.

Notes on correctness (no changes required):

  • The literal 'hall_filament_width_sensor' matches item.name: getRunoutSensors derives name from the last whitespace token of the printer key, and the hall sensor key has no space, so name is the full 'hall_filament_width_sensor' — consistent with the same literal used in the getter's filter (src/store/printer/getters.ts:522).
  • Multi-line scripts joined by \n are an established pattern: sendGcode forwards the raw string to SocketActions.printerGcodeScript, mirroring sendMoveGcode/sendExtrudeGcode (src/mixins/state.ts).
  • The unchanged first line (SET_FILAMENT_SENSOR …) comes from #1981 and is out of scope here.
  • No unit tests exist for components or printer getters in this repo, so this follows the existing (untested) convention.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@pedrolamas
pedrolamas merged commit 454586e into fluidd-core:develop Oct 12, 2026
6 checks passed
@pedrolamas
pedrolamas deleted the pedrolamas/hall-filament-width-sensor-toggle branch October 12, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FR - Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add [hall_filament_width_sensor] status & toggle to dashboard

2 participants