Add websocket wifi updates

This commit is contained in:
nemunaire 2026-01-01 17:42:53 +07:00
commit 1477d909b0
11 changed files with 755 additions and 10 deletions

View file

@ -53,6 +53,12 @@ func (a *App) Initialize(cfg *config.Config) error {
return err
}
// Start WiFi event monitoring
if err := wifi.StartEventMonitoring(); err != nil {
log.Printf("Warning: WiFi event monitoring failed: %v", err)
// Don't fail - polling fallback still works
}
// Start periodic tasks
go a.periodicStatusUpdate()
go a.periodicDeviceUpdate()
@ -71,6 +77,7 @@ func (a *App) Run(addr string) error {
// Shutdown gracefully shuts down the application
func (a *App) Shutdown() {
wifi.StopEventMonitoring()
wifi.Close()
logging.AddLog("Système", "Application arrêtée")
}