Documentation ¶
Index ¶
- Constants
- Variables
- type Bridge
- func (b *Bridge) CheckForUpdate() error
- func (b *Bridge) Config() (Config, error)
- func (b *Bridge) CreateSensor(sensor *Sensor) error
- func (b *Bridge) DeleteLight(id string) error
- func (b *Bridge) DeleteSensor(id string) error
- func (b *Bridge) Description() (BridgeDescription, error)
- func (b *Bridge) FinishUpdate() error
- func (b *Bridge) ID() string
- func (b *Bridge) InitIP(bridgeIP string) error
- func (b *Bridge) InitURL(validateURL *url.URL) error
- func (b *Bridge) IsUpdating() bool
- func (b *Bridge) Light(id string) (Light, error)
- func (b *Bridge) Lights() ([]Light, error)
- func (b *Bridge) NewLights() ([]NewLight, error)
- func (b *Bridge) NewSensors() ([]NewSensor, error)
- func (b *Bridge) Pair(appName string, identifier string) error
- func (b *Bridge) SearchForNewLights() error
- func (b *Bridge) SearchForNewSensors() error
- func (b *Bridge) Sensor(id string) (Sensor, error)
- func (b *Bridge) Sensors() ([]Sensor, error)
- func (b *Bridge) SetConfig(args *ConfigArg) error
- func (b *Bridge) SetLight(id string, args *LightArg) error
- func (b *Bridge) SetLightState(id string, args *LightStateArg) error
- func (b *Bridge) SetSensor(id string, args *SensorArg) error
- func (b *Bridge) SetSensorConfig(id string, args *SensorConfigArg) error
- func (b *Bridge) SetSensorState(id string, args *SensorStateArg) error
- func (b *Bridge) StartUpdate() error
- type BridgeDescription
- type Config
- type ConfigArg
- func (c *ConfigArg) DHCP() bool
- func (c *ConfigArg) Errors() map[string]ResponseError
- func (c *ConfigArg) Name() string
- func (c *ConfigArg) ProxyAddress() string
- func (c *ConfigArg) ProxyPort() uint16
- func (c *ConfigArg) Reset()
- func (c *ConfigArg) SetDHCP()
- func (c *ConfigArg) SetName(name string)
- func (c *ConfigArg) SetProxyAddress(address string)
- func (c *ConfigArg) SetProxyPort(port uint16)
- func (c *ConfigArg) SetStaticAddress(addr string, netmask string, gateway string)
- func (c *ConfigArg) SetTouchLink()
- func (c *ConfigArg) StaticAddress() (string, string, string)
- type Device
- type HSB
- type Icon
- type Light
- type LightArg
- type LightState
- type LightStateArg
- func (l *LightStateArg) Alert() string
- func (l *LightStateArg) Brightness() uint8
- func (l *LightStateArg) ColourTemperature() uint16
- func (l *LightStateArg) Effect() string
- func (l *LightStateArg) Errors() map[string]ResponseError
- func (l *LightStateArg) Hue() uint16
- func (l *LightStateArg) IsOn() bool
- func (l *LightStateArg) RGB(lightModel string) RGB
- func (l *LightStateArg) Reset()
- func (l *LightStateArg) Saturation() uint8
- func (l *LightStateArg) SetAlert(alert string)
- func (l *LightStateArg) SetBrightness(brightness uint8)
- func (l *LightStateArg) SetColourTemperature(ct uint16)
- func (l *LightStateArg) SetEffect(effect string)
- func (l *LightStateArg) SetHue(hue uint16)
- func (l *LightStateArg) SetIsOn(isOn bool)
- func (l *LightStateArg) SetRGB(rgb RGB, lightModel string)
- func (l *LightStateArg) SetSaturation(saturation uint8)
- func (l *LightStateArg) SetTransitionTime(tt uint16)
- func (l *LightStateArg) SetXY(xy XY)
- func (l *LightStateArg) TransitionTime() uint16
- func (l *LightStateArg) XY() XY
- type Locator
- type NewLight
- type NewSensor
- type RGB
- type ResponseError
- type Sensor
- type SensorArg
- type SensorConfig
- type SensorConfigArg
- func (s *SensorConfigArg) Alert() string
- func (s *SensorConfigArg) BatteryLevel() uint8
- func (s *SensorConfigArg) DarkThreshold() uint16
- func (s *SensorConfigArg) DarkThresholdOffset() uint16
- func (s *SensorConfigArg) Errors() map[string]ResponseError
- func (s *SensorConfigArg) IsOn() bool
- func (s *SensorConfigArg) IsReachable() bool
- func (s *SensorConfigArg) Latitude() string
- func (s *SensorConfigArg) Longitude() string
- func (s *SensorConfigArg) Reset()
- func (s *SensorConfigArg) SetAlert(alert string)
- func (s *SensorConfigArg) SetBatteryLevel(level uint8)
- func (s *SensorConfigArg) SetDarkThreshold(threshold uint16)
- func (s *SensorConfigArg) SetDarkThresholdOffset(offset uint16)
- func (s *SensorConfigArg) SetIsOn(isOn bool)
- func (s *SensorConfigArg) SetIsReachable(isReachable bool)
- func (s *SensorConfigArg) SetLatitude(latitude string)
- func (s *SensorConfigArg) SetLongitude(longitude string)
- func (s *SensorConfigArg) SetSunriseOffset(offset int8)
- func (s *SensorConfigArg) SetSunsetOffset(offset int8)
- func (s *SensorConfigArg) SetURL(url string)
- func (s *SensorConfigArg) SunriseOffset() int8
- func (s *SensorConfigArg) SunsetOffset() int8
- func (s *SensorConfigArg) URL() string
- type SensorState
- type SensorStateArg
- func (s *SensorStateArg) Errors() map[string]ResponseError
- func (s *SensorStateArg) Flag() bool
- func (s *SensorStateArg) Humidity() int32
- func (s *SensorStateArg) IsOpen() bool
- func (s *SensorStateArg) IsPresent() bool
- func (s *SensorStateArg) LightLevel() uint16
- func (s *SensorStateArg) Reset()
- func (s *SensorStateArg) SetFlag(flag bool)
- func (s *SensorStateArg) SetHumidity(humidity int32)
- func (s *SensorStateArg) SetIsOpen(isOpen bool)
- func (s *SensorStateArg) SetIsPresent(isPresent bool)
- func (s *SensorStateArg) SetLightLevel(lightLevel uint16)
- func (s *SensorStateArg) SetStatus(status int32)
- func (s *SensorStateArg) SetTemperature(temperature int32)
- func (s *SensorStateArg) Status() int32
- func (s *SensorStateArg) Temperature() int32
- type Updater
- type XY
Constants ¶
const ( // SourceStatic means this location came via a static configuration SourceStatic = iota // SourceUPNP means this location came via a UPNP discovery mechanism. SourceUPNP // SourceNUPNP means this location came via a nUPNP discovery mechanism. SourceNUPNP )
const ( // NoUpdateAvailable represents an up-to-date bridge NoUpdateAvailable = 0 // DownloadingSystemUpdate represents a bridge downloading a system update DownloadingSystemUpdate = 1 // SystemUpdateAvailable represents a bridge with a system update ready to be applied SystemUpdateAvailable = 2 // SystemUpdating represents a bridge that is actively updating itself SystemUpdating = 3 // LastRequestFailed represents a bridge that failed to execute its previous command LastRequestFailed = 10 NetworkUnavailable = 11 )
Variables ¶
var ( // ErrBridgeNotConfigured is returned if the bridge URL configured is not valid ErrBridgeNotConfigured = errors.New("bridge is not configured") // ErrInvalidManufacturer is returned if the retrieved bridge manufacturer is invalid ErrInvalidManufacturer = errors.New("invalid manufacturer detected") // ErrInvalidModel is returned if the retrieved bridge model is invalid ErrInvalidModel = errors.New("invalid model detected") )
var ( // ErrBridgeNotAvailable is returned if the specified bridge is not yet configured for access. ErrBridgeNotAvailable = errors.New("bridge is not yet ready") // ErrBridgeUpdating is returned if the specified bridge is currently being updated. ErrBridgeUpdating = errors.New("bridge is currently being updated") )
Functions ¶
This section is empty.
Types ¶
type Bridge ¶
type Bridge struct { // An empty username implies we have not yet paired with the bridge. Username string // contains filtered or unexported fields }
Bridge represents an instance of a Hue bridge. The locator discovery process will also create one instance for each profile detected that is not already running.
func (*Bridge) CheckForUpdate ¶
CheckForUpdate returns whether there is a software update available for the Hue bridge.
func (*Bridge) CreateSensor ¶
CreateSensor adds a new sensor to the bridge.
func (*Bridge) DeleteLight ¶
DeleteLight removes the specified light from the bridge.
func (*Bridge) DeleteSensor ¶
DeleteSensor removes the specified sensor from the bridge.
func (*Bridge) Description ¶
func (b *Bridge) Description() (BridgeDescription, error)
Description parses the validation XML file present on every Hue bridge. See http://www.developers.meethue.com/documentation/hue-bridge-discovery for details of the response format.
func (*Bridge) FinishUpdate ¶
FinishUpdate completes the update process
func (*Bridge) IsUpdating ¶
IsUpdating returns whether a bridge is in the process of updating or not.
func (*Bridge) NewLights ¶
NewLights returns the collection of newly discovered lights. Only returns a value if SearchForNewLights has previously been called.
func (*Bridge) NewSensors ¶
NewSensors returns the list of newly configured sensors. This will not return anything if SearchForNewSensors has not previously been called.
func (*Bridge) SearchForNewLights ¶
SearchForNewLights begins the process of locating new lights on the bridge.
func (*Bridge) SearchForNewSensors ¶
SearchForNewSensors attempts to discover new sensors added to the bridge.
func (*Bridge) SetLightState ¶
func (b *Bridge) SetLightState(id string, args *LightStateArg) error
SetLightState sets the specified light with the supplied light state.
func (*Bridge) SetSensorConfig ¶
func (b *Bridge) SetSensorConfig(id string, args *SensorConfigArg) error
SetSensorConfig updates the configuration a sensor.
func (*Bridge) SetSensorState ¶
func (b *Bridge) SetSensorState(id string, args *SensorStateArg) error
SetSensorState updates the state of the specified sensor.
func (*Bridge) StartUpdate ¶
StartUpdate kicks off the update process for the Hue bridge.
type BridgeDescription ¶
BridgeDescription contains the device information and the URL base which all subsequent calls should be made against.
type Config ¶
type Config struct { Name string `json:"name"` ID string `json:"bridgeid"` SwVersion string `json:"swversion"` APIVersion string `json:"apiversion"` ModelVersion string `json:"modelid"` LinkButton bool `json:"linkbutton"` IPAddress string `json:"ipaddress"` MACAddress string `json:"mac"` SubnetMask string `json:"netmask"` GatewayAddress string `json:"gateway"` IsDhcpAcquired bool `json:"dhcp"` PortalServices bool `json:"portalservices"` ZigbeeChannel int32 `json:"zigbeechannel"` Timezone string `json:"timezone"` SwUpdate struct { CheckForUpdates bool `json:"checkforupdates"` UpdateDetails string `json:"url"` UpdateSummary string `json:"text"` NotifyUser bool `json:"notify"` State int32 `json:"updateState"` DeviceTypes struct { Bridge bool `json:"bridge"` Lights []string `json:"lights"` Sensors []string `json:"sensors"` } `json:"devicetypes"` } `json:"swupdate"` PortalState struct { SignedOn bool `json:"signedon"` Incoming bool `json:"incoming"` Outgoing bool `json:"outgoing"` Communication string `json:"communication"` } `json:"portalstate"` }
Config represents an instance of a Hue bridge's configuration.
type ConfigArg ¶
type ConfigArg arg
ConfigArg represents a config property that can be set.
func (*ConfigArg) Errors ¶
func (c *ConfigArg) Errors() map[string]ResponseError
Errors exposes any errors encountered when applying the configuration.
func (*ConfigArg) ProxyAddress ¶
ProxyAddress returns the proxy address option, if configured.
func (*ConfigArg) SetDHCP ¶
func (c *ConfigArg) SetDHCP()
SetDHCP saves the specified value to be applied.
func (*ConfigArg) SetProxyAddress ¶
SetProxyAddress saves the specified value to be applied.
func (*ConfigArg) SetProxyPort ¶
SetProxyPort saves the specified value to be applied.
func (*ConfigArg) SetStaticAddress ¶
SetStaticAddress saves the specified value to be applied.
func (*ConfigArg) SetTouchLink ¶
func (c *ConfigArg) SetTouchLink()
SetTouchLink saves the specified value to be applied.
type Device ¶
type Device struct { DeviceType string `xml:"deviceType"` FriendlyName string `xml:"friendlyName"` Manufacturer string `xml:"manufacturer"` ManufacturerURL string `xml:"manufacturerURL"` ModelDescription string `xml:"modelDescription"` ModelName string `xml:"modelName"` ModelNumber string `xml:"modelNumber"` ModelURL string `xml:"modelURL"` SerialNumber string `xml:"serialNumber"` UDN string `xml:"UDN"` PresentationURL string `xml:"presentationURL"` Icons []Icon `xml:"iconList>icon"` }
Device contains the details of the bridge itself. These are all read-only properties.
type HSB ¶
HSB is a colour represented using the hue/saturation/value representation of the RGB colour model.
type Icon ¶
type Icon struct { MimeType string `xml:"mimetype"` Height int `xml:"height"` Width int `xml:"width"` Depth int `xml:"depth"` FileName string `xml:"url"` }
Icon contains the details of an icon hosted on the bridge.
type Light ¶
type Light struct { ID string Name string `json:"name"` Model string `json:"type"` ModelID string `json:"modelid"` ManufacturerName string `json:"manufacturername"` UniqueID string `json:"uniqueid"` SwVersion string `json:"swversion"` State LightState `json:"state"` }
Light represents a single light device.
type LightArg ¶
type LightArg arg
LightArg represents a configuration argument that can be made to a light.
func (*LightArg) Errors ¶
func (l *LightArg) Errors() map[string]ResponseError
Errors returns any errors encountered when applying the specified configuration.
type LightState ¶
type LightState struct { On bool `json:"on"` Brightness uint8 `json:"bri"` Hue uint16 `json:"hue"` Saturation uint8 `json:"sat"` XY [2]float64 `json:"xy"` ColorTemperature uint16 `json:"ct"` RGB RGB Alert string `json:"alert"` Effect string `json:"effect"` ColorMode string `json:"colormode"` Reachable bool `json:"reachable"` }
LightState represents the state of a single light.
type LightStateArg ¶
type LightStateArg arg
LightStateArg represents a state setting that can be applied to a light.
func (*LightStateArg) Alert ¶
func (l *LightStateArg) Alert() string
Alert returns the alert value, if configured.
func (*LightStateArg) Brightness ¶
func (l *LightStateArg) Brightness() uint8
Brightness returns the brightness value, if configured.
func (*LightStateArg) ColourTemperature ¶
func (l *LightStateArg) ColourTemperature() uint16
ColourTemperature returns the colour temperature value, if configured.
func (*LightStateArg) Effect ¶
func (l *LightStateArg) Effect() string
Effect returns the effect, if configured.
func (*LightStateArg) Errors ¶
func (l *LightStateArg) Errors() map[string]ResponseError
Errors returns any errors encountered when applying the specified setting changes.
func (*LightStateArg) Hue ¶
func (l *LightStateArg) Hue() uint16
Hue returns the hue value, if configured.
func (*LightStateArg) IsOn ¶
func (l *LightStateArg) IsOn() bool
IsOn returns the 'is on' value, if configured.
func (*LightStateArg) RGB ¶
func (l *LightStateArg) RGB(lightModel string) RGB
RGB returns the RGB value, if configured.
func (*LightStateArg) Saturation ¶
func (l *LightStateArg) Saturation() uint8
Saturation returns the saturation value, if configured.
func (*LightStateArg) SetAlert ¶
func (l *LightStateArg) SetAlert(alert string)
SetAlert saves the specified value to be applied.
func (*LightStateArg) SetBrightness ¶
func (l *LightStateArg) SetBrightness(brightness uint8)
SetBrightness saves the specified value to be applied.
func (*LightStateArg) SetColourTemperature ¶
func (l *LightStateArg) SetColourTemperature(ct uint16)
SetColourTemperature saves the specified value to be applied.
func (*LightStateArg) SetEffect ¶
func (l *LightStateArg) SetEffect(effect string)
SetEffect saves the specified value to be applied.
func (*LightStateArg) SetHue ¶
func (l *LightStateArg) SetHue(hue uint16)
SetHue saves the specified value to be applied.
func (*LightStateArg) SetIsOn ¶
func (l *LightStateArg) SetIsOn(isOn bool)
SetIsOn saves the specified value to be applied.
func (*LightStateArg) SetRGB ¶
func (l *LightStateArg) SetRGB(rgb RGB, lightModel string)
SetRGB saves the specified value to be applied.
func (*LightStateArg) SetSaturation ¶
func (l *LightStateArg) SetSaturation(saturation uint8)
SetSaturation saves the specified value to be applied.
func (*LightStateArg) SetTransitionTime ¶
func (l *LightStateArg) SetTransitionTime(tt uint16)
SetTransitionTime saves the specified value to be applied.
func (*LightStateArg) SetXY ¶
func (l *LightStateArg) SetXY(xy XY)
SetXY saves the specified value to be applied.
func (*LightStateArg) TransitionTime ¶
func (l *LightStateArg) TransitionTime() uint16
TransitionTime returns the transition time, if configured.
type Locator ¶
type Locator struct {
// contains filtered or unexported fields
}
Locator is an instance of the Hue auto-discovery runner.
func (*Locator) AddStaticAddress ¶
AddStaticAddress inserts a static Hue address into the location detection algorithm.
type NewSensor ¶
NewSensor represents an instance of a newly configured sensor instance paired to a Hue bridge.
type RGB ¶
RGB is a colour represented using the red/green/blue colour model.
func (*RGB) FromCT ¶
FromCT converts the specified CT value into the RGB colour space. This algorithm is adapted from the example at http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
func (*RGB) FromHSB ¶
FromHSB converts the specified HSB value into the RGB colour space. This algorithm is adapted from the code at http://www.docjar.com/html/api/java/awt/Color.java.html
func (*RGB) FromXY ¶
FromXY converts the specified XY value into the RGB colour space. The supplied light model is used to adjust the input value accordingly. This algorithm is adapted from the examples at http://www.developers.meethue.com/documentation/color-conversions-rgb-xy
type ResponseError ¶
type ResponseError struct { Type int `json:"type"` Description string `json:"description"` Address string `json:"address"` }
ResponseError is the error message returned if the given entry is invalid. The address refers to the component which failed to change; the Type maps to errorTypes above.
type Sensor ¶
type Sensor struct { ID string Name string `json:"name"` Type string `json:"type"` ModelID string `json:"modelid"` ManufacturerName string `json:"manufacturername"` ProductID string `json:"productid"` UniqueID string `json:"uniqueid"` SwVersion string `json:"swversion"` Sensitivity int32 `json:"sensitivity"` SensitivityMax int32 `json:"sensitivitymax"` Config SensorConfig `json:"config"` State SensorState `json:"state"` }
Sensor represents a single sensor instance on a Hue bridge.
type SensorArg ¶
type SensorArg arg
SensorArg is an argument to configure a sensor.
func (*SensorArg) Errors ¶
func (s *SensorArg) Errors() map[string]ResponseError
Errors exposes any errors encountered when applying the configuration.
type SensorConfig ¶
type SensorConfig struct { On bool `json:"on"` Reachable bool `json:"reachable"` Battery uint8 `json:"battery"` Alert string `json:"alert"` UserTest bool `json:"usertest"` URL *url.URL `json:"url"` Pending []string `json:"pending"` LedIndication bool `json:"ledindication"` Latitude string `json:"lat"` Longitude string `json:"long"` Configured bool `json:"configured"` SunriseOffset int8 `json:"sunriseoffset"` SunsetOffset int8 `json:"sunsetoffset"` ThresholdDark uint16 `json:"tholddark"` ThresholdOffset uint16 `json:"tholdoffset"` }
SensorConfig represents the configuration of a sensor.
type SensorConfigArg ¶
type SensorConfigArg arg
SensorConfigArg represents a set of configuration changes to be applied to a sensor.
func (*SensorConfigArg) Alert ¶
func (s *SensorConfigArg) Alert() string
Alert returns the specified option, if set.
func (*SensorConfigArg) BatteryLevel ¶
func (s *SensorConfigArg) BatteryLevel() uint8
BatteryLevel returns the specified option, if set.
func (*SensorConfigArg) DarkThreshold ¶
func (s *SensorConfigArg) DarkThreshold() uint16
DarkThreshold returns the specified option, if set.
func (*SensorConfigArg) DarkThresholdOffset ¶
func (s *SensorConfigArg) DarkThresholdOffset() uint16
DarkThresholdOffset returns the specified option, if set.
func (*SensorConfigArg) Errors ¶
func (s *SensorConfigArg) Errors() map[string]ResponseError
Errors exposes any errors encountered when applying the configuration.
func (*SensorConfigArg) IsOn ¶
func (s *SensorConfigArg) IsOn() bool
IsOn returns the name option, if set.
func (*SensorConfigArg) IsReachable ¶
func (s *SensorConfigArg) IsReachable() bool
IsReachable returns the is reachable option, if set.
func (*SensorConfigArg) Latitude ¶
func (s *SensorConfigArg) Latitude() string
Latitude returns the specified option, if set.
func (*SensorConfigArg) Longitude ¶
func (s *SensorConfigArg) Longitude() string
Longitude returns the specified option, if set.
func (*SensorConfigArg) SetAlert ¶
func (s *SensorConfigArg) SetAlert(alert string)
SetAlert sets the specified option to be applied.
func (*SensorConfigArg) SetBatteryLevel ¶
func (s *SensorConfigArg) SetBatteryLevel(level uint8)
SetBatteryLevel sets the specified option to be applied.
func (*SensorConfigArg) SetDarkThreshold ¶
func (s *SensorConfigArg) SetDarkThreshold(threshold uint16)
SetDarkThreshold sets the specified option to be applied.
func (*SensorConfigArg) SetDarkThresholdOffset ¶
func (s *SensorConfigArg) SetDarkThresholdOffset(offset uint16)
SetDarkThresholdOffset sets the specified option to be applied.
func (*SensorConfigArg) SetIsOn ¶
func (s *SensorConfigArg) SetIsOn(isOn bool)
SetIsOn sets the sensor to be on.
func (*SensorConfigArg) SetIsReachable ¶
func (s *SensorConfigArg) SetIsReachable(isReachable bool)
SetIsReachable sets the specified option to be applied.
func (*SensorConfigArg) SetLatitude ¶
func (s *SensorConfigArg) SetLatitude(latitude string)
SetLatitude sets the specified option to be applied.
func (*SensorConfigArg) SetLongitude ¶
func (s *SensorConfigArg) SetLongitude(longitude string)
SetLongitude sets the specified option to be applied.
func (*SensorConfigArg) SetSunriseOffset ¶
func (s *SensorConfigArg) SetSunriseOffset(offset int8)
SetSunriseOffset sets the specified option to be applied.
func (*SensorConfigArg) SetSunsetOffset ¶
func (s *SensorConfigArg) SetSunsetOffset(offset int8)
SetSunsetOffset sets the specified option to be applied.
func (*SensorConfigArg) SetURL ¶
func (s *SensorConfigArg) SetURL(url string)
SetURL sets the specified option to be applied.
func (*SensorConfigArg) SunriseOffset ¶
func (s *SensorConfigArg) SunriseOffset() int8
SunriseOffset returns the specified option, if set.
func (*SensorConfigArg) SunsetOffset ¶
func (s *SensorConfigArg) SunsetOffset() int8
SunsetOffset returns the specified option, if set.
func (*SensorConfigArg) URL ¶
func (s *SensorConfigArg) URL() string
URL returns the specified option, if set.
type SensorState ¶
type SensorState struct { LastUpdated string `json:"lastupdated"` ButtonEvent int32 `json:"buttonevent"` Presence bool `json:"presence"` Temperature int32 `json:"temperature"` Humidity int32 `json:"humidity"` Daylight bool `json:"daylight"` LightLevel uint16 `json:"lightlevel"` Dark bool `json:"dark"` Flag bool `json:"flag"` Status int32 `json:"status"` }
SensorState represents the state of a sensor.
type SensorStateArg ¶
type SensorStateArg arg
SensorStateArg is a set of options to configure a sensor state.
func (*SensorStateArg) Errors ¶
func (s *SensorStateArg) Errors() map[string]ResponseError
Errors exposes any errors encountered when applying the configuration.
func (*SensorStateArg) Flag ¶
func (s *SensorStateArg) Flag() bool
Flag returns the specified option, if set.
func (*SensorStateArg) Humidity ¶
func (s *SensorStateArg) Humidity() int32
Humidity returns the specified option, if set.
func (*SensorStateArg) IsOpen ¶
func (s *SensorStateArg) IsOpen() bool
IsOpen returns the specified option, if set.
func (*SensorStateArg) IsPresent ¶
func (s *SensorStateArg) IsPresent() bool
IsPresent returns the specified option, if set.
func (*SensorStateArg) LightLevel ¶
func (s *SensorStateArg) LightLevel() uint16
LightLevel returns the specified option, if set.
func (*SensorStateArg) Reset ¶
func (s *SensorStateArg) Reset()
Reset clears any set configuration options,
func (*SensorStateArg) SetFlag ¶
func (s *SensorStateArg) SetFlag(flag bool)
SetFlag sets the specified option to be applied.
func (*SensorStateArg) SetHumidity ¶
func (s *SensorStateArg) SetHumidity(humidity int32)
SetHumidity sets the specified option to be applied.
func (*SensorStateArg) SetIsOpen ¶
func (s *SensorStateArg) SetIsOpen(isOpen bool)
SetIsOpen sets the specified option to be applied.
func (*SensorStateArg) SetIsPresent ¶
func (s *SensorStateArg) SetIsPresent(isPresent bool)
SetIsPresent sets the specified option to be applied.
func (*SensorStateArg) SetLightLevel ¶
func (s *SensorStateArg) SetLightLevel(lightLevel uint16)
SetLightLevel sets the specified option to be applied.
func (*SensorStateArg) SetStatus ¶
func (s *SensorStateArg) SetStatus(status int32)
SetStatus sets the specified option to be applied.
func (*SensorStateArg) SetTemperature ¶
func (s *SensorStateArg) SetTemperature(temperature int32)
SetTemperature sets the specified option to be applied.
func (*SensorStateArg) Status ¶
func (s *SensorStateArg) Status() int32
Status returns the specified option, if set.
func (*SensorStateArg) Temperature ¶
func (s *SensorStateArg) Temperature() int32
Temperature returns the specified option, if set.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater is an instance of a Hue bridge updater.
func NewUpdater ¶
NewUpdater creates a new bridge updater from the specified Hue bridge.
type XY ¶
XY is a colour represented using the CIE colour space.
func (*XY) FromRGB ¶
FromRGB converts the specified RGB value into the CIE colour space. The supplied light model is used to adjust the input value accordingly. This algorithm is adapted from the examples at http://www.developers.meethue.com/documentation/color-conversions-rgb-xy