Skip to content

Commit 55bcf69

Browse files
committed
feat: Kalico temperature override when mcu disconnected
Signed-off-by: Pedro Lamas <[email protected]>
1 parent a720aa2 commit 55bcf69

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/store/printer/getters.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,35 @@ export const getters = {
771771
const color = Vue.$colorset.next(getKlipperType(key), key)
772772
const config = state.printer.configfile.settings[key.toLowerCase()]
773773

774+
const mcu = (
775+
klippyApp.isKalico &&
776+
config != null &&
777+
(
778+
(
779+
'i2c_mcu' in config &&
780+
config.i2c_mcu
781+
) ||
782+
(
783+
'sensor_mcu' in config &&
784+
config.sensor_mcu
785+
) ||
786+
(
787+
'sensor_pin' in config &&
788+
config.sensor_pin?.includes(':') &&
789+
config.sensor_pin.split(':')[0]
790+
)
791+
)
792+
)
793+
794+
const kalicoTemperatureOverride = mcu && mcu !== 'mcu' && state.printer[`mcu ${mcu}`]?.non_critical_disconnected
795+
? {
796+
temperature: null
797+
}
798+
: null
799+
774800
groups[name] = {
775801
...state.printer[key],
802+
...kalicoTemperatureOverride,
776803
...getters.getExtraSensorData(config && 'sensor_type' in config && config.sensor_type?.toLowerCase(), name),
777804
config: { ...config },
778805
minTemp: config && 'min_temp' in config ? config.min_temp ?? null : null,

0 commit comments

Comments
 (0)