create a custom service with UUID
freedreamer82 opened this issue · 2 comments
freedreamer82 commented
is possible to create a custom service setting the UUID ?
M.
brutella commented
Yes, you can do that by using a custom characteristic/service type. If you just want to associated a uuid with an accessory, you can just use a custom characteristic like this.
func NewUUID(value string) *characteristic.C {
uuid := characteristic.NewString(CharacteristicTypeUUID)
uuid.Permissions = []string{characteristic.PermissionRead, characteristic.PermissionHidden}
uuid.Description = "ID"
uuid.SetValue(value)
return uuid.C
}
uuid := NewUUID("1234")
a := accessory.New(accessory.Info{...}, accessory.TypeOutlet)
a.Info.AddC(uuid)
freedreamer82 commented
thanks,
great work!
M.