initial commit

This commit is contained in:
2023-04-04 23:18:00 +02:00
commit 29713fdad4
14 changed files with 501 additions and 0 deletions

36
companion/index.js Normal file
View File

@@ -0,0 +1,36 @@
import * as messaging from "messaging";
import { settingsStorage } from "settings";
//console.log("Companion Started");
messaging.peerSocket.onopen = () => {
};
messaging.peerSocket.close = () => {
};
settingsStorage.onchange = evt => {
let data = {}
switch(evt.key) {
case 'progresscolor':
data = {
key: evt.key,
newValue: JSON.parse(evt.newValue).values[0].value
};
break;
default:
data = {
key: evt.key,
newValue: evt.newValue
};
break;
}
sendVal(data);
};
function sendVal(data) {
if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN) {
messaging.peerSocket.send(data);
}
}