Documentation ¶
Index ¶
- type Connection
- type Controller
- type MQTT
- type MQTTNotifier
- func (m *MQTTNotifier) UpdateAction(action string)
- func (m *MQTTNotifier) UpdateAttributes(attributes map[string]string)
- func (m *MQTTNotifier) UpdateCurrentTemperature(temperature string)
- func (m *MQTTNotifier) UpdateFanMode(fanMode string)
- func (m *MQTTNotifier) UpdateOpMode(opMode string)
- func (m *MQTTNotifier) UpdateTemperature(temperature string)
- type Receiver
- type StateNotifier
- type TLSSocketConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface { // Connect initiates connection and starts is message loop, delivering all received messages to receiver. Connect(host, port string, receiver Receiver) // ExpectRead tells connection that a read is imminent, so it knows there is trouble if not received in time. ExpectRead() // SendMessage tells connection to send the given message. SendMessage(message []byte) }
func NewTLSSocketConnection ¶
func NewTLSSocketConnection() Connection
type Controller ¶
type Controller interface { SetStateNotifier(stateNotifier StateNotifier) Connect() SetPowerMode(powerMode string) SetOpMode(mode string) SetFanMode(fanMode string) SetTemperature(temperature string) }
type MQTT ¶
type MQTT struct {
// contains filtered or unexported fields
}
func (*MQTT) RegisterController ¶
func (m *MQTT) RegisterController(id string, prefix string, controller Controller) StateNotifier
type MQTTNotifier ¶
type MQTTNotifier struct {
// contains filtered or unexported fields
}
func (*MQTTNotifier) UpdateAction ¶
func (m *MQTTNotifier) UpdateAction(action string)
func (*MQTTNotifier) UpdateAttributes ¶
func (m *MQTTNotifier) UpdateAttributes(attributes map[string]string)
func (*MQTTNotifier) UpdateCurrentTemperature ¶
func (m *MQTTNotifier) UpdateCurrentTemperature(temperature string)
func (*MQTTNotifier) UpdateFanMode ¶
func (m *MQTTNotifier) UpdateFanMode(fanMode string)
func (*MQTTNotifier) UpdateOpMode ¶
func (m *MQTTNotifier) UpdateOpMode(opMode string)
func (*MQTTNotifier) UpdateTemperature ¶
func (m *MQTTNotifier) UpdateTemperature(temperature string)
type StateNotifier ¶
type TLSSocketConnection ¶
type TLSSocketConnection struct {
// contains filtered or unexported fields
}
TLSSocketConnection runs a persistent connection over TLS socket, trying to reconnect on failures.
func (*TLSSocketConnection) Connect ¶
func (c *TLSSocketConnection) Connect(host, port string, receiver Receiver)
func (*TLSSocketConnection) ExpectRead ¶
func (c *TLSSocketConnection) ExpectRead()
We know that a message should arrive. Will fail and retry connection if not.
func (*TLSSocketConnection) SendMessage ¶
func (c *TLSSocketConnection) SendMessage(message []byte)
Click to show internal directories.
Click to hide internal directories.