Fix YAML patch in some cases #1626

This commit is contained in:
Alex X
2025-03-07 21:44:23 +03:00
parent 39c14e6556
commit a15deedf0d
6 changed files with 237 additions and 248 deletions

View File

@@ -222,7 +222,7 @@ func (s *server) DelPair(conn net.Conn, id string) {
}
func (s *server) PatchConfig() {
if err := app.PatchConfig("pairings", s.pairings, "homekit", s.stream); err != nil {
if err := app.PatchConfig([]string{"homekit", s.stream, "pairings"}, s.pairings); err != nil {
log.Error().Err(err).Msgf(
"[homekit] can't save %s pairings=%v", s.stream, s.pairings,
)