mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 15:08:10 +01:00
relax max entities checking (#2629)
This commit is contained in:
parent
49b17c5a2d
commit
81c11ba1f7
1 changed files with 3 additions and 1 deletions
|
@ -139,7 +139,9 @@ void Modbus::send(uint8_t address, uint8_t function_code, uint16_t start_address
|
||||||
uint8_t payload_len, const uint8_t *payload) {
|
uint8_t payload_len, const uint8_t *payload) {
|
||||||
static const size_t MAX_VALUES = 128;
|
static const size_t MAX_VALUES = 128;
|
||||||
|
|
||||||
if (number_of_entities > MAX_VALUES) {
|
// Only check max number of registers for standard function codes
|
||||||
|
// Some devices use non standard codes like 0x43
|
||||||
|
if (number_of_entities > MAX_VALUES && function_code <= 0x10) {
|
||||||
ESP_LOGE(TAG, "send too many values %d max=%zu", number_of_entities, MAX_VALUES);
|
ESP_LOGE(TAG, "send too many values %d max=%zu", number_of_entities, MAX_VALUES);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue