refactoring

This commit is contained in:
Jakob Gegeniger committed 2026-09-09 00:43:01 +02:00
1 parent eb1c84cf05
commit 92423c52de
8 files changed
+655 -57

No files matched your search

+11 -11
View File
@@ -8,12 +8,12 @@ class MqttChannel {
: Config(cfg),
IoStat(ioStat),
Logger(log),
runTopic(cfg.getStationPath() + "run"),
cfgTopic(cfg.getStationPath() + "cfg"),
verTopic(cfg.getStationPath() + "ver"),
eventTopic(cfg.getStationPath() + "event"),
statTopic(cfg.getStationPath() + "stat"),
resetTopic(cfg.getStationPath() + "reset"),
runTopic(cfg.StationPath + "run"),
cfgTopic(cfg.StationPath + "cfg"),
verTopic(cfg.StationPath + "ver"),
eventTopic(cfg.StationPath + "event"),
statTopic(cfg.StationPath + "stat"),
resetTopic(cfg.StationPath + "reset"),
gameCommands({
{"gameStarted", GameModeCommands_e::GameStarted},
@@ -36,9 +36,9 @@ class MqttChannel {
}),
subTopics{{runTopic, cfgTopic, resetTopic}},
client("Sword",
cfg.getBrockerUrl(),
cfg.BrockerUrl,
subTopics,
{cfg.getMqttUser(), cfg.getMqttPassword()}) {
{cfg.MqttUser, cfg.MqttPassword}) {
fmt::println("MQTT: Starting task:");
mqttCall = [this](string topic, string payload) {
if (topic == resetTopic ||
@@ -134,13 +134,13 @@ class MqttChannel {
instance.IoStat.SwordLatch.moveOut();
} break;
case ServiceCommands_e::PlaySoundPromo: {
MediaPlayer::playWavFile(instance.Config.getSoundPromo());
MediaPlayer::playWavFile(instance.Config.SoundPromo);
} break;
case ServiceCommands_e::PlaySoundDeny: {
MediaPlayer::playWavFile(instance.Config.getSoundDeny());
MediaPlayer::playWavFile(instance.Config.SoundDeny);
} break;
case ServiceCommands_e::PlaySoundChosen: {
MediaPlayer::playWavFile(instance.Config.getSoundAllow());
MediaPlayer::playWavFile(instance.Config.SoundAllow);
} break;
}
}