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 int64 `json:"aid"` Services []*service.Service `json:"services"` Type AccessoryType `json:"-"` Info *service.AccessoryInformation `json:"-"` // contains filtered or unexported fields }
Accessory implements the model.Accessory interface and contains the data structures to communicate with HomeKit.
An accessory in consists of services, which consists of 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 int
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 TypeIPCamera AccessoryType = 17 TypeVideoDoorbell AccessoryType = 18 TypeAirPurifier AccessoryType = 19 TypeHeater AccessoryType = 20 TypeAirConditioner AccessoryType = 21 TypeHumidifier AccessoryType = 22 TypeDehumidifier AccessoryType = 23 TypeSprinklers AccessoryType = 28 TypeFaucets AccessoryType = 29 TypeShowerSystems AccessoryType = 30 )
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 withing 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 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.