mirror of
https://github.com/snltty/linker.git
synced 2025-10-30 04:02:13 +08:00
28 lines
634 B
JavaScript
28 lines
634 B
JavaScript
import { injectGlobalData } from "@/views/provide";
|
|
|
|
export default {
|
|
pluginName: 'cmonitor.plugin.light.',
|
|
field() {
|
|
return {
|
|
Light: {
|
|
Value: 0
|
|
},
|
|
}
|
|
},
|
|
state: {
|
|
light: {
|
|
showLight: false,
|
|
showLightSingle: false,
|
|
devices: []
|
|
}
|
|
},
|
|
globalData: null,
|
|
init() {
|
|
this.globalData = injectGlobalData();
|
|
},
|
|
update(item, report) {
|
|
if (!report.Light) return;
|
|
item.Light.Value = Math.floor(+report.Light.Value);
|
|
if (isNaN(item.Light.Value)) item.Light.Value = 0;
|
|
}
|
|
} |