Skip to content

Commit

Permalink
Merge pull request #632 from skrashevich/230911-fix-hap-pairing-dups
Browse files Browse the repository at this point in the history
Fix: duplicate pairing strings in config
  • Loading branch information
AlexxIT authored Oct 11, 2023
2 parents 09f1553 + 9368a6b commit d016529
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/homekit/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@ func (s *server) AddPair(conn net.Conn, id string, public []byte, permissions by
"client_public": []string{hex.EncodeToString(public)},
"permissions": []string{string('0' + permissions)},
}
s.pairings = append(s.pairings, query.Encode())
s.UpdateStatus()
s.PatchConfig()
if s.GetPair(conn, id) == nil {
s.pairings = append(s.pairings, query.Encode())
s.UpdateStatus()
s.PatchConfig()
}
}

func (s *server) DelPair(conn net.Conn, id string) {
Expand Down

0 comments on commit d016529

Please sign in to comment.