Documentation
¶
Overview ¶
To be updated if new logical devices are created
Index ¶
- Constants
- type Appliance
- type Device
- type DeviceManager
- type ISwitch
- func (b *ISwitch) Name() string
- func (b *ISwitch) Notify(code int, d Device)
- func (s *ISwitch) Set(on bool) error
- func (s *ISwitch) SetN(on bool, dps int) error
- func (s *ISwitch) SetNW(on bool, dps int, delay time.Duration) (bool, error)
- func (s *ISwitch) SetW(on bool, delay time.Duration) (bool, error)
- func (s *ISwitch) Status() (bool, error)
- func (s *ISwitch) StatusW(delay time.Duration) (bool, error)
- func (b *ISwitch) Subscribe(c SyncChannel) int64
- func (b *ISwitch) Type() string
- func (b *ISwitch) Unsubscribe(key int64)
- type Switch
- type SyncChannel
- type SyncMsg
Constants ¶
View Source
const ( CodeMsgSet = 7 CodeMsgStatus = 10 CodeMsgPing = 9 CodeMsgAutoStatus = 8 )
Code for tuya messages
View Source
const ( SwitchOff = 0 SwitchOn = 1 SwitchUndetermined = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Appliance ¶
type Appliance struct { Version string // contains filtered or unexported fields }
the appliance proxies the hardware device
func (*Appliance) SendCommand ¶
Send message unencrypted
func (*Appliance) SendEncryptedCommand ¶
-------------------------------
type Device ¶
type Device interface { Type() string Name() string Subscribe(SyncChannel) int64 Unsubscribe(int64) // contains filtered or unexported methods }
type DeviceManager ¶
func NewDeviceManager ¶
func NewDeviceManager(jdata string) *DeviceManager
func (*DeviceManager) ApplianceCount ¶
func (dm *DeviceManager) ApplianceCount() int
-------------------------------------------
func (*DeviceManager) ApplianceKeys ¶
func (dm *DeviceManager) ApplianceKeys() []string
-------------------------------------------
func (*DeviceManager) DeviceKeys ¶
func (dm *DeviceManager) DeviceKeys() []string
-------------------------------------------
func (*DeviceManager) GetAppliance ¶
func (dm *DeviceManager) GetAppliance(key string) (*Appliance, bool)
-------------------------------------------
type ISwitch ¶
type ISwitch struct {
// contains filtered or unexported fields
}
func (*ISwitch) Subscribe ¶
func (b *ISwitch) Subscribe(c SyncChannel) int64
func (*ISwitch) Type ¶
func (b *ISwitch) Type() string
Implementation of Device interface provided by baseDevice
func (*ISwitch) Unsubscribe ¶
func (b *ISwitch) Unsubscribe(key int64)
type SyncChannel ¶
type SyncChannel chan SyncMsg
func MakeSyncChannel ¶
func MakeSyncChannel() SyncChannel
Source Files
¶
Click to show internal directories.
Click to hide internal directories.