diff --git a/src/components/panels/Miscellaneous/MoonrakerSensor.vue b/src/components/panels/Miscellaneous/MoonrakerSensor.vue
new file mode 100644
index 000000000..e0b919518
--- /dev/null
+++ b/src/components/panels/Miscellaneous/MoonrakerSensor.vue
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/panels/Miscellaneous/MoonrakerSensorValue.vue b/src/components/panels/Miscellaneous/MoonrakerSensorValue.vue
new file mode 100644
index 000000000..1ac9f31c2
--- /dev/null
+++ b/src/components/panels/Miscellaneous/MoonrakerSensorValue.vue
@@ -0,0 +1,92 @@
+
+
+ {{ symbol }}
+ {{ name }}:
+ {{ output }}
+
+
+
+
diff --git a/src/components/panels/MiscellaneousPanel.vue b/src/components/panels/MiscellaneousPanel.vue
index 9a671d075..976e4cf88 100644
--- a/src/components/panels/MiscellaneousPanel.vue
+++ b/src/components/panels/MiscellaneousPanel.vue
@@ -8,7 +8,7 @@
:collapsible="true"
card-class="miscellaneous-panel">
-
+
+ :multi="parseInt(object.scale)" />
-
+
-
+
+ :filament_detected="sensor.filament_detected" />
+
+
+
+
@@ -49,10 +53,11 @@ import BaseMixin from '@/components/mixins/base'
import MiscellaneousSlider from '@/components/inputs/MiscellaneousSlider.vue'
import MiscellaneousLight from '@/components/inputs/MiscellaneousLight.vue'
import FilamentSensor from '@/components/inputs/FilamentSensor.vue'
+import MoonrakerSensor from '@/components/panels/Miscellaneous/MoonrakerSensor.vue'
import Panel from '@/components/ui/Panel.vue'
import { mdiDipSwitch } from '@mdi/js'
@Component({
- components: { Panel, FilamentSensor, MiscellaneousSlider, MiscellaneousLight },
+ components: { Panel, FilamentSensor, MiscellaneousSlider, MiscellaneousLight, MoonrakerSensor },
})
export default class MiscellaneousPanel extends Mixins(BaseMixin) {
mdiDipSwitch = mdiDipSwitch
@@ -69,6 +74,10 @@ export default class MiscellaneousPanel extends Mixins(BaseMixin) {
return this.$store.getters['printer/getLights'] ?? []
}
+ get moonrakerSensors() {
+ return this.$store.getters['server/sensor/getSensors'] ?? []
+ }
+
get showMiscellaneousPanel() {
return (
this.klipperReadyForGui && (this.miscellaneous.length || this.filamentSensors.length || this.lights.length)
diff --git a/src/store/server/sensor/getters.ts b/src/store/server/sensor/getters.ts
index b0b84ee3c..10028f160 100644
--- a/src/store/server/sensor/getters.ts
+++ b/src/store/server/sensor/getters.ts
@@ -2,4 +2,8 @@ import { GetterTree } from 'vuex'
import { ServerSensorState } from '@/store/server/sensor/types'
// eslint-disable-next-line
-export const getters: GetterTree = {}
+export const getters: GetterTree = {
+ getSensors: (state) => {
+ return Object.keys(state.sensors)
+ },
+}
diff --git a/src/store/server/sensor/mutations.ts b/src/store/server/sensor/mutations.ts
index 5f4df98f4..2e9a7b841 100644
--- a/src/store/server/sensor/mutations.ts
+++ b/src/store/server/sensor/mutations.ts
@@ -13,6 +13,8 @@ export const mutations: MutationTree = {
},
updateSensor(state, payload) {
- Vue.set(state.sensors, payload.key, payload.value)
+ if (!(payload.key in state.sensors)) return
+
+ Vue.set(state.sensors[payload.key], 'values', payload.value)
},
}