Initila commit
Build Docker image on push / docker (push) Successful in 22s

This commit is contained in:
2026-08-18 00:46:59 +02:00
commit 9db7aa2560
28 changed files with 2823 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
package application
import (
"context"
"os"
"path/filepath"
"testing"
)
func TestApplicationSupportsMultipleDevicesAndGracefulShutdown(t *testing.T) {
configPath := filepath.Join(t.TempDir(), "config.yaml")
config := []byte(`host: 127.0.0.1
port: 9090
logLevel: 4
shelly:
timeoutSeconds: 1
devices:
- name: office
product: plug_s
url: http://192.0.2.1
- name: kitchen
product: plug_s
url: http://192.0.2.2
`)
if err := os.WriteFile(configPath, config, 0o600); err != nil {
t.Fatal(err)
}
app, err := New(configPath)
if err != nil {
t.Fatalf("New() returned an unexpected error: %v", err)
}
app.server.Addr = "127.0.0.1:0"
ctx, cancel := context.WithCancel(context.Background())
cancel()
if err := app.Run(ctx); err != nil {
t.Fatalf("Run() returned an unexpected error: %v", err)
}
}