Skip to content

Commit 122c3d9

Browse files
committed
Apply linter
1 parent 016164d commit 122c3d9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

components/victron/victron.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#include <algorithm> // std::min
44
#include "esphome/core/helpers.h"
55

6-
#define MAX_LABEL_LENGTH 9
6+
#define MAX_LABEL_LENGTH 9
77
#define MAX_VALUE_LENGTH 33
8-
#define MAX_FIELDS_PER_BLOCK 30 // allow for some headroom over the 22 according to protocol specs
8+
#define MAX_FIELDS_PER_BLOCK 30 // allow for some headroom over the 22 according to protocol specs
99

1010
#define MAX_BUF_SIZE ((2 + MAX_LABEL_LENGTH + 1 + MAX_VALUE_LENGTH) * MAX_FIELDS_PER_BLOCK)
1111

@@ -107,7 +107,7 @@ void VictronComponent::loop() {
107107
while (available()) {
108108
uint8_t c;
109109
read_byte(&c);
110-
checksum_ = (checksum_ + c) & 0xff;
110+
checksum_ = (checksum_ + c) & 0xff;
111111
if (state_ == 0) {
112112
if (c == '\r' || c == '\n') {
113113
continue;
@@ -163,7 +163,7 @@ void VictronComponent::loop() {
163163
if (c == '\r' || c == '\n') {
164164
// a hex frame ends with '\n' and has its own checksum; prepare to receive another text frame
165165
state_ = 0;
166-
checksum_ = 0;
166+
checksum_ = 0;
167167
}
168168
}
169169
}
@@ -745,11 +745,11 @@ void VictronComponent::publish_frame_() {
745745
return;
746746
}
747747
this->last_publish_ = now;
748-
749-
size_t last = 0;
750-
size_t next = 0;
748+
749+
size_t last = 0;
750+
size_t next = 0;
751751
while ((next = frame_buffer_.find("\r\n", last)) != std::string::npos) {
752-
std::string item = frame_buffer_.substr(last, next-last);
752+
std::string item = frame_buffer_.substr(last, next - last);
753753
last = next + 2;
754754
if (item.size() == 0) {
755755
continue;
@@ -759,7 +759,7 @@ void VictronComponent::publish_frame_() {
759759
continue;
760760
}
761761
label_ = item.substr(0, dpos);
762-
value_ = item.substr(dpos+1);
762+
value_ = item.substr(dpos + 1);
763763
ESP_LOGD(TAG, "Handle %s value %s", label_.c_str(), value_.c_str());
764764
handle_value_();
765765
}

0 commit comments

Comments
 (0)