Skip to content

Commit

Permalink
feat: use correct stepper temperature label (fluidd-core#1425)
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <[email protected]>
  • Loading branch information
pedrolamas authored Apr 30, 2024
1 parent 3ee7575 commit 9e05ef4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ app:
edit_category: Edit category
add_category: Add category
file_time: File
stepper_driver: >-
%{name} Driver
msg:
password_changed: Password changed
wrong_password: Oops, something went wrong. Is your password correct?
Expand Down
13 changes: 12 additions & 1 deletion src/store/printer/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,14 +689,25 @@ export const getters: GetterTree<PrinterState, RootState> = {
'tmc2240',
'z_thermal_adjust'
]
const supportedDrivers = [
'tmc2240'
]

const sensors = Object.keys(state.printer)
.reduce((groups, item) => {
const [type, nameFromSplit] = item.split(' ', 2)

if (supportedSensors.includes(type)) {
const name = nameFromSplit ?? item
const prettyName = Vue.$filters.startCase(name)
const prettyName = supportedDrivers.includes(type)
? i18n.t('app.general.label.stepper_driver',
{
name:
name.startsWith('stepper_')
? name.substring(8).toUpperCase()
: Vue.$filters.startCase(name)
})
: Vue.$filters.startCase(name)
const color = Vue.$colorset.next(getKlipperType(item), item)
const config = getters.getPrinterSettings(item)

Expand Down

0 comments on commit 9e05ef4

Please sign in to comment.