mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
Modbus: fix response parsing error for coil write (#2986)
This commit is contained in:
parent
407661d56b
commit
45ebe51e4f
1 changed files with 1 additions and 1 deletions
|
@ -69,7 +69,7 @@ bool Modbus::parse_modbus_byte_(uint8_t byte) {
|
|||
uint8_t data_len = raw[2];
|
||||
uint8_t data_offset = 3;
|
||||
// the response for write command mirrors the requests and data startes at offset 2 instead of 3 for read commands
|
||||
if (function_code == 0x5 || function_code == 0x06 || function_code == 0x10) {
|
||||
if (function_code == 0x5 || function_code == 0x06 || function_code == 0xF || function_code == 0x10) {
|
||||
data_offset = 2;
|
||||
data_len = 4;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue