summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-10-08 20:46:45 +0200
committerxengineering <me@xengineering.eu>2024-10-08 20:46:45 +0200
commit0dd945ae968e8d15e6adec71c5a598a39acf18dd (patch)
tree0648ac2981d495c33dd3ae2588c727f59f590b3c /main.go
parent5c1f2517a9ccabddc155b4ffb6eb82d3465d527b (diff)
downloadsoundbox-app-0dd945ae968e8d15e6adec71c5a598a39acf18dd.tar
soundbox-app-0dd945ae968e8d15e6adec71c5a598a39acf18dd.tar.zst
soundbox-app-0dd945ae968e8d15e6adec71c5a598a39acf18dd.zip
Add config option "enabled"
This allows to disable soundbox devices inside the configuration file. Thus the MAC address can be kept inside the config while the device does not have to be reachable during usage of the app. Later the GUI should be able to change this during runtime.
Diffstat (limited to 'main.go')
-rw-r--r--main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.go b/main.go
index 047769c..b6f4b83 100644
--- a/main.go
+++ b/main.go
@@ -109,7 +109,9 @@ func (ui *Ui) HandleInputs(gtx layout.Context) {
ui.State.PlayerContext, ui.State.PlayerCancel = context.WithCancel(context.Background())
var targets []net.HardwareAddr
for _, entry := range ui.State.Config.Soundboxes {
- targets = append(targets, net.HardwareAddr(entry.Mac))
+ if entry.Enabled {
+ targets = append(targets, net.HardwareAddr(entry.Mac))
+ }
}
go play(ui.State.PlayerContext, ui.State.UrlSelector.Value, targets, ui)
}