Don't start HAP server without any devices

This ensures that when iOS reconnects, it doesn't find an empty server
and thinks all the devices have been removed, and removes them all
locally.
This commit is contained in:
Darell Tan
2024-11-22 04:01:07 +08:00
parent e678f2a31d
commit 4d51380873
2 changed files with 9 additions and 0 deletions

View File

@@ -123,6 +123,10 @@ func main() {
}()
br.WaitConfigured()
if br.NumDevices() == 0 {
log.Println("No devices added to bridge. Refusing to start.")
return
}
log.Println("hapz2m configured. starting HAP server...")