feat(homekit): add Speaker service and enhance Consumer with backtrack audio handling

This commit is contained in:
Sergey Krashevich
2026-03-06 09:07:26 +03:00
parent 78ef8fc064
commit 593dce6eb9
2 changed files with 46 additions and 0 deletions
+17
View File
@@ -13,6 +13,7 @@ func NewAccessory(manuf, model, name, serial, firmware string) *hap.Accessory {
ServiceCameraRTPStreamManagement(),
//hap.ServiceHAPProtocolInformation(),
ServiceMicrophone(),
ServiceSpeaker(),
},
}
acc.InitIID()
@@ -32,6 +33,7 @@ func NewHKSVAccessory(manuf, model, name, serial, firmware string) *hap.Accessor
hap.ServiceAccessoryInformation(manuf, model, name, serial, firmware),
rtpStream,
ServiceMicrophone(),
ServiceSpeaker(),
motionSensor,
operatingMode,
recordingMgmt,
@@ -60,6 +62,7 @@ func NewHKSVDoorbellAccessory(manuf, model, name, serial, firmware string) *hap.
hap.ServiceAccessoryInformation(manuf, model, name, serial, firmware),
rtpStream,
ServiceMicrophone(),
ServiceSpeaker(),
motionSensor,
operatingMode,
recordingMgmt,
@@ -75,6 +78,20 @@ func NewHKSVDoorbellAccessory(manuf, model, name, serial, firmware string) *hap.
return acc
}
func ServiceSpeaker() *hap.Service {
return &hap.Service{
Type: "113", // 'Speaker'
Characters: []*hap.Character{
{
Type: "11A",
Format: hap.FormatBool,
Value: 0,
Perms: hap.EVPRPW,
},
},
}
}
func ServiceMicrophone() *hap.Service {
return &hap.Service{
Type: "112", // 'Microphone'