Moves the MQTT types to models

This commit is contained in:
Rune Harlyk
2024-04-23 21:59:19 +02:00
committed by Rune Harlyk
parent 0abe0b530c
commit 48e96d5775
2 changed files with 18 additions and 17 deletions
+17
View File
@@ -20,3 +20,20 @@ export type LogData = {
};
export type WebSocketJsonMsg = AnglesData | LogData;
export type MQTTStatus = {
enabled: boolean;
connected: boolean;
client_id: string;
last_error: string;
};
export type MQTTSettings = {
enabled: boolean;
uri: string;
username: string;
password: string;
client_id: string;
keep_alive: number;
clean_session: boolean;
};
+1 -17
View File
@@ -11,23 +11,7 @@
import Collapsible from '$lib/components/Collapsible.svelte';
import MQTT from '~icons/tabler/topology-star-3';
import Client from '~icons/tabler/robot';
type MQTTStatus = {
enabled: boolean;
connected: boolean;
client_id: string;
last_error: string;
};
type MQTTSettings = {
enabled: boolean;
uri: string;
username: string;
password: string;
client_id: string;
keep_alive: number;
clean_session: boolean;
};
import type { MQTTSettings, MQTTStatus } from '$lib/models';
let mqttSettings: MQTTSettings;
let mqttStatus: MQTTStatus;