Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/components/widgets/runout-sensors/RunoutSensorsCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,16 @@ export default class RunoutSensorsCard extends Mixins(StateMixin) {
}

changeSensor (item: RunoutSensor, value: boolean) {
this.sendGcode(`SET_FILAMENT_SENSOR SENSOR=${encodeGcodeParamValue(item.name)} ENABLE=${+value}`)
const gcodes = [
`SET_FILAMENT_SENSOR SENSOR=${encodeGcodeParamValue(item.name)} ENABLE=${+value}`
]

if (item.name === 'hall_filament_width_sensor') {
// Older Klipper versions do not sync the runout state with the width sensor
gcodes.unshift(`${value ? 'ENABLE' : 'DISABLE'}_FILAMENT_WIDTH_SENSOR`)
}

this.sendGcode(gcodes.join('\n'))
}
}
</script>
Loading