Documentation
¶
Index ¶
- Constants
- type BaseResponse
- type DevCommandConfig
- type DevCommandRequest
- type DevCommandResponse
- type DevModBusRequest
- type DevModBusResponse
- type DevModBusRtuConfig
- type DevModBusTcpConfig
- type DevMqttConfig
- type DevMqttRequest
- type DevMqttResponse
- type DevSmartBusConfig
- type DevSmartBusRequest
- type DevSmartBusResponse
- type DevZigbee2mqttConfig
- type DevZigbee2mqttRequest
- type DevZigbee2mqttResponse
- type ModBusBind
- type MqttBind
- type RunCommandBind
- type Zigbee2mqttBind
Constants ¶
View Source
const ( DevTypeModbusRtu = DeviceType("modbus_rtu") DevTypeModbusTcp = DeviceType("modbus_tcp") // bit access ReadCoils = "ReadCoils" ReadDiscreteInputs = "ReadDiscreteInputs" WriteSingleCoil = "WriteSingleCoil" WriteMultipleCoils = "WriteMultipleCoils" // 16-bit access ReadInputRegisters = "ReadInputRegisters" ReadHoldingRegisters = "ReadHoldingRegisters" ReadWriteMultipleRegisters = "ReadWriteMultipleRegisters" WriteSingleRegister = "WriteSingleRegister" WriteMultipleRegisters = "WriteMultipleRegisters" )
View Source
const (
DevTypeCommand = DeviceType("command")
)
View Source
const (
DevTypeDefault = DeviceType("default")
)
View Source
const (
DevTypeMqtt = DeviceType("mqtt")
)
View Source
const (
DevTypeSmartBus = DeviceType("smartbus")
)
View Source
const (
DevTypeZigbee2mqtt = DeviceType("zigbee2mqtt")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseResponse ¶
type DevCommandConfig ¶
type DevCommandConfig struct {
Validation
}
type DevCommandRequest ¶
type DevCommandResponse ¶
type DevCommandResponse struct {
BaseResponse
Result string `json:"result"`
}
type DevModBusRequest ¶
type DevModBusResponse ¶
type DevModBusResponse struct {
BaseResponse
Result []uint16 `json:"result"`
}
params: result error time
type DevModBusRtuConfig ¶ added in v0.0.19
type DevModBusRtuConfig struct {
Validation
SlaveId int `json:"slave_id" mapstructure:"slave_id"` // 1-32
Baud int `json:"baud"` // 9600, 19200, ...
DataBits int `json:"data_bits" mapstructure:"data_bits"` // 5-9
StopBits int `json:"stop_bits" mapstructure:"stop_bits"` // 1, 2
Parity string `json:"parity"` // none, odd, even
Timeout int `json:"timeout"` // milliseconds
}
type DevModBusTcpConfig ¶ added in v0.0.19
type DevMqttConfig ¶ added in v0.0.19
type DevMqttConfig struct {
Validation
Address string `json:"address"`
}
type DevMqttRequest ¶ added in v0.0.19
type DevMqttResponse ¶ added in v0.2.0
type DevMqttResponse struct {
BaseResponse
}
params: result error time
type DevSmartBusConfig ¶
type DevSmartBusRequest ¶
type DevSmartBusRequest struct {
Command []byte `json:"command"`
}
type DevSmartBusResponse ¶
type DevSmartBusResponse struct {
BaseResponse
Result []byte `json:"result"`
}
type DevZigbee2mqttConfig ¶ added in v0.2.0
type DevZigbee2mqttConfig struct {
Validation
Zigbee2mqttDeviceId string `json:"zigbee2mqtt_device_id"`
}
type DevZigbee2mqttRequest ¶ added in v0.2.0
type DevZigbee2mqttResponse ¶ added in v0.2.0
type DevZigbee2mqttResponse struct {
BaseResponse
}
params: result error time
type ModBusBind ¶ added in v0.2.0
func NewModBusBind ¶ added in v0.2.0
func NewModBusBind(f string, address, count uint16, command []uint16) ModBusBind
Javascript Binding
ModBus(func, address, count, command)
type MqttBind ¶ added in v0.2.0
type RunCommandBind ¶ added in v0.2.0
func NewRunCommandBind ¶ added in v0.2.0
func NewRunCommandBind(name string, args []string) RunCommandBind
Javascript Binding
RunCommand(name, args)
type Zigbee2mqttBind ¶ added in v0.2.0
func NewZigbee2mqttBind ¶ added in v0.2.0
func NewZigbee2mqttBind(path string, payload string) Zigbee2mqttBind
Javascript Binding
Zigbee2mqtt(path, payload)
Click to show internal directories.
Click to hide internal directories.