accessory

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Basic added in v0.1.1

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 (Basic) Service added in v0.1.1

func (i Basic) Service() characteristic.Service

func (Basic) Services added in v0.1.1

func (i Basic) Services() []hapip.Service

func (Basic) WithResourceHandler added in v0.1.1

func (i Basic) WithResourceHandler(handler func(rw http.ResponseWriter, typ string, width, height int) error) WithResource

type WithResource added in v0.1.1

type WithResource struct {
	Basic

	ResourceHandler func(rw http.ResponseWriter, typ string, width, height int) error
}

WithResource implements an accessory with a /resource handler.

func (WithResource) Resource added in v0.1.1

func (i WithResource) Resource(rw http.ResponseWriter, typ string, width, height int) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL