feature: add filament_motion_sensors
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
parent
576e0eaada
commit
1919aa6921
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-for="(runout, index) of this['printer/getFilamentSwitchSensors']" v-bind:key="index">
|
||||
<div v-for="(runout, index) of filamentSensors" v-bind:key="index">
|
||||
<v-card class="mt-6">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
@ -18,8 +18,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
@ -30,9 +28,9 @@
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'printer/getFilamentSwitchSensors'
|
||||
])
|
||||
filamentSensors() {
|
||||
return this.$store.getters["printer/getFilamentSensors"]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeSensor(runout) {
|
||||
|
@ -398,13 +398,14 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
getFilamentSwitchSensors: state => {
|
||||
getFilamentSensors: state => {
|
||||
const sensorObjectNames = ['filament_switch_sensor', 'filament_motion_sensor']
|
||||
let sensors = []
|
||||
|
||||
for (let [key, value] of Object.entries(state)) {
|
||||
let nameSplit = key.split(" ")
|
||||
|
||||
if (nameSplit[0] === "filament_switch_sensor") {
|
||||
if (sensorObjectNames.includes(nameSplit[0])) {
|
||||
sensors.push({
|
||||
name: nameSplit[1],
|
||||
enabled: value.enabled,
|
||||
|
Loading…
x
Reference in New Issue
Block a user