Add custom category_id for HomeKit server #985 by @Minims

This commit is contained in:
Alex X
2025-11-18 20:52:32 +03:00
parent 6c78b5cb53
commit 290e8fcfda
2 changed files with 15 additions and 1 deletions
+13
View File
@@ -376,3 +376,16 @@ func calcDevicePrivate(private, seed string) []byte {
b := sha512.Sum512([]byte(seed))
return ed25519.NewKeyFromSeed(b[:ed25519.SeedSize])
}
func calcCategoryID(categoryID string) string {
switch categoryID {
case "bridge":
return hap.CategoryBridge
case "doorbell":
return hap.CategoryDoorbell
}
if core.Atoi(categoryID) > 0 {
return categoryID
}
return hap.CategoryCamera
}