Use Power as default reading for modbus plugin
This commit is contained in:
parent
f2c607ac58
commit
985a16a91d
1 changed files with 5 additions and 0 deletions
|
|
@ -50,6 +50,11 @@ func NewModbusFromConfig(log *util.Logger, other map[string]interface{}) *Modbus
|
|||
log.FATAL.Fatalf("config: modbus cannot have value and register both")
|
||||
}
|
||||
|
||||
if cc.Value == "" && cc.Register.Decode == "" {
|
||||
log.WARN.Println("config: missing modbus value or register - assuming Power")
|
||||
cc.Value = "Power"
|
||||
}
|
||||
|
||||
// model + value configured
|
||||
if cc.Value != "" {
|
||||
if err := modbus.ParseOperation(device, cc.Value, &op); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue