Add HomeKit QR code to WebUI #1138 by @mnakada

This commit is contained in:
Alex X
2025-11-18 20:55:17 +03:00
parent 290e8fcfda
commit 42e7a03534
7 changed files with 119 additions and 17 deletions
-8
View File
@@ -3,7 +3,6 @@ package hap
import (
"bufio"
"crypto/sha512"
"encoding/base64"
"errors"
"fmt"
"net/http"
@@ -36,13 +35,6 @@ func (s *Server) ServerPublic() []byte {
// return StatusPaired
//}
func (s *Server) SetupHash() string {
// should be setup_id (random 4 alphanum) + device_id (mac address)
// but device_id is random, so OK
b := sha512.Sum512([]byte(s.DeviceID))
return base64.StdEncoding.EncodeToString(b[:4])
}
func (s *Server) PairSetup(req *http.Request, rw *bufio.ReadWriter) (id string, publicKey []byte, err error) {
// STEP 1. Request from iPhone
var plainM1 struct {