Documentation
¶
Index ¶
- Constants
- Variables
- func GetProductDesc(cat Category, sub SubCategory) string
- type Ack
- type Address
- type AllLinkCleanup
- type AllLinkCleanupFailure
- type AllLinkCleanupStatus
- type AllLinkCompleted
- type AllLinkRecord
- type AllLinkRecordFlags
- type ButtonEvent
- type ButtonEventType
- type Category
- type CommDirection
- type CommLogger
- type CommandFlag
- type CommandResponse
- type CommandResponseFlags
- func (flags CommandResponseFlags) Acknowledgement() bool
- func (flags CommandResponseFlags) AllLink() bool
- func (flags CommandResponseFlags) BroadcastNAK() bool
- func (flags CommandResponseFlags) Extended() bool
- func (flags CommandResponseFlags) HopsLeft() int
- func (flags CommandResponseFlags) MaxHops() int
- func (flags CommandResponseFlags) String() string
- type DatabaseRecord
- type Device
- func (d *Device) AddAllLink(ctx context.Context, addr Address, group byte, data [3]byte, controller bool) error
- func (d *Device) Address() Address
- func (d *Device) DeleteAllLink(ctx context.Context, addr Address, group byte, controller bool) error
- func (d *Device) GetDatabase(ctx context.Context) (map[uint16]*AllLinkRecord, error)
- func (d *Device) GetName(ctx context.Context) (string, error)
- func (d *Device) GetOperatingFlags(ctx context.Context) (DeviceOpFlags, error)
- func (d *Device) GetProductData(ctx context.Context) (*Product, error)
- func (d *Device) GetStatus(ctx context.Context) (*DeviceStatus, error)
- func (d *Device) GetStatusChannel(ctx context.Context, channel byte) (*DeviceStatus, error)
- func (d *Device) Ping(ctx context.Context) error
- func (d *Device) SetFanLevel(ctx context.Context, level byte) error
- func (d *Device) SetName(ctx context.Context, name string) error
- func (d *Device) StartAllLink(ctx context.Context, group byte) error
- func (d *Device) TurnOff(ctx context.Context) error
- func (d *Device) TurnOffRamp(ctx context.Context, ramp bool) error
- func (d *Device) TurnOn(ctx context.Context) error
- func (d *Device) TurnOnLevel(ctx context.Context, ramp bool, level byte) error
- func (d *Device) TurnOnRamp(ctx context.Context, ramp bool) error
- func (d *Device) UpdateAllLink(ctx context.Context, addr Address, group byte, data [3]byte, controller bool) error
- type DeviceIdentification
- type DeviceOpFlags
- type DeviceStatus
- type Event
- type EventListener
- type ExtCommandResponse
- type Group
- type Hub
- type Hub2242
- type Hub2245
- type HubPLM
- type HubStreaming
- func (hub *HubStreaming) AddEventListener(listener EventListener)
- func (hub *HubStreaming) Beep(ctx context.Context) error
- func (hub *HubStreaming) CancelAllLink(ctx context.Context) error
- func (hub *HubStreaming) Expect(ctx context.Context, evt Event) (Event, error)
- func (hub *HubStreaming) GetAllLinkDatabase(ctx context.Context) ([]*AllLinkRecord, error)
- func (hub *HubStreaming) GetInfo(ctx context.Context) (*ModemInfo, error)
- func (hub *HubStreaming) GetLastSender(ctx context.Context) (*AllLinkRecord, error)
- func (hub *HubStreaming) GetModemConfig(ctx context.Context) (ModemConfiguration, error)
- func (hub *HubStreaming) ModifyAllLinkEntry(ctx context.Context, alCmd ManageAllLinkCommand, flags AllLinkRecordFlags, ...) error
- func (hub *HubStreaming) ReadDB(ctx context.Context, addr uint16) (*DatabaseRecord, error)
- func (hub *HubStreaming) RemoveEventListener(listener EventListener)
- func (hub *HubStreaming) Reset(ctx context.Context) error
- func (hub *HubStreaming) SendExtendedMessage(ctx context.Context, addr Address, imCmd1, imCmd2 byte, userData [14]byte) (CommandResponse, error)
- func (hub *HubStreaming) SendGroupCommand(ctx context.Context, cmd1 byte, group byte) error
- func (hub *HubStreaming) SendMessage(ctx context.Context, addr Address, imCmd1 byte, imCmd2 byte) (CommandResponse, error)
- func (hub *HubStreaming) SendX10(ctx context.Context, raw X10Raw, flags X10Flags) error
- func (hub *HubStreaming) SetCommLogger(logger CommLogger)
- func (hub *HubStreaming) SetDeviceCategory(ctx context.Context, cat Category, sub SubCategory, fw byte) error
- func (hub *HubStreaming) SetLED(ctx context.Context, on bool) error
- func (hub *HubStreaming) SetModemConfig(ctx context.Context, cfg ModemConfiguration) error
- func (hub *HubStreaming) Sleep(ctx context.Context) error
- func (hub *HubStreaming) StartAllLink(ctx context.Context, code LinkCode, group byte) (*AllLinkCompleted, error)
- func (hub *HubStreaming) WriteDB(ctx context.Context, addr uint16, rec *AllLinkRecord) error
- type LinkCode
- type ManageAllLinkCommand
- type ModemConfiguration
- type ModemInfo
- type Product
- type StdCommandResponse
- func (cr *StdCommandResponse) Cmd1() byte
- func (cr *StdCommandResponse) Cmd2() byte
- func (cr *StdCommandResponse) Data() []byte
- func (cr *StdCommandResponse) Flags() CommandResponseFlags
- func (cr *StdCommandResponse) From() Address
- func (cr *StdCommandResponse) ID() byte
- func (cr *StdCommandResponse) Length() int
- func (cr *StdCommandResponse) To() Address
- type SubCategory
- type UserReset
- type X10Command
- type X10Flags
- type X10HouseCode
- type X10Raw
- type X10Response
Constants ¶
const ( StreamingCommandPause = 200 * time.Millisecond ChannelBufferSize = 10 )
const ( LinkCodeResponder = LinkCode(0) LinkCodeController = LinkCode(1) LinkCodeAuto = LinkCode(3) LinkCodeDeleted = LinkCode(0xFF) LinkCodeUnknown = LinkCode(0xFE) )
const ( ButtonEventSetTapped = ButtonEventType(0x02) ButtonEventSetHeld = ButtonEventType(0x03) ButtonEventSetReleased = ButtonEventType(0x04) ButtonEventBtn2Tapped = ButtonEventType(0x12) ButtonEventBtn2Held = ButtonEventType(0x13) ButtonEventBtn2Released = ButtonEventType(0x14) ButtonEventBtn3Tapped = ButtonEventType(0x22) ButtonEventBtn3Held = ButtonEventType(0x23) ButtonEventBtn3Released = ButtonEventType(0x24) ButtonEventUnknown = ButtonEventType(0xFF) )
const ( AllLinkCleanupStatusSuccess = AllLinkCleanupStatus(serialACK) AllLinkCleanupStatusFailure = AllLinkCleanupStatus(serialNAK) AllLinkCleanupStatusUnknown = AllLinkCleanupStatus(0xFF) )
const ( CommandFlagExtended = 0x10 CommandFlagAck = 0x20 CommandFlagGroup = 0x40 CommandFlagBroadcast = 0x80 CommandFlagRetransmitNever = 0x0 CommandFlagRetransmitOnce = 0x1 CommandFlagRetransmitTwice = 0x2 CommandFlagRetransmitMax = 0x3 CommandFlagHopsLeftNone = 0x0 CommandFlagHopsLeftOne = 0x4 CommandFlagHopsLeftTwo = 0x8 CommandFlagHopsLeftThree = 0xC )
const ( CommDirectionHostToIM = iota CommDirectionIMToHost CommDirectionUnknown )
const PLMBaudRate = 19200
Variables ¶
var ( ErrDBEntryNotFound = errors.New("unable to find database entry") ErrDBEntryAlreadyExists = errors.New("database entry for this device already exists") )
var ( // ErrNotReady indicates the Hub received the command but isn't in a state where it's capable of processing it. ErrNotReady = errors.New("device not ready") // ErrAckTimeout indicates we didn't receive an acknowledgement in an appropriate amount of time. ErrAckTimeout = errors.New("ack timeout") )
var ErrUnexpectedAckByte = errors.New("unexpected acknowledgement byte")
Functions ¶
func GetProductDesc ¶
func GetProductDesc(cat Category, sub SubCategory) string
Types ¶
type AllLinkCleanup ¶
type AllLinkCleanup struct {
Status AllLinkCleanupStatus
}
func (*AllLinkCleanup) ID ¶
func (cr *AllLinkCleanup) ID() byte
func (*AllLinkCleanup) Length ¶
func (cr *AllLinkCleanup) Length() int
type AllLinkCleanupFailure ¶
func (*AllLinkCleanupFailure) ID ¶
func (cr *AllLinkCleanupFailure) ID() byte
func (*AllLinkCleanupFailure) Length ¶
func (cr *AllLinkCleanupFailure) Length() int
type AllLinkCleanupStatus ¶
type AllLinkCleanupStatus byte
type AllLinkCompleted ¶
type AllLinkCompleted struct {
LinkCode LinkCode
Group byte
Address Address
Category Category
SubCategory SubCategory
Firmware byte
}
func (*AllLinkCompleted) ID ¶
func (cr *AllLinkCompleted) ID() byte
func (*AllLinkCompleted) Length ¶
func (cr *AllLinkCompleted) Length() int
type AllLinkRecord ¶
type AllLinkRecord struct {
Flags AllLinkRecordFlags
Group byte
Address Address
Data [3]byte
}
func (*AllLinkRecord) ID ¶
func (cr *AllLinkRecord) ID() byte
func (*AllLinkRecord) Length ¶
func (cr *AllLinkRecord) Length() int
type AllLinkRecordFlags ¶
type AllLinkRecordFlags byte
const ( AllLinkRecordFlagsInUse AllLinkRecordFlags = 0x80 AllLinkRecordFlagsContoller AllLinkRecordFlags = 0x40 AllLinkRecordFlagsLast AllLinkRecordFlags = 0x2 )
func (AllLinkRecordFlags) Controller ¶
func (al AllLinkRecordFlags) Controller() bool
func (AllLinkRecordFlags) InUse ¶
func (al AllLinkRecordFlags) InUse() bool
func (AllLinkRecordFlags) Last ¶
func (al AllLinkRecordFlags) Last() bool
func (AllLinkRecordFlags) String ¶
func (al AllLinkRecordFlags) String() string
type ButtonEvent ¶
type ButtonEvent struct {
Event ButtonEventType
}
func (*ButtonEvent) ID ¶
func (cr *ButtonEvent) ID() byte
func (*ButtonEvent) Length ¶
func (cr *ButtonEvent) Length() int
type ButtonEventType ¶
type ButtonEventType byte
type Category ¶
type Category byte
const ( CategoryGeneralController Category = 0x00 CategoryDimmableLighting Category = 0x01 CategorySwitchedLighting Category = 0x02 CategoryNetworkBridge Category = 0x03 CategoryIrrigation Category = 0x04 CategoryClimate Category = 0x05 CategoryPoolAndSpa Category = 0x06 CategorySensorsAndActuators Category = 0x07 CategoryHomeEntertainment Category = 0x08 CategoryEnergyManagement Category = 0x09 CategoryAppliance Category = 0x0A CategoryPlumbing Category = 0x0B CategoryCommunication Category = 0x0C CategoryComputer Category = 0x0D CategoryWindowCovering Category = 0x0E CategoryAccess Category = 0x0F CategorySecurityHealthSafety Category = 0x10 CategorySurveillance Category = 0x11 CategoryAutomotive Category = 0x12 CategoryPetCare Category = 0x13 CategoryToys Category = 0x14 CategoryTimekeeping Category = 0x15 CategoryHoliday Category = 0x16 CategoryReserved Category = 0x17 CategoryUnassigned Category = 0xFF )
type CommDirection ¶
type CommDirection int
func (CommDirection) String ¶
func (cd CommDirection) String() string
type CommLogger ¶
type CommLogger func(CommDirection, []byte)
type CommandFlag ¶
type CommandFlag byte
type CommandResponse ¶
type CommandResponseFlags ¶
type CommandResponseFlags byte
func (CommandResponseFlags) Acknowledgement ¶
func (flags CommandResponseFlags) Acknowledgement() bool
func (CommandResponseFlags) AllLink ¶
func (flags CommandResponseFlags) AllLink() bool
func (CommandResponseFlags) BroadcastNAK ¶
func (flags CommandResponseFlags) BroadcastNAK() bool
func (CommandResponseFlags) Extended ¶
func (flags CommandResponseFlags) Extended() bool
func (CommandResponseFlags) HopsLeft ¶
func (flags CommandResponseFlags) HopsLeft() int
func (CommandResponseFlags) MaxHops ¶
func (flags CommandResponseFlags) MaxHops() int
func (CommandResponseFlags) String ¶
func (flags CommandResponseFlags) String() string
type DatabaseRecord ¶
type DatabaseRecord struct {
MemAddr uint16
Record *AllLinkRecord
}
func (*DatabaseRecord) ID ¶
func (cr *DatabaseRecord) ID() byte
func (*DatabaseRecord) Length ¶
func (cr *DatabaseRecord) Length() int
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device represents an Insteon device.
func (*Device) AddAllLink ¶
func (*Device) DeleteAllLink ¶
func (*Device) GetDatabase ¶
func (*Device) GetOperatingFlags ¶
func (d *Device) GetOperatingFlags(ctx context.Context) (DeviceOpFlags, error)
func (*Device) GetProductData ¶
func (*Device) GetStatus ¶
func (d *Device) GetStatus(ctx context.Context) (*DeviceStatus, error)
GetStatus gets the current power status of the device.
func (*Device) GetStatusChannel ¶
GetStatusChannel gets the current power status of the device.
func (*Device) TurnOffRamp ¶
TurnOffRamp turns off a device with optional ramp.
func (*Device) TurnOnLevel ¶
TurnOnLevel turns on a dimmable device set to a specific level.
func (*Device) TurnOnRamp ¶
TurnOnRamp turns on a device with optional ramp. Ramp only works if the device is dimmable.
type DeviceIdentification ¶
type DeviceOpFlags ¶
type DeviceOpFlags byte
func (DeviceOpFlags) LED ¶
func (f DeviceOpFlags) LED() bool
func (DeviceOpFlags) LEDTransmit ¶
func (f DeviceOpFlags) LEDTransmit() bool
func (DeviceOpFlags) LoadSense ¶
func (f DeviceOpFlags) LoadSense() bool
func (DeviceOpFlags) ProgramLock ¶
func (f DeviceOpFlags) ProgramLock() bool
func (DeviceOpFlags) ResumeDim ¶
func (f DeviceOpFlags) ResumeDim() bool
func (DeviceOpFlags) String ¶
func (f DeviceOpFlags) String() string
type DeviceStatus ¶
type DeviceStatus struct {
// DeviceAddr is the address of the device.
DeviceAddr Address
// ModemAddr is the address of the hub.
ModemAddr Address
// Hop count to the device.
HopCount byte
// Delta of the device.
Delta byte
// Current power level of the device.
Level byte
}
DeviceStatus represents the status of a device.
type EventListener ¶
type ExtCommandResponse ¶
type ExtCommandResponse struct {
StdCommandResponse
// contains filtered or unexported fields
}
func (*ExtCommandResponse) Data ¶
func (cr *ExtCommandResponse) Data() []byte
func (*ExtCommandResponse) ID ¶
func (cr *ExtCommandResponse) ID() byte
func (*ExtCommandResponse) Length ¶
func (cr *ExtCommandResponse) Length() int
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group represents a device grouop.
type Hub ¶
type Hub interface {
// SendMessage sends a standard length message to a remote device connected to the same network as this Hub.
SendMessage(ctx context.Context, addr Address, imCmd1 byte, imCmd2 byte) (CommandResponse, error)
// SendExtendedMessage sends an extended length message to a remote device connected to the same network as this
// Hub.
SendExtendedMessage(ctx context.Context, addr Address, imCmd1, imCmd2 byte, userData [14]byte) (CommandResponse, error)
// Expect indicates that you're interested in waiting for a particular type of event from the Hub. The first event
// with a matching ID will be returned.
Expect(ctx context.Context, evt Event) (Event, error)
// SendX10 sends an X10 message to the network this Hub is connected to.
SendX10(context.Context, X10Raw, X10Flags) error
// SendGroupCommand sends a group command to the network this Hub is connected to.
SendGroupCommand(ctx context.Context, hostCmd byte, group byte) error
// AddEventListener registers a listener interested in events coming from this Hub.
AddEventListener(EventListener)
// RemoveEventListener removes a previously registered EventListener.
RemoveEventListener(EventListener)
// SetCommLogger can be used to intercept the underlying serial communications between the host and this Hub.
SetCommLogger(CommLogger)
// GetInfo gets information about the Hub we're currently communicating with such as the Address, Category,
// SubCategory, and firmware version.
GetInfo(context.Context) (*ModemInfo, error)
// SetDeviceCategory changes the Category, SubCategory, and Firmware Version of this Hub.
SetDeviceCategory(context.Context, Category, SubCategory, byte) error
// Sleep tells the Hub to go into low power mode.
Sleep(context.Context) error
// Reset clears the All-Link database, Modem Configuration, and Hub Information.
Reset(context.Context) error
// GetModemConfig gets the current modem configuration for the Hub we're communicating with.
GetModemConfig(context.Context) (ModemConfiguration, error)
// SetModemConfig sets the modem configuration for the current Hub.
SetModemConfig(context.Context, ModemConfiguration) error
// StartAllLink puts the modem into All-Link mode without requiring the user to press the button on the Hub.
StartAllLink(context.Context, LinkCode, byte) (*AllLinkCompleted, error)
// CancelAllLink removes the modem from All-Link mode.
CancelAllLink(context.Context) error
// ModifyAllLinkEntry modifies a single entry in the Hub's All-Link database.
ModifyAllLinkEntry(context.Context, ManageAllLinkCommand, AllLinkRecordFlags, byte, Address, [3]byte) error
// GetAllLinkDatabase retrieves all entries from the Hub's All-Link database.
GetAllLinkDatabase(context.Context) ([]*AllLinkRecord, error)
// GetLastSender gets the All-Link record of the last Insteon device to communicate with the Hub.
GetLastSender(context.Context) (*AllLinkRecord, error)
// Beep makes the Hub audibly beep.
Beep(context.Context) error
// ReadDB performs a raw read of the Hub's All-Link database.
ReadDB(context.Context, uint16) (*DatabaseRecord, error)
// WriteDB performs a raw write of the Hub's All-Link database.
WriteDB(context.Context, uint16, *AllLinkRecord) error
// SetLED sets the status of the Hub's LED.
SetLED(context.Context, bool) error
}
Hub is an interface that represents functionality that can be performed by any of the Insteon Hub's. A generic implementation is provided by HubStreaming. The underlying serial communication protocol is described in these documents: https://cache.insteon.com/pdf/INSTEON_Modem_Developer%27s_Guide_20071012a.pdf http://cache.insteon.com/developer/2242-222dev-062013-en.pdf
func NewHub2242 ¶
func NewHub2245 ¶
NewHub2245 creates a new reference to an Insteon Hub2. This hub is a little different from the Hub1 and the Serial PLM in that it has an HTTP interface. The interface is a little unfortunate though since you lose bi-directional real time communication, so you end up having to poll for events which makes interfacing to this modem a bit slower.
type Hub2242 ¶
type Hub2242 struct {
*HubStreaming
// contains filtered or unexported fields
}
type Hub2245 ¶
type Hub2245 struct {
*HubStreaming
// contains filtered or unexported fields
}
Hub2245 is a reference to an Insteon Hub.
type HubPLM ¶
type HubPLM struct {
*HubStreaming
// contains filtered or unexported fields
}
type HubStreaming ¶
type HubStreaming struct {
// contains filtered or unexported fields
}
HubStreaming is a generic hub implementation that assumes we have a bi-directional data stream to the PLM modem.
func NewHubStreaming ¶
func NewHubStreaming(stream io.ReadWriteCloser) (*HubStreaming, error)
NewHubStreaming creates a new streaming hub implementation around the passed in stream implementation.
func (*HubStreaming) AddEventListener ¶
func (hub *HubStreaming) AddEventListener(listener EventListener)
func (*HubStreaming) CancelAllLink ¶
func (hub *HubStreaming) CancelAllLink(ctx context.Context) error
func (*HubStreaming) GetAllLinkDatabase ¶
func (hub *HubStreaming) GetAllLinkDatabase(ctx context.Context) ([]*AllLinkRecord, error)
func (*HubStreaming) GetInfo ¶
func (hub *HubStreaming) GetInfo(ctx context.Context) (*ModemInfo, error)
func (*HubStreaming) GetLastSender ¶
func (hub *HubStreaming) GetLastSender(ctx context.Context) (*AllLinkRecord, error)
func (*HubStreaming) GetModemConfig ¶
func (hub *HubStreaming) GetModemConfig(ctx context.Context) (ModemConfiguration, error)
func (*HubStreaming) ModifyAllLinkEntry ¶
func (hub *HubStreaming) ModifyAllLinkEntry(ctx context.Context, alCmd ManageAllLinkCommand, flags AllLinkRecordFlags, group byte, addr Address, data [3]byte) error
func (*HubStreaming) ReadDB ¶
func (hub *HubStreaming) ReadDB(ctx context.Context, addr uint16) (*DatabaseRecord, error)
func (*HubStreaming) RemoveEventListener ¶
func (hub *HubStreaming) RemoveEventListener(listener EventListener)
func (*HubStreaming) SendExtendedMessage ¶
func (hub *HubStreaming) SendExtendedMessage(ctx context.Context, addr Address, imCmd1, imCmd2 byte, userData [14]byte) (CommandResponse, error)
SendExtendedMessage sends an extended length message to a remotes device on the Insteon network.
func (*HubStreaming) SendGroupCommand ¶
func (*HubStreaming) SendMessage ¶
func (hub *HubStreaming) SendMessage(ctx context.Context, addr Address, imCmd1 byte, imCmd2 byte) (CommandResponse, error)
SendMessage sends a standard length message to a remote device on the Insteon network.
func (*HubStreaming) SetCommLogger ¶
func (hub *HubStreaming) SetCommLogger(logger CommLogger)
func (*HubStreaming) SetDeviceCategory ¶
func (hub *HubStreaming) SetDeviceCategory(ctx context.Context, cat Category, sub SubCategory, fw byte) error
func (*HubStreaming) SetModemConfig ¶
func (hub *HubStreaming) SetModemConfig(ctx context.Context, cfg ModemConfiguration) error
func (*HubStreaming) StartAllLink ¶
func (hub *HubStreaming) StartAllLink(ctx context.Context, code LinkCode, group byte) (*AllLinkCompleted, error)
func (*HubStreaming) WriteDB ¶
func (hub *HubStreaming) WriteDB(ctx context.Context, addr uint16, rec *AllLinkRecord) error
type ManageAllLinkCommand ¶
type ManageAllLinkCommand byte
const ( ManageAllLinkFindFirst ManageAllLinkCommand = 0x00 ManageAllLinkFindNext ManageAllLinkCommand = 0x01 ManageAllLinkUpdate ManageAllLinkCommand = 0x20 ManageAllLinkAddController ManageAllLinkCommand = 0x40 ManageAllLinkAddResponder ManageAllLinkCommand = 0x41 ManageAllLinkDelete ManageAllLinkCommand = 0x80 )
type ModemConfiguration ¶
type ModemConfiguration byte
ModemConfiguration is a bitfield describing the current configuration of a PLM.
const ( // ModemConfigurationAutoLink enables automatic linking when the user pushes and holds the SET Button. ModemConfigurationAutoLink ModemConfiguration = 0x80 // ModemConfigurationMonitor puts the modem into Monitor Mode. Monitor mode allows the modem to receive communication // from any device in the Modem's All-Link database regardless of whether or not the message is addressed to the // modem. ModemConfigurationMonitor ModemConfiguration = 0x40 // ModemConfigurationAutoLED enables automatic LED operation. This must be off to use Hub.SetLED(). ModemConfigurationAutoLED ModemConfiguration = 0x20 // ModemConfigurationDeadMan enables dead-man detection for communication between the modem and ourselves. Dead-man // detection will automatically reset communication if commands aren't sent in 240ms. ModemConfigurationDeadMan ModemConfiguration = 0x10 )
func (ModemConfiguration) AutoLED ¶
func (mc ModemConfiguration) AutoLED() bool
AutoLED indicates of the ModemConfigurationAutoLED flag is set on this ModemConfiguration.
func (ModemConfiguration) AutoLink ¶
func (mc ModemConfiguration) AutoLink() bool
AutoLink indicates of the ModemConfigurationAutoLink flag is set on this ModemConfiguration.
func (ModemConfiguration) DeadMan ¶
func (mc ModemConfiguration) DeadMan() bool
DeadMan indicates of the ModemConfigurationDeadMan flag is set on this ModemConfiguration.
func (ModemConfiguration) Monitor ¶
func (mc ModemConfiguration) Monitor() bool
Monitor indicates of the ModemConfigurationMonitor flag is set on this ModemConfiguration.
func (ModemConfiguration) String ¶
func (mc ModemConfiguration) String() string
String describes the state of the modem configuration in a human readable format.
type ModemInfo ¶
type ModemInfo struct {
Address Address
Category Category
SubCategory SubCategory
FirmwareVersion byte
}
ModemInfo describes an Insteon Power Line Modem, typically the Hub you're connected to.
type Product ¶
type Product struct {
Category Category
SubCategory SubCategory
ProductKey uint
Description string
}
type StdCommandResponse ¶
type StdCommandResponse struct {
// contains filtered or unexported fields
}
func (*StdCommandResponse) Cmd1 ¶
func (cr *StdCommandResponse) Cmd1() byte
func (*StdCommandResponse) Cmd2 ¶
func (cr *StdCommandResponse) Cmd2() byte
func (*StdCommandResponse) Data ¶
func (cr *StdCommandResponse) Data() []byte
func (*StdCommandResponse) Flags ¶
func (cr *StdCommandResponse) Flags() CommandResponseFlags
func (*StdCommandResponse) From ¶
func (cr *StdCommandResponse) From() Address
func (*StdCommandResponse) ID ¶
func (cr *StdCommandResponse) ID() byte
func (*StdCommandResponse) Length ¶
func (cr *StdCommandResponse) Length() int
func (*StdCommandResponse) To ¶
func (cr *StdCommandResponse) To() Address
type SubCategory ¶
type SubCategory byte
type X10Command ¶
type X10Command byte
const ( X10CommandAllLightsOff X10Command = 0x0 X10CommandStatusOff X10Command = 0x1 X10CommandOn X10Command = 0x2 X10CommandPresetDim1 X10Command = 0x3 X10CommandAllLightsOn X10Command = 0x4 X10CommandHailAck X10Command = 0x5 X10CommandBright X10Command = 0x6 X10CommandStatusOn X10Command = 0x7 X10CommandExtendedCode X10Command = 0x8 X10CommandStatusReq X10Command = 0x9 X10CommandOff X10Command = 0xA X10CommandPresetDim2 X10Command = 0xB X10CommandAllUnitsOff X10Command = 0xC X10CommandHailReq X10Command = 0xD X10CommandDim X10Command = 0xE X10CommandExtAnalog X10Command = 0xF )
type X10HouseCode ¶
type X10HouseCode byte
const ( X10HouseCodeA X10HouseCode = 0x6 X10HouseCodeB X10HouseCode = 0xE X10HouseCodeC X10HouseCode = 0x2 X10HouseCodeD X10HouseCode = 0xA X10HouseCodeE X10HouseCode = 0x1 X10HouseCodeF X10HouseCode = 0x9 X10HouseCodeG X10HouseCode = 0x5 X10HouseCodeH X10HouseCode = 0xD X10HouseCodeI X10HouseCode = 0x7 X10HouseCodeJ X10HouseCode = 0xF X10HouseCodeK X10HouseCode = 0x3 X10HouseCodeL X10HouseCode = 0xB X10HouseCodeM X10HouseCode = 0x0 X10HouseCodeN X10HouseCode = 0x8 X10HouseCodeO X10HouseCode = 0x4 X10HouseCodeP X10HouseCode = 0xC )
type X10Raw ¶
type X10Raw byte
func (X10Raw) Command ¶
func (x X10Raw) Command() X10Command
func (X10Raw) HouseCode ¶
func (x X10Raw) HouseCode() X10HouseCode
type X10Response ¶
type X10Response struct {
// contains filtered or unexported fields
}
func (*X10Response) ID ¶
func (cr *X10Response) ID() byte
func (*X10Response) Length ¶
func (cr *X10Response) Length() int