Modbus: use context (#19301)

This commit is contained in:
andig 2025-03-01 19:13:41 +01:00 • committed by GitHub
parent 766a6f6b2b
commit 45623bfa15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 241 additions and 183 deletions

View file

@ -45,7 +45,7 @@ func NewModbusFromConfig(ctx context.Context, other map[string]interface{}) (Plu
modbus.Lock()
defer modbus.Unlock()
conn, err := modbus.NewConnection(cc.URI, cc.Device, cc.Comset, cc.Baudrate, cc.Settings.Protocol(), cc.ID)
conn, err := modbus.NewConnection(ctx, cc.URI, cc.Device, cc.Comset, cc.Baudrate, cc.Settings.Protocol(), cc.ID)
if err != nil {
return nil, err
}