Skip to content

Commit

Permalink
fix: printer settings must use lowercase key (#1582)
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <[email protected]>
  • Loading branch information
pedrolamas authored Feb 8, 2025
1 parent a30b00f commit 79a39ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/plugins/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const Rules = {
},

numberGreaterThanOrEqual (min: number) {
return (v: NullableOrEmpty<number>) => isNullOrEmpty(v) || v >= min || i18n.t('app.general.simple_form.error.min', { v })
return (v: NullableOrEmpty<number>) => isNullOrEmpty(v) || v >= min || i18n.t('app.general.simple_form.error.min', { min })
},

numberGreaterThanOrEqualOrZero (min: number) {
Expand Down
12 changes: 6 additions & 6 deletions src/store/printer/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export const getters: GetterTree<PrinterState, RootState> = {
name: key,
prettyName: Vue.$filters.prettyCase(key),
...state.printer[key],
config: state.printer.configfile.settings[key]
config: state.printer.configfile.settings[key.toLowerCase()]
}))

return mcus
Expand Down Expand Up @@ -370,7 +370,7 @@ export const getters: GetterTree<PrinterState, RootState> = {
// Returns an extruder by name.
getExtruderByName: (state) => (name: 'extruder' | `extruder${number}`) => {
const e = state.printer[name]
const c = state.printer.configfile.settings[name]
const c = state.printer.configfile.settings[name.toLowerCase()]

// If we can't find what we need..
if (!e || !c) return undefined
Expand Down Expand Up @@ -410,7 +410,7 @@ export const getters: GetterTree<PrinterState, RootState> = {
: item.split(' ', 2).pop() || ''

const e = state.printer[item]
const c = state.printer.configfile.settings[item]
const c = state.printer.configfile.settings[item.toLowerCase()]

steppers.push({
name,
Expand Down Expand Up @@ -484,7 +484,7 @@ export const getters: GetterTree<PrinterState, RootState> = {
'bltouch',
'smart_effector',
'probe'
]
] as const

for (const name of probeNames) {
const probeSettings = state.printer.configfile.settings[name]
Expand Down Expand Up @@ -515,7 +515,7 @@ export const getters: GetterTree<PrinterState, RootState> = {
heaters.forEach((e: string) => {
const heater = state.printer[e]
if (heater && Object.keys(heater).length > 0) {
const config = state.printer.configfile.settings[e]
const config = state.printer.configfile.settings[e.toLowerCase()]
// Some heater items may have a prefix determining type.
// Check for these and split as necessary.
const keys = [
Expand Down Expand Up @@ -696,7 +696,7 @@ export const getters: GetterTree<PrinterState, RootState> = {
? Vue.$colorset.next(getKlipperType(pin), pin)
: undefined

const config = state.printer.configfile.settings[pin]
const config = state.printer.configfile.settings[pin.toLowerCase()]

let output: Fan | Led | OutputPin = {
...state.printer[pin],
Expand Down

0 comments on commit 79a39ed

Please sign in to comment.