Fehlerkorrekturen und Erweiterungen

This commit is contained in:
Sven committed 2025-08-20 10:56:41 +02:00
1 parent b3d010b453
commit 52415e0759
18 files changed
+136 -128

No files matched your search

+1
View File
@@ -24,6 +24,7 @@ class Constants {
static const String messageTopicDisconnectClient = "disconnect_client";
static const String messageTopicRequestConnectionStatus = "request_connection_status";
static const String messageTopicCurrentConnectionStatus = "current_connection_status";
static const String messageTopicBWVEnabled = "bwv_enabled";
static const String messageShowPopup = "show_popup";
+5
View File
@@ -0,0 +1,5 @@
class BWVMessage {
final bool bwvEnabled;
BWVMessage({ required this.bwvEnabled});
}
+7 -4
View File
@@ -49,6 +49,7 @@ import 'package:uuid/uuid.dart';
import '../main.dart';
import '../model/session_status.dart';
import 'constants.dart';
import 'messages/bwv_message.dart';
import 'util.dart';
enum ConnectionStateEnum { notConnected, connected }
@@ -301,13 +302,10 @@ class MqttCore with ProducerMixin, ConsumerMixin {
Util.logInfo('subscribed to topic: $fromServerTopic');
// TODO MESSAGING
sendMessage(
routingKey: Constants.messageTopicConnectionStatusChanged,
payload: ConnectionStatus(status: ConnectionStatusEnum.connected),
);
//await MessageService().publish<ConnectionStatus>(Constants.messageTopicConnectionStatusChanged, arguments: ConnectionStatus(status: ConnectionStatusEnum.connected));
}
void _sessionMessageReceived(payloadData) async {
@@ -324,7 +322,12 @@ class MqttCore with ProducerMixin, ConsumerMixin {
await MyApp.isarInstance.sessionStatus.put(sessionStatusMessage);
});
Util.preferencesSaveBool(Constants.prefsBWVEnabled, sessionStatusMessage.bwvEnabled);
var bwvEnabled = sessionStatusMessage.bwvEnabled;
Util.preferencesSaveBool(Constants.prefsBWVEnabled, bwvEnabled);
sendMessage(
routingKey: Constants.messageTopicBWVEnabled,
payload: BWVMessage(bwvEnabled: bwvEnabled),
);
sendMessage(
routingKey: Constants.messageTopicSessionStatusInfoUpdate,