import "code.pfad.fr/gohmekit/hapip/characteristic/service/accessory"
type Basic struct {
// required
Identify func(bool) error
// required
Manufacturer, Model, Name, SerialNumber, FirmwareRevision string
// optional
HardwareRevision string
AccessoryFlags *characteristic.Updatable[uint32]
// HAPProtocolVersion will be added as "HAP Protocol Information" service to the services if not empty
HAPProtocolVersion string
// Additional services provided by this accessory
AdditionalServices []hapip.Service
}
Basic implements a basic accessory.
func (i Basic) Service() characteristic.Service
func (i Basic) WithResourceHandler(handler func(rw http.ResponseWriter, typ string, width, height int) error) WithResource
type WithResource struct {
Basic
ResourceHandler func(rw http.ResponseWriter, typ string, width, height int) error
}
WithResource implements an accessory with a /resource handler.
func (i WithResource) Resource(rw http.ResponseWriter, typ string, width, height int) error