Took 23 minutes
This commit is contained in:
2023-01-30 12:23:58 +01:00
parent 37396858dd
commit f2e629c01a
5 changed files with 29 additions and 9 deletions

View File

@ -160,7 +160,7 @@ router.ws('/', async (ws, req, next) => {
break;
}
case RequestType.CHECK: {
let conf = msg.data as {
let conf = msg.data.data as {
"led_enabled": boolean,
"remote_enabled": boolean,
"hotspot_enabled": boolean,
@ -171,7 +171,6 @@ router.ws('/', async (ws, req, next) => {
await SensorHelper.clearAllRawMeasurements();
let content: { success: boolean, msg: string } = {
success: true,
msg: "Prüfung erfolgreich."
@ -180,9 +179,16 @@ router.ws('/', async (ws, req, next) => {
// Check config
/// Check Proxy
if (conf["arduino_proxy_enabled"]) {
try {
await ArduinoProxy.disconnect();
} catch( e )
{
}
try {
await ArduinoProxy.connect();
} catch (e) {
log("Checkup failed");
content.success = false;
content.msg = "Bei der Kommunikation mit dem Arduino Proxy ist ein Fehler aufgetreten.<br>Technische Details: " + e;
return WebSocketHandler.answerRequest(msg.data["type"] as RequestType, content);
@ -259,6 +265,16 @@ router.ws('/', async (ws, req, next) => {
}
case RequestType.UPDATE: {
/*
- git pull
- yarn install
- yarn run compile
- (arduino update?)
- reboot
*/
}
}
break;
}