Documentation ¶
Index ¶
- Constants
- Variables
- func GetEngineVersion(mw MessageWriter, dst insteon.Address) (version insteon.EngineVersion, err error)
- func IDRequest(mw MessageWriter, dst insteon.Address) (version insteon.FirmwareVersion, devCat insteon.DevCat, err error)
- func Open(mw MessageWriter, dst insteon.Address, filters ...Filter) (device *BasicDevice, info DeviceInfo, err error)
- func Read(reader messageReader, matcher Matcher) (*insteon.Message, error)
- type AllLinkable
- type BasicDevice
- func (ldb BasicDevice) AddLinks(addLinks ...insteon.LinkRecord) (err error)
- func (d *BasicDevice) Address() insteon.Address
- func (d *BasicDevice) Dump() string
- func (d *BasicDevice) EnterLinkingMode(group insteon.Group) error
- func (d *BasicDevice) EnterUnlinkingMode(group insteon.Group) error
- func (d *BasicDevice) ExitLinkingMode() error
- func (d *BasicDevice) ExtendedGet(data []byte) (buf []byte, err error)
- func (d *BasicDevice) Info() DeviceInfo
- func (ldb BasicDevice) Links() (links []insteon.LinkRecord, err error)
- func (d *BasicDevice) ProductData() (data *ProductData, err error)
- func (d *BasicDevice) Send(command commands.Command, payload []byte) (commands.Command, error)
- func (d *BasicDevice) SendCommand(command commands.Command, payload []byte) error
- func (d *BasicDevice) String() string
- func (ldb BasicDevice) UpdateLinks(links ...insteon.LinkRecord) (err error)
- func (d *BasicDevice) Write(msg *insteon.Message) (ack *insteon.Message, err error)
- func (ldb BasicDevice) WriteLink(index int, link insteon.LinkRecord) (err error)
- func (ldb BasicDevice) WriteLinks(links ...insteon.LinkRecord) (err error)
- type CacheFilter
- type CmdMatcher
- type Device
- type DeviceInfo
- type Dimmer
- func (ldb Dimmer) AddLinks(addLinks ...insteon.LinkRecord) (err error)
- func (dd *Dimmer) Brighten() error
- func (dd *Dimmer) Config() (config DimmerConfig, err error)
- func (dd *Dimmer) Dim() error
- func (dd *Dimmer) InstantChange(level int) error
- func (ldb Dimmer) Links() (links []insteon.LinkRecord, err error)
- func (dd *Dimmer) OffAtRamp(rate int) error
- func (dd *Dimmer) OnAtRamp(level, rate int) error
- func (dd *Dimmer) OnFast() error
- func (dd *Dimmer) SetStatus(level int) error
- func (dd *Dimmer) StartBrighten() error
- func (dd *Dimmer) StartDim() error
- func (dd *Dimmer) StopManualChange() error
- func (dd *Dimmer) String() string
- func (ldb Dimmer) UpdateLinks(links ...insteon.LinkRecord) (err error)
- func (ldb Dimmer) WriteLink(index int, link insteon.LinkRecord) (err error)
- func (ldb Dimmer) WriteLinks(links ...insteon.LinkRecord) (err error)
- type DimmerConfig
- type EquipmentState
- type ExtendedGetSet
- type FXDevice
- type FanSpeed
- type Filter
- type FilterFunc
- type LightFlags
- func (lf LightFlags) CleanupReport() bool
- func (lf LightFlags) DBDelta() int
- func (lf LightFlags) ErrorBlink() bool
- func (lf LightFlags) LED() bool
- func (lf LightFlags) LoadSense() bool
- func (lf LightFlags) ProgramLock() bool
- func (lf LightFlags) ResumeDim() bool
- func (lf LightFlags) SNR() int
- func (lf LightFlags) TxLED() bool
- func (lf LightFlags) X10Enabled() bool
- type LightState
- type LinkRequest
- type LinkRequestType
- type Linkable
- type Matcher
- func AckMatcher() Matcher
- func AllLinkMatcher() Matcher
- func And(matchers ...Matcher) Matcher
- func DstMatcher(dst insteon.Address) Matcher
- func DuplicateMatcher(msg1 *insteon.Message) Matcher
- func MatchAck(ack *insteon.Message) Matcher
- func Not(matcher Matcher) Matcher
- func Or(matchers ...Matcher) Matcher
- func SrcMatcher(src insteon.Address) Matcher
- type Matches
- type MemAddress
- type MessageWriter
- type NameableDevice
- type Outlet
- func (ldb Outlet) AddLinks(addLinks ...insteon.LinkRecord) (err error)
- func (ldb Outlet) Links() (links []insteon.LinkRecord, err error)
- func (ldb Outlet) UpdateLinks(links ...insteon.LinkRecord) (err error)
- func (ldb Outlet) WriteLink(index int, link insteon.LinkRecord) (err error)
- func (ldb Outlet) WriteLinks(links ...insteon.LinkRecord) (err error)
- type PingableDevice
- type ProductData
- type Switch
- func (ldb Switch) AddLinks(addLinks ...insteon.LinkRecord) (err error)
- func (sd *Switch) Config() (config SwitchConfig, err error)
- func (ldb Switch) Links() (links []insteon.LinkRecord, err error)
- func (sd *Switch) OperatingFlags() (flags LightFlags, err error)
- func (sd *Switch) SetBacklight(light bool) error
- func (sd *Switch) SetLoadSense(loadsense bool) error
- func (sd *Switch) Status() (level int, err error)
- func (sd *Switch) String() string
- func (sd *Switch) TurnOff() error
- func (sd *Switch) TurnOn(level int) error
- func (ldb Switch) UpdateLinks(links ...insteon.LinkRecord) (err error)
- func (ldb Switch) WriteLink(index int, link insteon.LinkRecord) (err error)
- func (ldb Switch) WriteLinks(links ...insteon.LinkRecord) (err error)
- type SwitchConfig
- type Thermostat
- func (ldb Thermostat) AddLinks(addLinks ...insteon.LinkRecord) (err error)
- func (therm *Thermostat) DecreaseTemp(delta int) error
- func (therm *Thermostat) DecreaseZoneTemp(zone int, delta int) error
- func (therm *Thermostat) GetAmbientTemp() (temp int, err error)
- func (therm *Thermostat) GetEquipmentState() (EquipmentState, error)
- func (therm *Thermostat) GetFanSpeed() (FanSpeed, error)
- func (therm *Thermostat) GetInfo() (ti ThermostatInfo, err error)
- func (therm *Thermostat) GetMode() (mode ThermostatMode, err error)
- func (therm *Thermostat) GetTempUnit() (Unit, error)
- func (therm *Thermostat) GetZoneInfo(zone int) (zi ZoneInfo, err error)
- func (therm *Thermostat) IncreaseTemp(delta int) error
- func (therm *Thermostat) IncreaseZoneTemp(zone int, delta int) error
- func (ldb Thermostat) Links() (links []insteon.LinkRecord, err error)
- func (therm *Thermostat) SetCoolSetpoint(zone int, temp int) error
- func (therm *Thermostat) SetFanSpeen(speed FanSpeed) error
- func (therm *Thermostat) SetHeatSetpoint(zone int, temp int) error
- func (therm *Thermostat) SetMode(mode ThermostatMode) error
- func (therm *Thermostat) SetStatusMessage(enabled bool) error
- func (therm *Thermostat) SetTempUnit(unit Unit) error
- func (therm *Thermostat) SetZoneCoolSetpoint(zone int, temp, deadband int) error
- func (therm *Thermostat) SetZoneHeatSetpoint(zone int, temp, deadband int) error
- func (therm *Thermostat) Status() (status ThermostatStatus, err error)
- func (therm *Thermostat) String() string
- func (ldb Thermostat) UpdateLinks(links ...insteon.LinkRecord) (err error)
- func (ldb Thermostat) WriteLink(index int, link insteon.LinkRecord) (err error)
- func (ldb Thermostat) WriteLinks(links ...insteon.LinkRecord) (err error)
- type ThermostatFlags
- type ThermostatInfo
- type ThermostatMode
- type ThermostatStatus
- type Unit
- type WriteLink
- type ZoneInfo
Constants ¶
const ( // BaseLinkDBAddress is the base address of devices All-Link database BaseLinkDBAddress = MemAddress(0x0fff) // LinkRecordSize is the size, in bytes, of a single All-Link record LinkRecordSize = MemAddress(8) )
Variables ¶
var ( // ErrReadTimeout indicates the timeout period expired while waiting for // a specific message ErrReadTimeout = errors.New("Read Timeout") // ErrNotLinked indicates the device does not have an all-link entry in its // database ErrNotLinked = errors.New("Not in All-Link group") // ErrUnexpectedResponse is returned when a Nak is not understood ErrUnexpectedResponse = errors.New("Unexpected response from device") // ErrNoLoadDetected is an error returned by the device (this error condition is not documented) ErrNoLoadDetected = errors.New("No load detected") // ErrIllegalValue is returned by I2Cs devices (this error condition is not documented) ErrIllegalValue = errors.New("Illegal value in command") // ErrIncorrectChecksum is returned by I2Cs devices when an invalid checksum is detected ErrIncorrectChecksum = errors.New("I2CS invalid checksum") // ErrLinkIndexOutOfRange indicates that the index exceeds the length of the all-link database ErrLinkIndexOutOfRange = errors.New("Link index is beyond the bounds of the link database") // ErrInvalidThermostatMode indicates an unknown mode was supplied to the SetMode function ErrInvalidThermostatMode = errors.New("invalid mode") // ErrInvalidUnit indicates the given value for Unit is not either Fahrenheit or Celsius ErrInvalidUnit = errors.New("Invalid temperature unit") // ErrInvalidFanSpeed indicates the value provided for FanSpeed is either unsupported or // unknown ErrInvalidFanSpeed = errors.New("Invalid fan speed") // ErrInvalidResponse indicates the device responded in a way that the system // doesn't understand ErrInvalidResponse = errors.New("Invalid response received") // ErrNak indicates a negative acknowledgement was received in response to a sent message ErrNak = errors.New("NAK received") )
var ( Log = log.New(os.Stderr, "", log.LstdFlags) LogDebug = log.New(ioutil.Discard, "DEBUG ", log.LstdFlags) )
var LinkingModeWaitTime = (500 * time.Millisecond) + insteon.PropagationDelay(3, 14)
LinkingModeWaitTime is the default time to wait after linking mode has been enabled on a device. This allows the set button pressed message to propagate through the Insteon network
var ( // MaxLinkDbAge is the amount of time to wait until the local link database // is considered old MaxLinkDbAge = time.Hour )
Functions ¶
func GetEngineVersion ¶
func GetEngineVersion(mw MessageWriter, dst insteon.Address) (version insteon.EngineVersion, err error)
func IDRequest ¶
func IDRequest(mw MessageWriter, dst insteon.Address) (version insteon.FirmwareVersion, devCat insteon.DevCat, err error)
func Open ¶
func Open(mw MessageWriter, dst insteon.Address, filters ...Filter) (device *BasicDevice, info DeviceInfo, err error)
Open will try to establish communication with the remote device. If the device responds, Open will request its engine version as well as device info in order to return the correct device type (Dimmer, switch, thermostat, etc). Open requires a MessageWriter, such as a PLM to use to communicate with the Insteon network
Types ¶
type AllLinkable ¶
type AllLinkable interface { // AssignToAllLinkGroup should be called after the set button // has been pressed on a responder. If the set button was pressed // then this method will assign the responder to the given // All-Link Group AssignToAllLinkGroup(insteon.Group) error // DeleteFromAllLinkGroup removes an All-Link record from a responding // device during an Unlinking session DeleteFromAllLinkGroup(insteon.Group) error }
AllLinkable is any device that has an all-link database that can be programmed remotely
type BasicDevice ¶
type BasicDevice struct { MessageWriter DeviceInfo // contains filtered or unexported fields }
BasicDevice provides remote communication to version 1 engines
func New ¶
func New(mw MessageWriter, info DeviceInfo) *BasicDevice
func (BasicDevice) AddLinks ¶
func (ldb BasicDevice) AddLinks(addLinks ...insteon.LinkRecord) (err error)
func (*BasicDevice) Address ¶
func (d *BasicDevice) Address() insteon.Address
func (*BasicDevice) Dump ¶
func (d *BasicDevice) Dump() string
func (*BasicDevice) EnterLinkingMode ¶
func (d *BasicDevice) EnterLinkingMode(group insteon.Group) error
func (*BasicDevice) EnterUnlinkingMode ¶
func (d *BasicDevice) EnterUnlinkingMode(group insteon.Group) error
func (*BasicDevice) ExitLinkingMode ¶
func (d *BasicDevice) ExitLinkingMode() error
func (*BasicDevice) ExtendedGet ¶
func (d *BasicDevice) ExtendedGet(data []byte) (buf []byte, err error)
func (*BasicDevice) Info ¶
func (d *BasicDevice) Info() DeviceInfo
func (BasicDevice) Links ¶
func (ldb BasicDevice) Links() (links []insteon.LinkRecord, err error)
Links will retrieve the link-database from the device and return a list of LinkRecords
func (*BasicDevice) ProductData ¶
func (d *BasicDevice) ProductData() (data *ProductData, err error)
ProductData will retrieve the device's product data
func (*BasicDevice) Send ¶
Send will send the given command bytes to the device including a payload (for extended messages). If payload length is zero then a standard length message is used to deliver the commands. Any error encountered sending the command is returned (eg. ack timeout, etc)
func (*BasicDevice) SendCommand ¶
func (d *BasicDevice) SendCommand(command commands.Command, payload []byte) error
func (*BasicDevice) String ¶
func (d *BasicDevice) String() string
String returns the string "<engine version> Device (<address>)" where <address> is the destination address of the device
func (BasicDevice) UpdateLinks ¶
func (ldb BasicDevice) UpdateLinks(links ...insteon.LinkRecord) (err error)
func (BasicDevice) WriteLink ¶
func (ldb BasicDevice) WriteLink(index int, link insteon.LinkRecord) (err error)
func (BasicDevice) WriteLinks ¶
func (ldb BasicDevice) WriteLinks(links ...insteon.LinkRecord) (err error)
type CacheFilter ¶
func (*CacheFilter) Filter ¶
func (c *CacheFilter) Filter(next MessageWriter) MessageWriter
type CmdMatcher ¶
type Device ¶
type Device interface { commands.Commandable // Address will return the 3 byte destination address of the device. // All device implemtaions must be able to return their address Address() insteon.Address // Info will return the device's information Info() DeviceInfo }
func Lookup ¶
func Lookup(bd *BasicDevice) (device Device)
Lookup will convert the *BasicDevice to a more specific device (*Dimmer, *Switch, etc)
type DeviceInfo ¶
type DeviceInfo struct { Address insteon.Address `json:"address"` DevCat insteon.DevCat `json:"devCat"` FirmwareVersion insteon.FirmwareVersion `json:"firmwareVersion"` EngineVersion insteon.EngineVersion `json:"engineVersion"` }
DeviceInfo is a record of information about known devices on the network
type Dimmer ¶
type Dimmer struct {
*Switch
}
func NewDimmer ¶
func NewDimmer(d *BasicDevice) *Dimmer
NewDimmer is a factory function that will return a dimmer switch configured appropriately for the given firmware version. All dimmers are switches, so the first argument is a Switch object used to compose the new dimmer
func (Dimmer) AddLinks ¶
func (ldb Dimmer) AddLinks(addLinks ...insteon.LinkRecord) (err error)
func (*Dimmer) Config ¶
func (dd *Dimmer) Config() (config DimmerConfig, err error)
func (*Dimmer) InstantChange ¶
func (Dimmer) Links ¶
func (ldb Dimmer) Links() (links []insteon.LinkRecord, err error)
Links will retrieve the link-database from the device and return a list of LinkRecords
func (*Dimmer) StartBrighten ¶
func (*Dimmer) StopManualChange ¶
func (Dimmer) UpdateLinks ¶
func (ldb Dimmer) UpdateLinks(links ...insteon.LinkRecord) (err error)
func (Dimmer) WriteLink ¶
func (ldb Dimmer) WriteLink(index int, link insteon.LinkRecord) (err error)
func (Dimmer) WriteLinks ¶
func (ldb Dimmer) WriteLinks(links ...insteon.LinkRecord) (err error)
type DimmerConfig ¶
type DimmerConfig struct { // HouseCode is the device X10 house code HouseCode int // UnitCode is the device X10 unit code UnitCode int // Ramp is the default ramp rate Ramp int // OnLevel is the default on level OnLevel int // SNT is the Signal to Noise Threshold SNT int }
DimmerConfig includes the X10 configuration as well as default ramp and on levels
func (*DimmerConfig) MarshalBinary ¶
func (dc *DimmerConfig) MarshalBinary() ([]byte, error)
MarshalBinary will convert the DimmerConfig receiver to a byte string
func (*DimmerConfig) UnmarshalBinary ¶
func (dc *DimmerConfig) UnmarshalBinary(buf []byte) error
UnmarshalBinary will parse the byte buffer into the receiver
type EquipmentState ¶
type EquipmentState byte
func (EquipmentState) CoolActive ¶
func (es EquipmentState) CoolActive() bool
func (EquipmentState) HeatActive ¶
func (es EquipmentState) HeatActive() bool
func (EquipmentState) ProgrammableOutputAvailable ¶
func (es EquipmentState) ProgrammableOutputAvailable() bool
func (EquipmentState) ProgrammableOutputState ¶
func (es EquipmentState) ProgrammableOutputState() bool
func (EquipmentState) String ¶
func (es EquipmentState) String() string
type ExtendedGetSet ¶
type Filter ¶
type Filter interface {
Filter(next MessageWriter) MessageWriter
}
func FilterDuplicates ¶
func FilterDuplicates() Filter
func RetryFilter ¶
type FilterFunc ¶
type FilterFunc func(next MessageWriter) MessageWriter
func (FilterFunc) Filter ¶
func (ff FilterFunc) Filter(next MessageWriter) MessageWriter
type LightFlags ¶
type LightFlags [5]byte
LightFlags are the operating flags for a switch or dimmer
func (LightFlags) CleanupReport ¶
func (lf LightFlags) CleanupReport() bool
CleanupReport enables sending All-link cleanup reports. These are broadcast messages sent after all-link recall/all-link alias messages.
func (LightFlags) DBDelta ¶
func (lf LightFlags) DBDelta() int
DBDelta indicates the number of changes that have been written to the all-link database
func (LightFlags) ErrorBlink ¶
func (lf LightFlags) ErrorBlink() bool
ErrorBlink enables the device to blink the status LED when errors occur TODO: Confirm this description is correct
func (LightFlags) LoadSense ¶
func (lf LightFlags) LoadSense() bool
LoadSense indicates if the device should activate when a load is added
func (LightFlags) ProgramLock ¶
func (lf LightFlags) ProgramLock() bool
ProgramLock indicates if the Program Lock flag is set
func (LightFlags) ResumeDim ¶
func (lf LightFlags) ResumeDim() bool
ResumeDim indicates if the switch will return to the previous on level or will return to the default on level
func (LightFlags) SNR ¶
func (lf LightFlags) SNR() int
SNR indicates the current signal-to-noise ratio
func (LightFlags) TxLED ¶
func (lf LightFlags) TxLED() bool
TxLED indicates whether the status LED will flash when Insteon traffic is received
func (LightFlags) X10Enabled ¶
func (lf LightFlags) X10Enabled() bool
X10Enabled indicates if the device will respond to X10 commands
type LightState ¶
type LightState struct {
Level int
}
type LinkRequest ¶
type LinkRequest struct { Type LinkRequestType MemAddress MemAddress NumRecords int Link *insteon.LinkRecord }
LinkRequest is the message sent to a device to request reading or writing all-link database records
func (*LinkRequest) MarshalBinary ¶
func (lr *LinkRequest) MarshalBinary() (buf []byte, err error)
MarshalBinary will convert the LinkRequest to a byte slice appropriate for sending out to the insteon network
func (*LinkRequest) String ¶
func (lr *LinkRequest) String() string
func (*LinkRequest) UnmarshalBinary ¶
func (lr *LinkRequest) UnmarshalBinary(buf []byte) (err error)
UnmarshalBinary will take the byte slice and convert it to a LinkRequest object
type LinkRequestType ¶
type LinkRequestType byte
LinkRequestType is used to indicate whether an ALDB request is for reading or writing the database
func (LinkRequestType) String ¶
func (lrt LinkRequestType) String() string
type Linkable ¶
type Linkable interface { // Address will return the 3 byte destination address of the device. // All device implemtaions must be able to return their address Address() insteon.Address // EnterLinkingMode is the programmatic equivalent of holding down // the set button for two seconds. If the device is the first // to enter linking mode, then it is the controller. The next // device to enter linking mode is the responder. LinkingMode // is usually indicated by a flashing GREEN LED on the device EnterLinkingMode(insteon.Group) error // EnterUnlinkingMode puts a controller device into unlinking mode // when the set button is then pushed (EnterLinkingMode) on a linked // device the corresponding links in both the controller and responder // are deleted. EnterUnlinkingMode is the programmatic equivalent // to pressing the set button until the device beeps, releasing, then // pressing the set button again until the device beeps again. UnlinkingMode // is usually indicated by a flashing RED LED on the device EnterUnlinkingMode(insteon.Group) error // ExitLinkingMode takes a controller out of linking/unlinking mode. ExitLinkingMode() error // Links will return a list of LinkRecords that are present in // the All-Link database Links() ([]insteon.LinkRecord, error) // UpdateLinks will write the given links to the device's all-link // database. Links will be written to available records // (link records marked with an Available flag). If no more // available records are found, then the links will be appended // to the all-link database. If a communication failure occurs then // the appropriate error is returned (ErrReadTimeout, ErrAckTimeout, etc.) // If an existing link is found that has different flags then the existing // record is updated to reflect the new flags UpdateLinks(...insteon.LinkRecord) error // WriteLinks will overwrite the entire device all-link database // with the list of links provided. If a communication failure occurs // then the appropriate error is returned (ErrReadTimeout, ErrAckTimeout, // etc). WriteLinks(...insteon.LinkRecord) error }
Linkable is any device that can be put into linking mode and the link database can be managed remotely
type Matcher ¶
func AckMatcher ¶
func AckMatcher() Matcher
func AllLinkMatcher ¶
func AllLinkMatcher() Matcher
func DstMatcher ¶
func DuplicateMatcher ¶
func SrcMatcher ¶
type MemAddress ¶
type MemAddress int
MemAddress is an integer representing a specific location in a device's memory
func (MemAddress) String ¶
func (ma MemAddress) String() string
type MessageWriter ¶
type NameableDevice ¶
type NameableDevice interface { // TextString returns the information assigned to the device TextString() (string, error) // SetTextString assigns the information to the device SetTextString(string) error }
NameableDevice is any device that have a settable text string
type Outlet ¶
type Outlet struct {
*Switch
}
func NewOutlet ¶
func NewOutlet(d *BasicDevice) *Outlet
func (Outlet) AddLinks ¶
func (ldb Outlet) AddLinks(addLinks ...insteon.LinkRecord) (err error)
func (Outlet) Links ¶
func (ldb Outlet) Links() (links []insteon.LinkRecord, err error)
Links will retrieve the link-database from the device and return a list of LinkRecords
func (Outlet) UpdateLinks ¶
func (ldb Outlet) UpdateLinks(links ...insteon.LinkRecord) (err error)
func (Outlet) WriteLink ¶
func (ldb Outlet) WriteLink(index int, link insteon.LinkRecord) (err error)
func (Outlet) WriteLinks ¶
func (ldb Outlet) WriteLinks(links ...insteon.LinkRecord) (err error)
type PingableDevice ¶
type PingableDevice interface { // Ping sends a ping request to the device and waits for a single ACK Ping() error }
PingableDevice is any device that implements the Ping method
type ProductData ¶
type ProductData struct { Key insteon.ProductKey DevCat insteon.DevCat }
ProductData contains information about the device including its product key and device category
func (*ProductData) MarshalBinary ¶
func (pd *ProductData) MarshalBinary() ([]byte, error)
MarshalBinary will convert the ProductData to a binary byte string for sending on the network
func (*ProductData) UnmarshalBinary ¶
func (pd *ProductData) UnmarshalBinary(buf []byte) error
UnmarshalBinary takes the input byte buffer and unmarshals it into the ProductData object
type Switch ¶
type Switch struct { *BasicDevice // contains filtered or unexported fields }
func NewSwitch ¶
func NewSwitch(d *BasicDevice) *Switch
NewSwitch will return an initialize switch object that controls a physical switch on the netork
func (Switch) AddLinks ¶
func (ldb Switch) AddLinks(addLinks ...insteon.LinkRecord) (err error)
func (*Switch) Config ¶
func (sd *Switch) Config() (config SwitchConfig, err error)
func (Switch) Links ¶
func (ldb Switch) Links() (links []insteon.LinkRecord, err error)
Links will retrieve the link-database from the device and return a list of LinkRecords
func (*Switch) OperatingFlags ¶
func (sd *Switch) OperatingFlags() (flags LightFlags, err error)
func (*Switch) SetBacklight ¶
func (*Switch) SetLoadSense ¶
func (*Switch) Status ¶
Status sends a LightStatusRequest to determine the device's current level. For switched devices this is either 0 or 255, dimmable devices will be the current dim level between 0 and 255
func (Switch) UpdateLinks ¶
func (ldb Switch) UpdateLinks(links ...insteon.LinkRecord) (err error)
func (Switch) WriteLink ¶
func (ldb Switch) WriteLink(index int, link insteon.LinkRecord) (err error)
func (Switch) WriteLinks ¶
func (ldb Switch) WriteLinks(links ...insteon.LinkRecord) (err error)
type SwitchConfig ¶
type SwitchConfig struct { // HouseCode is the X10 house code of the switch or dimmer HouseCode int // UnitCode is the X10 unit code of the switch or dimmer UnitCode int }
SwitchConfig contains the HouseCode and UnitCode for a switch's X10 configuration
func (*SwitchConfig) MarshalBinary ¶
func (sc *SwitchConfig) MarshalBinary() ([]byte, error)
MarshalBinary will convert the receiver into a serialized byte buffer
func (*SwitchConfig) UnmarshalBinary ¶
func (sc *SwitchConfig) UnmarshalBinary(buf []byte) error
UnmarshalBinary takes the given byte buffer and unmarshals it into the receiver
type Thermostat ¶
type Thermostat struct { *BasicDevice // contains filtered or unexported fields }
func NewThermostat ¶
func NewThermostat(d *BasicDevice) *Thermostat
NewThermostat will return a configured Thermostat object
func (Thermostat) AddLinks ¶
func (ldb Thermostat) AddLinks(addLinks ...insteon.LinkRecord) (err error)
func (*Thermostat) DecreaseTemp ¶
func (therm *Thermostat) DecreaseTemp(delta int) error
func (*Thermostat) DecreaseZoneTemp ¶
func (therm *Thermostat) DecreaseZoneTemp(zone int, delta int) error
func (*Thermostat) GetAmbientTemp ¶
func (therm *Thermostat) GetAmbientTemp() (temp int, err error)
func (*Thermostat) GetEquipmentState ¶
func (therm *Thermostat) GetEquipmentState() (EquipmentState, error)
func (*Thermostat) GetFanSpeed ¶
func (therm *Thermostat) GetFanSpeed() (FanSpeed, error)
func (*Thermostat) GetInfo ¶
func (therm *Thermostat) GetInfo() (ti ThermostatInfo, err error)
func (*Thermostat) GetMode ¶
func (therm *Thermostat) GetMode() (mode ThermostatMode, err error)
func (*Thermostat) GetTempUnit ¶
func (therm *Thermostat) GetTempUnit() (Unit, error)
func (*Thermostat) GetZoneInfo ¶
func (therm *Thermostat) GetZoneInfo(zone int) (zi ZoneInfo, err error)
func (*Thermostat) IncreaseTemp ¶
func (therm *Thermostat) IncreaseTemp(delta int) error
func (*Thermostat) IncreaseZoneTemp ¶
func (therm *Thermostat) IncreaseZoneTemp(zone int, delta int) error
func (Thermostat) Links ¶
func (ldb Thermostat) Links() (links []insteon.LinkRecord, err error)
Links will retrieve the link-database from the device and return a list of LinkRecords
func (*Thermostat) SetCoolSetpoint ¶
func (therm *Thermostat) SetCoolSetpoint(zone int, temp int) error
func (*Thermostat) SetFanSpeen ¶
func (therm *Thermostat) SetFanSpeen(speed FanSpeed) error
func (*Thermostat) SetHeatSetpoint ¶
func (therm *Thermostat) SetHeatSetpoint(zone int, temp int) error
func (*Thermostat) SetMode ¶
func (therm *Thermostat) SetMode(mode ThermostatMode) error
func (*Thermostat) SetStatusMessage ¶
func (therm *Thermostat) SetStatusMessage(enabled bool) error
func (*Thermostat) SetTempUnit ¶
func (therm *Thermostat) SetTempUnit(unit Unit) error
func (*Thermostat) SetZoneCoolSetpoint ¶
func (therm *Thermostat) SetZoneCoolSetpoint(zone int, temp, deadband int) error
func (*Thermostat) SetZoneHeatSetpoint ¶
func (therm *Thermostat) SetZoneHeatSetpoint(zone int, temp, deadband int) error
func (*Thermostat) Status ¶
func (therm *Thermostat) Status() (status ThermostatStatus, err error)
func (*Thermostat) String ¶
func (therm *Thermostat) String() string
func (Thermostat) UpdateLinks ¶
func (ldb Thermostat) UpdateLinks(links ...insteon.LinkRecord) (err error)
func (Thermostat) WriteLink ¶
func (ldb Thermostat) WriteLink(index int, link insteon.LinkRecord) (err error)
func (Thermostat) WriteLinks ¶
func (ldb Thermostat) WriteLinks(links ...insteon.LinkRecord) (err error)
type ThermostatFlags ¶
type ThermostatFlags byte
func (ThermostatFlags) ButtonBeep ¶
func (tf ThermostatFlags) ButtonBeep() bool
func (ThermostatFlags) ButtonLock ¶
func (tf ThermostatFlags) ButtonLock() bool
func (ThermostatFlags) LinkingLock ¶
func (tf ThermostatFlags) LinkingLock() bool
func (ThermostatFlags) TempFormat ¶
func (tf ThermostatFlags) TempFormat() Unit
func (ThermostatFlags) TimeFormat ¶
func (tf ThermostatFlags) TimeFormat() int
type ThermostatInfo ¶
type ThermostatInfo struct { // Data Set 1 Temp float32 Humidity int TempOffset int HumidityOffset int Mode ThermostatMode FanMode int BacklightSeconds int HysteresisMinutes int Flags ThermostatFlags // Data Set 2 HumidityLow int HumidityHigh int Rev int CoolSetPoint int HeatSetPoint int RFOffset int EnergySetbackPoint int ExternalTempOffset int StatusReportEnabled bool ExternalPower bool ExternalTemp bool }
func (*ThermostatInfo) String ¶
func (ti *ThermostatInfo) String() string
func (*ThermostatInfo) UnmarshalBinary ¶
func (ti *ThermostatInfo) UnmarshalBinary(data []byte) error
type ThermostatMode ¶
type ThermostatMode byte
const ( ThermostatOff ThermostatMode = 0x00 // Thermostat Off Heat ThermostatMode = 0x01 // Heat Mode Cool ThermostatMode = 0x02 // Cool Mode Auto ThermostatMode = 0x03 // Auto Mode FanOn ThermostatMode = 0x04 // Fan On ProgramAuto ThermostatMode = 0x05 // Program Auto ProgramHeat ThermostatMode = 0x06 // Program Heat ProgramCool ThermostatMode = 0x07 // Program Cool FanOff ThermostatMode = 0x08 // Fan Off )
func (ThermostatMode) String ¶
func (i ThermostatMode) String() string
type ThermostatStatus ¶
type ThermostatStatus struct { Temperature int Humidity int Setpoint int Deadband int Unit Unit Mode ThermostatMode State EquipmentState }