💫 Initial plans for device configuration service

This commit is contained in:
Rune Harlyk
2024-05-30 22:10:11 +02:00
committed by Rune Harlyk
parent 83a9007b51
commit d1567fa2dd
17 changed files with 15236 additions and 14556 deletions
+1 -14
View File
@@ -40,10 +40,6 @@
socket.on('close', handleClose);
socket.on('error', handleError);
socket.on('rssi', handleNetworkStatus);
socket.on('infoToast', handleInfoToast);
socket.on('successToast', handleSuccessToast);
socket.on('warningToast', handleWarningToast);
socket.on('errorToast', handleErrorToast);
socket.on('mode', (data:ModesEnum) => mode.set(data));
socket.on('angles', (angles:number[]) => { if (angles.length) servoAngles.set(angles)});
if ($page.data.features.analytics) socket.on('analytics', handleAnalytics);
@@ -56,10 +52,6 @@
socket.off('open', handleOpen);
socket.off('close', handleClose);
socket.off('rssi', handleNetworkStatus);
socket.off('infoToast', handleInfoToast);
socket.off('successToast', handleSuccessToast);
socket.off('warningToast', handleWarningToast);
socket.off('errorToast', handleErrorToast);
socket.off('battery', handleBattery);
socket.off('otastatus', handleOAT);
};
@@ -83,12 +75,7 @@
const handleError = (data: any) => console.error(data);
const handleInfoToast = (data: string) => notifications.info(data, 5000);
const handleWarningToast = (data: string) => notifications.warning(data, 5000);
const handleErrorToast = (data: string) => notifications.error(data, 5000);
const handleSuccessToast = (data: string) => notifications.success(data, 5000);
const handleAnalytics = (data: Analytics) => analytics.addData(data);
const handleAnalytics = (data: Analytics) => analytics.addData(data);
const handleNetworkStatus = (data: number) => telemetry.setRSSI(data);