Documentation
¶
Overview ¶
Package device defines the basic requirements of a device
Index ¶
- func Create(d *Device) error
- type Action
- type Common
- type Device
- func (d *Device) Exists() bool
- func (d *Device) Feature(name string) feature.Feature
- func (d *Device) Id() string
- func (d *Device) Manufacturer() string
- func (d *Device) Model() string
- func (d *Device) Name() string
- func (d *Device) SerialNumber() string
- func (d *Device) SetFeature(f *feature.Info, b []byte)
- func (d *Device) SubscribeFeature(topic string) chan []byte
- func (d *Device) Type() string
- func (d *Device) UpdateFeature(f *feature.Info, b []byte)
- func (d *Device) UpdateInfo(info *Info) (updates []*InfoUpdate, err error)
- type Info
- type InfoUpdate
- type State
- type Transport
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Common ¶
type Common interface {
// Id will return the unique id of the device.
// This is currently always the same as the topic name.
Id() string
// Name returns the name of the device
Name() string
// Manufacturer returns the manufacturer
Manufacturer() string
// Model returns the model name/number
Model() string
// SerialNumber returns the serial number
SerialNumber() string
// Type returns the type of the device (lightbulb, outlet, etc)
Type() string
}
Device contains the common functions for Client and Server
type Device ¶
func (*Device) Manufacturer ¶
func (*Device) SerialNumber ¶
func (*Device) SubscribeFeature ¶
func (*Device) UpdateInfo ¶
func (d *Device) UpdateInfo(info *Info) (updates []*InfoUpdate, err error)
type Info ¶
type Info struct {
Topic string `json:"topic"`
Name string `json:"name"`
Manufacturer string `json:"manufacturer"`
Model string `json:"model"`
SerialNumber string `json:"serialNumber"`
Type string `json:"type"`
LastWillID string `json:"lastWillID,omitempty"`
Features map[string]*feature.Info `json:"feature"`
Reachable bool `json:"-"`
}
type InfoUpdate ¶
type InfoUpdate struct {
Field string
Old string
New string
FeatureInfo []*feature.InfoUpdate
}
type Type ¶
type Type string
Type is the type of device
const ( AccessoryInformation Type = "accessoryInformation" AirPurifier Type = "airPurifier" AirQualitySensor Type = "airQualitySensor" BatteryService Type = "batteryService" BridgeConfiguration Type = "bridgeConfiguration" BridgingState Type = "bridgingState" CameraControl Type = "cameraControl" CameraRTPStreamManagement Type = "cameraRTPStreamManagement" CarbonDioxideSensor Type = "carbonDioxideSensor" CarbonMonoxideSensor Type = "carbonMonoxideSensor" ContactSensor Type = "contactSensor" Door Type = "door" Doorbell Type = "doorbell" Fan Type = "fan" FanV2 Type = "fanV2" Faucet Type = "faucet" FilterMaintenance Type = "filterMaintenance" GarageDoorOpener Type = "garageDoorOpener" HeaterCooler Type = "heaterCooler" HumidifierDehumidifier Type = "humidifierDehumidifier" HumiditySensor Type = "humiditySensor" IrrigationSystem Type = "irrigationSystem" LeakSensor Type = "leakSensor" LightSensor Type = "lightSensor" Lightbulb Type = "lightbulb" LockManagement Type = "lockManagement" LockMechanism Type = "lockMechanism" Microphone Type = "microphone" MotionSensor Type = "motionSensor" OccupancySensor Type = "occupancySensor" Outlet Type = "outlet" SecuritySystem Type = "securitySystem" ServiceLabel Type = "serviceLabel" Slat Type = "slat" SmokeSensor Type = "smokeSensor" Speaker Type = "speaker" StatefulProgrammableSwitch Type = "statefulProgrammableSwitch" StatelessProgrammableSwitch Type = "statelessProgrammableSwitch" Switch Type = "switch" TemperatureSensor Type = "temperatureSensor" Thermostat Type = "thermostat" TimeInformation Type = "timeInformation" TunneledBTLEAccessoryService Type = "tunneledBTLEAccessoryService" Valve Type = "valve" Window Type = "window" WindowCovering Type = "windowCovering" )
All supported device types
Click to show internal directories.
Click to hide internal directories.