Documentation ¶
Overview ¶
THIS FILE IS AUTO-GENERATED
Package accessory implements the HomeKit accessories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accessory ¶
type Accessory struct { ID uint64 `json:"aid"` Services []*service.Service `json:"services"` Type AccessoryType `json:"-"` Info *service.AccessoryInformation `json:"-"` // contains filtered or unexported fields }
Accessory is a HomeKit accessory.
An accessory contains services, which themselves contain characteristics. Every accessory has the "accessory info" service by default which consists of characteristics to identify the accessory: name, model, manufacturer,...
func New ¶
func New(info Info, typ AccessoryType) *Accessory
New returns an accessory which implements model.Accessory.
func (*Accessory) AddService ¶
Adds a service to the accessory and updates the ids of the service and the corresponding characteristics
func (*Accessory) Equal ¶
Equal returns true when receiver has the same services and id as the argument.
func (*Accessory) GetServices ¶
func (*Accessory) OnIdentify ¶
func (a *Accessory) OnIdentify(fn func())
type AccessoryType ¶
type AccessoryType uint8
const ( TypeUnknown AccessoryType = 0 TypeOther AccessoryType = 1 TypeBridge AccessoryType = 2 TypeFan AccessoryType = 3 TypeGarageDoorOpener AccessoryType = 4 TypeLightbulb AccessoryType = 5 TypeDoorLock AccessoryType = 6 TypeOutlet AccessoryType = 7 TypeSwitch AccessoryType = 8 TypeThermostat AccessoryType = 9 TypeSensor AccessoryType = 10 TypeSecuritySystem AccessoryType = 11 TypeDoor AccessoryType = 12 TypeWindow AccessoryType = 13 TypeWindowCovering AccessoryType = 14 TypeProgrammableSwitch AccessoryType = 15 TypeRangeExtender AccessoryType = 16 TypeIPCamera AccessoryType = 17 TypeVideoDoorbell AccessoryType = 18 TypeAirPurifier AccessoryType = 19 TypeHeater AccessoryType = 20 TypeAirConditioner AccessoryType = 21 TypeHumidifier AccessoryType = 22 TypeDehumidifier AccessoryType = 23 TypeAppleTV AccessoryType = 24 TypeSpeaker AccessoryType = 26 TypeAirport AccessoryType = 27 TypeSprinklers AccessoryType = 28 TypeFaucets AccessoryType = 29 TypeShowerSystems AccessoryType = 30 TypeTelevision AccessoryType = 31 TypeRemoteControl AccessoryType = 32 TypeWiFiRouter AccessoryType = 33 TypeAudioReceiver AccessoryType = 34 TypeTVSetTopBox AccessoryType = 35 TypeTVStick AccessoryType = 36 )
type Camera ¶ added in v1.1.0
type Camera struct { *Accessory Control *service.CameraControl StreamManagement1 *service.CameraRTPStreamManagement StreamManagement2 *service.CameraRTPStreamManagement }
Camera provides RTP video streaming.
type ColoredLightbulb ¶ added in v1.2.1
type ColoredLightbulb struct { *Accessory Lightbulb *service.ColoredLightbulb }
func NewColoredLightbulb ¶ added in v1.2.1
func NewColoredLightbulb(info Info) *ColoredLightbulb
NewLightbulb returns an light bulb accessory which one light bulb service.
type Container ¶
type Container struct { Accessories []*Accessory `json:"accessories"` // contains filtered or unexported fields }
Container manages a list of accessories.
func (*Container) AccessoryType ¶
func (m *Container) AccessoryType() AccessoryType
AccessoryType returns the accessory type identifier for the accessories inside the container.
func (*Container) AddAccessory ¶
AddAccessory adds an accessory to the container. This method ensures that the accessory ids are valid and unique within the container.
func (*Container) ContentHash ¶
ContentHash returns a hash of the content (ignoring the value field).
func (*Container) Equal ¶
Equal returns true when receiver has the same accessories as the argument.
func (*Container) RemoveAccessory ¶
RemoveAccessory removes an accessory from the container.
type Lightbulb ¶
func NewLightbulb ¶
NewLightbulb returns an light bulb accessory which one light bulb service.
type Television ¶
type Television struct { *Accessory Television *service.Television Speaker *service.Speaker }
func NewTelevision ¶
func NewTelevision(info Info) *Television
NewTelevision returns a television accessory.
type Thermometer ¶
type Thermometer struct { *Accessory TempSensor *service.TemperatureSensor }
func NewTemperatureSensor ¶
func NewTemperatureSensor(info Info, temp, min, max, steps float64) *Thermometer
NewTemperatureSensor returns a Thermometer which implements model.Thermometer.
type Thermostat ¶
type Thermostat struct { *Accessory Thermostat *service.Thermostat }
func NewThermostat ¶
func NewThermostat(info Info, temp, min, max, steps float64) *Thermostat
NewThermostat returns a Thermostat which implements model.Thermostat.