Enable a bunch of clang-tidy checks (#2149)

This commit is contained in:
Oxan van Leeuwen
2021-12-01 21:03:51 +01:00
committed by GitHub
parent f58828cb82
commit 607601b3a4
79 changed files with 206 additions and 296 deletions
+1 -7
View File
@@ -5,11 +5,8 @@ Checks: >-
-altera-*, -altera-*,
-android-*, -android-*,
-boost-*, -boost-*,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-narrowing-conversions, -bugprone-narrowing-conversions,
-bugprone-signed-char-misuse, -bugprone-signed-char-misuse,
-bugprone-too-small-loop-variable,
-cert-dcl50-cpp, -cert-dcl50-cpp,
-cert-err58-cpp, -cert-err58-cpp,
-cert-oop57-cpp, -cert-oop57-cpp,
@@ -19,12 +16,10 @@ Checks: >-
-clang-diagnostic-delete-abstract-non-virtual-dtor, -clang-diagnostic-delete-abstract-non-virtual-dtor,
-clang-diagnostic-delete-non-abstract-non-virtual-dtor, -clang-diagnostic-delete-non-abstract-non-virtual-dtor,
-clang-diagnostic-shadow-field, -clang-diagnostic-shadow-field,
-clang-diagnostic-sign-compare,
-clang-diagnostic-unused-variable,
-clang-diagnostic-unused-const-variable, -clang-diagnostic-unused-const-variable,
-clang-diagnostic-unused-parameter,
-concurrency-*, -concurrency-*,
-cppcoreguidelines-avoid-c-arrays, -cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-goto,
-cppcoreguidelines-avoid-magic-numbers, -cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-init-variables, -cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-usage, -cppcoreguidelines-macro-usage,
@@ -41,7 +36,6 @@ Checks: >-
-cppcoreguidelines-pro-type-union-access, -cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg, -cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions, -cppcoreguidelines-special-member-functions,
-fuchsia-default-arguments,
-fuchsia-multiple-inheritance, -fuchsia-multiple-inheritance,
-fuchsia-overloaded-operator, -fuchsia-overloaded-operator,
-fuchsia-statically-constructed-objects, -fuchsia-statically-constructed-objects,
@@ -25,7 +25,7 @@ void AdalightLightEffect::stop() {
AddressableLightEffect::stop(); AddressableLightEffect::stop();
} }
int AdalightLightEffect::get_frame_size_(int led_count) const { unsigned int AdalightLightEffect::get_frame_size_(int led_count) const {
// 3 bytes: Ada // 3 bytes: Ada
// 2 bytes: LED count // 2 bytes: LED count
// 1 byte: checksum // 1 byte: checksum
@@ -25,7 +25,7 @@ class AdalightLightEffect : public light::AddressableLightEffect, public uart::U
CONSUMED, CONSUMED,
}; };
int get_frame_size_(int led_count) const; unsigned int get_frame_size_(int led_count) const;
void reset_frame_(light::AddressableLight &it); void reset_frame_(light::AddressableLight &it);
void blank_all_leds_(light::AddressableLight &it); void blank_all_leds_(light::AddressableLight &it);
Frame parse_frame_(light::AddressableLight &it); Frame parse_frame_(light::AddressableLight &it);
+2 -2
View File
@@ -110,12 +110,12 @@ void AHT10Component::update() {
uint32_t raw_temperature = ((data[3] & 0x0F) << 16) | (data[4] << 8) | data[5]; uint32_t raw_temperature = ((data[3] & 0x0F) << 16) | (data[4] << 8) | data[5];
uint32_t raw_humidity = ((data[1] << 16) | (data[2] << 8) | data[3]) >> 4; uint32_t raw_humidity = ((data[1] << 16) | (data[2] << 8) | data[3]) >> 4;
float temperature = ((200.0 * (float) raw_temperature) / 1048576.0) - 50.0; float temperature = ((200.0f * (float) raw_temperature) / 1048576.0f) - 50.0f;
float humidity; float humidity;
if (raw_humidity == 0) { // unrealistic value if (raw_humidity == 0) { // unrealistic value
humidity = NAN; humidity = NAN;
} else { } else {
humidity = (float) raw_humidity * 100.0 / 1048576.0; humidity = (float) raw_humidity * 100.0f / 1048576.0f;
} }
if (this->temperature_sensor_ != nullptr) { if (this->temperature_sensor_ != nullptr) {
+2 -2
View File
@@ -38,9 +38,9 @@ void AM2320Component::update() {
return; return;
} }
float temperature = (((data[4] & 0x7F) << 8) + data[5]) / 10.0; float temperature = (((data[4] & 0x7F) << 8) + data[5]) / 10.0f;
temperature = (data[4] & 0x80) ? -temperature : temperature; temperature = (data[4] & 0x80) ? -temperature : temperature;
float humidity = ((data[2] << 8) + data[3]) / 10.0; float humidity = ((data[2] << 8) + data[3]) / 10.0f;
ESP_LOGD(TAG, "Got temperature=%.1f°C humidity=%.1f%%", temperature, humidity); ESP_LOGD(TAG, "Got temperature=%.1f°C humidity=%.1f%%", temperature, humidity);
if (this->temperature_sensor_ != nullptr) if (this->temperature_sensor_ != nullptr)
+1 -7
View File
@@ -103,13 +103,7 @@ void AnovaCodec::decode(const uint8_t *data, uint16_t length) {
} }
break; break;
} }
case READ_TARGET_TEMPERATURE: { case READ_TARGET_TEMPERATURE:
this->target_temp_ = parse_number<float>(str_until(buf, '\r')).value_or(0.0f);
if (this->fahrenheit_)
this->target_temp_ = ftoc(this->target_temp_);
this->has_target_temp_ = true;
break;
}
case SET_TARGET_TEMPERATURE: { case SET_TARGET_TEMPERATURE: {
this->target_temp_ = parse_number<float>(str_until(buf, '\r')).value_or(0.0f); this->target_temp_ = parse_number<float>(str_until(buf, '\r')).value_or(0.0f);
if (this->fahrenheit_) if (this->fahrenheit_)
+1 -1
View File
@@ -132,7 +132,7 @@ void APIConnection::loop() {
if (state_subs_at_ != -1) { if (state_subs_at_ != -1) {
const auto &subs = this->parent_->get_state_subs(); const auto &subs = this->parent_->get_state_subs();
if (state_subs_at_ >= subs.size()) { if (state_subs_at_ >= (int) subs.size()) {
state_subs_at_ = -1; state_subs_at_ = -1;
} else { } else {
auto &it = subs[state_subs_at_]; auto &it = subs[state_subs_at_];
+5 -17
View File
@@ -174,9 +174,6 @@ APIError APINoiseFrameHelper::loop() {
* errno API_ERROR_HANDSHAKE_PACKET_LEN: Packet too big for this phase. * errno API_ERROR_HANDSHAKE_PACKET_LEN: Packet too big for this phase.
*/ */
APIError APINoiseFrameHelper::try_read_frame_(ParsedFrame *frame) { APIError APINoiseFrameHelper::try_read_frame_(ParsedFrame *frame) {
int err;
APIError aerr;
if (frame == nullptr) { if (frame == nullptr) {
HELPER_LOG("Bad argument for try_read_frame_"); HELPER_LOG("Bad argument for try_read_frame_");
return APIError::BAD_ARG; return APIError::BAD_ARG;
@@ -200,7 +197,7 @@ APIError APINoiseFrameHelper::try_read_frame_(ParsedFrame *frame) {
return APIError::CONNECTION_CLOSED; return APIError::CONNECTION_CLOSED;
} }
rx_header_buf_len_ += received; rx_header_buf_len_ += received;
if (received != to_read) { if ((size_t) received != to_read) {
// not a full read // not a full read
return APIError::WOULD_BLOCK; return APIError::WOULD_BLOCK;
} }
@@ -247,7 +244,7 @@ APIError APINoiseFrameHelper::try_read_frame_(ParsedFrame *frame) {
return APIError::CONNECTION_CLOSED; return APIError::CONNECTION_CLOSED;
} }
rx_buf_len_ += received; rx_buf_len_ += received;
if (received != to_read) { if ((size_t) received != to_read) {
// not all read // not all read
return APIError::WOULD_BLOCK; return APIError::WOULD_BLOCK;
} }
@@ -544,7 +541,6 @@ APIError APINoiseFrameHelper::try_send_tx_buf_() {
APIError APINoiseFrameHelper::write_raw_(const struct iovec *iov, int iovcnt) { APIError APINoiseFrameHelper::write_raw_(const struct iovec *iov, int iovcnt) {
if (iovcnt == 0) if (iovcnt == 0)
return APIError::OK; return APIError::OK;
int err;
APIError aerr; APIError aerr;
size_t total_write_len = 0; size_t total_write_len = 0;
@@ -584,7 +580,7 @@ APIError APINoiseFrameHelper::write_raw_(const struct iovec *iov, int iovcnt) {
state_ = State::FAILED; state_ = State::FAILED;
HELPER_LOG("Socket write failed with errno %d", errno); HELPER_LOG("Socket write failed with errno %d", errno);
return APIError::SOCKET_WRITE_FAILED; return APIError::SOCKET_WRITE_FAILED;
} else if (sent != total_write_len) { } else if ((size_t) sent != total_write_len) {
// partially sent, add end to tx_buf // partially sent, add end to tx_buf
size_t to_consume = sent; size_t to_consume = sent;
for (int i = 0; i < iovcnt; i++) { for (int i = 0; i < iovcnt; i++) {
@@ -778,9 +774,6 @@ APIError APIPlaintextFrameHelper::loop() {
* error API_ERROR_BAD_INDICATOR: Bad indicator byte at start of frame. * error API_ERROR_BAD_INDICATOR: Bad indicator byte at start of frame.
*/ */
APIError APIPlaintextFrameHelper::try_read_frame_(ParsedFrame *frame) { APIError APIPlaintextFrameHelper::try_read_frame_(ParsedFrame *frame) {
int err;
APIError aerr;
if (frame == nullptr) { if (frame == nullptr) {
HELPER_LOG("Bad argument for try_read_frame_"); HELPER_LOG("Bad argument for try_read_frame_");
return APIError::BAD_ARG; return APIError::BAD_ARG;
@@ -854,7 +847,7 @@ APIError APIPlaintextFrameHelper::try_read_frame_(ParsedFrame *frame) {
return APIError::CONNECTION_CLOSED; return APIError::CONNECTION_CLOSED;
} }
rx_buf_len_ += received; rx_buf_len_ += received;
if (received != to_read) { if ((size_t) received != to_read) {
// not all read // not all read
return APIError::WOULD_BLOCK; return APIError::WOULD_BLOCK;
} }
@@ -874,7 +867,6 @@ APIError APIPlaintextFrameHelper::try_read_frame_(ParsedFrame *frame) {
} }
APIError APIPlaintextFrameHelper::read_packet(ReadPacketBuffer *buffer) { APIError APIPlaintextFrameHelper::read_packet(ReadPacketBuffer *buffer) {
int err;
APIError aerr; APIError aerr;
if (state_ != State::DATA) { if (state_ != State::DATA) {
@@ -894,9 +886,6 @@ APIError APIPlaintextFrameHelper::read_packet(ReadPacketBuffer *buffer) {
} }
bool APIPlaintextFrameHelper::can_write_without_blocking() { return state_ == State::DATA && tx_buf_.empty(); } bool APIPlaintextFrameHelper::can_write_without_blocking() { return state_ == State::DATA && tx_buf_.empty(); }
APIError APIPlaintextFrameHelper::write_packet(uint16_t type, const uint8_t *payload, size_t payload_len) { APIError APIPlaintextFrameHelper::write_packet(uint16_t type, const uint8_t *payload, size_t payload_len) {
int err;
APIError aerr;
if (state_ != State::DATA) { if (state_ != State::DATA) {
return APIError::BAD_STATE; return APIError::BAD_STATE;
} }
@@ -940,7 +929,6 @@ APIError APIPlaintextFrameHelper::try_send_tx_buf_() {
APIError APIPlaintextFrameHelper::write_raw_(const struct iovec *iov, int iovcnt) { APIError APIPlaintextFrameHelper::write_raw_(const struct iovec *iov, int iovcnt) {
if (iovcnt == 0) if (iovcnt == 0)
return APIError::OK; return APIError::OK;
int err;
APIError aerr; APIError aerr;
size_t total_write_len = 0; size_t total_write_len = 0;
@@ -980,7 +968,7 @@ APIError APIPlaintextFrameHelper::write_raw_(const struct iovec *iov, int iovcnt
state_ = State::FAILED; state_ = State::FAILED;
HELPER_LOG("Socket write failed with errno %d", errno); HELPER_LOG("Socket write failed with errno %d", errno);
return APIError::SOCKET_WRITE_FAILED; return APIError::SOCKET_WRITE_FAILED;
} else if (sent != total_write_len) { } else if ((size_t) sent != total_write_len) {
// partially sent, add end to tx_buf // partially sent, add end to tx_buf
size_t to_consume = sent; size_t to_consume = sent;
for (int i = 0; i < iovcnt; i++) { for (int i = 0; i < iovcnt; i++) {
+46 -46
View File
@@ -291,7 +291,7 @@ bool HelloRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value)
void HelloRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_string(1, this->client_info); } void HelloRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_string(1, this->client_info); }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void HelloRequest::dump_to(std::string &out) const { void HelloRequest::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("HelloRequest {\n"); out.append("HelloRequest {\n");
out.append(" client_info: "); out.append(" client_info: ");
out.append("'").append(this->client_info).append("'"); out.append("'").append(this->client_info).append("'");
@@ -330,7 +330,7 @@ void HelloResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void HelloResponse::dump_to(std::string &out) const { void HelloResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("HelloResponse {\n"); out.append("HelloResponse {\n");
out.append(" api_version_major: "); out.append(" api_version_major: ");
sprintf(buffer, "%u", this->api_version_major); sprintf(buffer, "%u", this->api_version_major);
@@ -361,7 +361,7 @@ bool ConnectRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value
void ConnectRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_string(1, this->password); } void ConnectRequest::encode(ProtoWriteBuffer buffer) const { buffer.encode_string(1, this->password); }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ConnectRequest::dump_to(std::string &out) const { void ConnectRequest::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ConnectRequest {\n"); out.append("ConnectRequest {\n");
out.append(" password: "); out.append(" password: ");
out.append("'").append(this->password).append("'"); out.append("'").append(this->password).append("'");
@@ -382,7 +382,7 @@ bool ConnectResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
void ConnectResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->invalid_password); } void ConnectResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->invalid_password); }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ConnectResponse::dump_to(std::string &out) const { void ConnectResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ConnectResponse {\n"); out.append("ConnectResponse {\n");
out.append(" invalid_password: "); out.append(" invalid_password: ");
out.append(YESNO(this->invalid_password)); out.append(YESNO(this->invalid_password));
@@ -476,7 +476,7 @@ void DeviceInfoResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void DeviceInfoResponse::dump_to(std::string &out) const { void DeviceInfoResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("DeviceInfoResponse {\n"); out.append("DeviceInfoResponse {\n");
out.append(" uses_password: "); out.append(" uses_password: ");
out.append(YESNO(this->uses_password)); out.append(YESNO(this->uses_password));
@@ -600,7 +600,7 @@ void ListEntitiesBinarySensorResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesBinarySensorResponse::dump_to(std::string &out) const { void ListEntitiesBinarySensorResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesBinarySensorResponse {\n"); out.append("ListEntitiesBinarySensorResponse {\n");
out.append(" object_id: "); out.append(" object_id: ");
out.append("'").append(this->object_id).append("'"); out.append("'").append(this->object_id).append("'");
@@ -672,7 +672,7 @@ void BinarySensorStateResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void BinarySensorStateResponse::dump_to(std::string &out) const { void BinarySensorStateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("BinarySensorStateResponse {\n"); out.append("BinarySensorStateResponse {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -766,7 +766,7 @@ void ListEntitiesCoverResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesCoverResponse::dump_to(std::string &out) const { void ListEntitiesCoverResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesCoverResponse {\n"); out.append("ListEntitiesCoverResponse {\n");
out.append(" object_id: "); out.append(" object_id: ");
out.append("'").append(this->object_id).append("'"); out.append("'").append(this->object_id).append("'");
@@ -856,7 +856,7 @@ void CoverStateResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void CoverStateResponse::dump_to(std::string &out) const { void CoverStateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("CoverStateResponse {\n"); out.append("CoverStateResponse {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -939,7 +939,7 @@ void CoverCommandRequest::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void CoverCommandRequest::dump_to(std::string &out) const { void CoverCommandRequest::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("CoverCommandRequest {\n"); out.append("CoverCommandRequest {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -1055,7 +1055,7 @@ void ListEntitiesFanResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesFanResponse::dump_to(std::string &out) const { void ListEntitiesFanResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesFanResponse {\n"); out.append("ListEntitiesFanResponse {\n");
out.append(" object_id: "); out.append(" object_id: ");
out.append("'").append(this->object_id).append("'"); out.append("'").append(this->object_id).append("'");
@@ -1151,7 +1151,7 @@ void FanStateResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void FanStateResponse::dump_to(std::string &out) const { void FanStateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("FanStateResponse {\n"); out.append("FanStateResponse {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -1252,7 +1252,7 @@ void FanCommandRequest::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void FanCommandRequest::dump_to(std::string &out) const { void FanCommandRequest::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("FanCommandRequest {\n"); out.append("FanCommandRequest {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -1403,7 +1403,7 @@ void ListEntitiesLightResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesLightResponse::dump_to(std::string &out) const { void ListEntitiesLightResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesLightResponse {\n"); out.append("ListEntitiesLightResponse {\n");
out.append(" object_id: "); out.append(" object_id: ");
out.append("'").append(this->object_id).append("'"); out.append("'").append(this->object_id).append("'");
@@ -1561,7 +1561,7 @@ void LightStateResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void LightStateResponse::dump_to(std::string &out) const { void LightStateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("LightStateResponse {\n"); out.append("LightStateResponse {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -1784,7 +1784,7 @@ void LightCommandRequest::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void LightCommandRequest::dump_to(std::string &out) const { void LightCommandRequest::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("LightCommandRequest {\n"); out.append("LightCommandRequest {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -1995,7 +1995,7 @@ void ListEntitiesSensorResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesSensorResponse::dump_to(std::string &out) const { void ListEntitiesSensorResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesSensorResponse {\n"); out.append("ListEntitiesSensorResponse {\n");
out.append(" object_id: "); out.append(" object_id: ");
out.append("'").append(this->object_id).append("'"); out.append("'").append(this->object_id).append("'");
@@ -2084,7 +2084,7 @@ void SensorStateResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void SensorStateResponse::dump_to(std::string &out) const { void SensorStateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("SensorStateResponse {\n"); out.append("SensorStateResponse {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -2164,7 +2164,7 @@ void ListEntitiesSwitchResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesSwitchResponse::dump_to(std::string &out) const { void ListEntitiesSwitchResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesSwitchResponse {\n"); out.append("ListEntitiesSwitchResponse {\n");
out.append(" object_id: "); out.append(" object_id: ");
out.append("'").append(this->object_id).append("'"); out.append("'").append(this->object_id).append("'");
@@ -2227,7 +2227,7 @@ void SwitchStateResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void SwitchStateResponse::dump_to(std::string &out) const { void SwitchStateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("SwitchStateResponse {\n"); out.append("SwitchStateResponse {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -2266,7 +2266,7 @@ void SwitchCommandRequest::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void SwitchCommandRequest::dump_to(std::string &out) const { void SwitchCommandRequest::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("SwitchCommandRequest {\n"); out.append("SwitchCommandRequest {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -2336,7 +2336,7 @@ void ListEntitiesTextSensorResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesTextSensorResponse::dump_to(std::string &out) const { void ListEntitiesTextSensorResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesTextSensorResponse {\n"); out.append("ListEntitiesTextSensorResponse {\n");
out.append(" object_id: "); out.append(" object_id: ");
out.append("'").append(this->object_id).append("'"); out.append("'").append(this->object_id).append("'");
@@ -2406,7 +2406,7 @@ void TextSensorStateResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void TextSensorStateResponse::dump_to(std::string &out) const { void TextSensorStateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("TextSensorStateResponse {\n"); out.append("TextSensorStateResponse {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -2443,7 +2443,7 @@ void SubscribeLogsRequest::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void SubscribeLogsRequest::dump_to(std::string &out) const { void SubscribeLogsRequest::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("SubscribeLogsRequest {\n"); out.append("SubscribeLogsRequest {\n");
out.append(" level: "); out.append(" level: ");
out.append(proto_enum_to_string<enums::LogLevel>(this->level)); out.append(proto_enum_to_string<enums::LogLevel>(this->level));
@@ -2486,7 +2486,7 @@ void SubscribeLogsResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void SubscribeLogsResponse::dump_to(std::string &out) const { void SubscribeLogsResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("SubscribeLogsResponse {\n"); out.append("SubscribeLogsResponse {\n");
out.append(" level: "); out.append(" level: ");
out.append(proto_enum_to_string<enums::LogLevel>(this->level)); out.append(proto_enum_to_string<enums::LogLevel>(this->level));
@@ -2528,7 +2528,7 @@ void HomeassistantServiceMap::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void HomeassistantServiceMap::dump_to(std::string &out) const { void HomeassistantServiceMap::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("HomeassistantServiceMap {\n"); out.append("HomeassistantServiceMap {\n");
out.append(" key: "); out.append(" key: ");
out.append("'").append(this->key).append("'"); out.append("'").append(this->key).append("'");
@@ -2587,7 +2587,7 @@ void HomeassistantServiceResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void HomeassistantServiceResponse::dump_to(std::string &out) const { void HomeassistantServiceResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("HomeassistantServiceResponse {\n"); out.append("HomeassistantServiceResponse {\n");
out.append(" service: "); out.append(" service: ");
out.append("'").append(this->service).append("'"); out.append("'").append(this->service).append("'");
@@ -2643,7 +2643,7 @@ void SubscribeHomeAssistantStateResponse::encode(ProtoWriteBuffer buffer) const
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void SubscribeHomeAssistantStateResponse::dump_to(std::string &out) const { void SubscribeHomeAssistantStateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("SubscribeHomeAssistantStateResponse {\n"); out.append("SubscribeHomeAssistantStateResponse {\n");
out.append(" entity_id: "); out.append(" entity_id: ");
out.append("'").append(this->entity_id).append("'"); out.append("'").append(this->entity_id).append("'");
@@ -2680,7 +2680,7 @@ void HomeAssistantStateResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void HomeAssistantStateResponse::dump_to(std::string &out) const { void HomeAssistantStateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("HomeAssistantStateResponse {\n"); out.append("HomeAssistantStateResponse {\n");
out.append(" entity_id: "); out.append(" entity_id: ");
out.append("'").append(this->entity_id).append("'"); out.append("'").append(this->entity_id).append("'");
@@ -2713,7 +2713,7 @@ bool GetTimeResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
void GetTimeResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_fixed32(1, this->epoch_seconds); } void GetTimeResponse::encode(ProtoWriteBuffer buffer) const { buffer.encode_fixed32(1, this->epoch_seconds); }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void GetTimeResponse::dump_to(std::string &out) const { void GetTimeResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("GetTimeResponse {\n"); out.append("GetTimeResponse {\n");
out.append(" epoch_seconds: "); out.append(" epoch_seconds: ");
sprintf(buffer, "%u", this->epoch_seconds); sprintf(buffer, "%u", this->epoch_seconds);
@@ -2748,7 +2748,7 @@ void ListEntitiesServicesArgument::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesServicesArgument::dump_to(std::string &out) const { void ListEntitiesServicesArgument::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesServicesArgument {\n"); out.append("ListEntitiesServicesArgument {\n");
out.append(" name: "); out.append(" name: ");
out.append("'").append(this->name).append("'"); out.append("'").append(this->name).append("'");
@@ -2793,7 +2793,7 @@ void ListEntitiesServicesResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesServicesResponse::dump_to(std::string &out) const { void ListEntitiesServicesResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesServicesResponse {\n"); out.append("ListEntitiesServicesResponse {\n");
out.append(" name: "); out.append(" name: ");
out.append("'").append(this->name).append("'"); out.append("'").append(this->name).append("'");
@@ -2887,7 +2887,7 @@ void ExecuteServiceArgument::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ExecuteServiceArgument::dump_to(std::string &out) const { void ExecuteServiceArgument::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ExecuteServiceArgument {\n"); out.append("ExecuteServiceArgument {\n");
out.append(" bool_: "); out.append(" bool_: ");
out.append(YESNO(this->bool_)); out.append(YESNO(this->bool_));
@@ -2968,7 +2968,7 @@ void ExecuteServiceRequest::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ExecuteServiceRequest::dump_to(std::string &out) const { void ExecuteServiceRequest::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ExecuteServiceRequest {\n"); out.append("ExecuteServiceRequest {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -3040,7 +3040,7 @@ void ListEntitiesCameraResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesCameraResponse::dump_to(std::string &out) const { void ListEntitiesCameraResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesCameraResponse {\n"); out.append("ListEntitiesCameraResponse {\n");
out.append(" object_id: "); out.append(" object_id: ");
out.append("'").append(this->object_id).append("'"); out.append("'").append(this->object_id).append("'");
@@ -3110,7 +3110,7 @@ void CameraImageResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void CameraImageResponse::dump_to(std::string &out) const { void CameraImageResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("CameraImageResponse {\n"); out.append("CameraImageResponse {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -3147,7 +3147,7 @@ void CameraImageRequest::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void CameraImageRequest::dump_to(std::string &out) const { void CameraImageRequest::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("CameraImageRequest {\n"); out.append("CameraImageRequest {\n");
out.append(" single: "); out.append(" single: ");
out.append(YESNO(this->single)); out.append(YESNO(this->single));
@@ -3293,7 +3293,7 @@ void ListEntitiesClimateResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesClimateResponse::dump_to(std::string &out) const { void ListEntitiesClimateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesClimateResponse {\n"); out.append("ListEntitiesClimateResponse {\n");
out.append(" object_id: "); out.append(" object_id: ");
out.append("'").append(this->object_id).append("'"); out.append("'").append(this->object_id).append("'");
@@ -3480,7 +3480,7 @@ void ClimateStateResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ClimateStateResponse::dump_to(std::string &out) const { void ClimateStateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ClimateStateResponse {\n"); out.append("ClimateStateResponse {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -3668,7 +3668,7 @@ void ClimateCommandRequest::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ClimateCommandRequest::dump_to(std::string &out) const { void ClimateCommandRequest::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ClimateCommandRequest {\n"); out.append("ClimateCommandRequest {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -3842,7 +3842,7 @@ void ListEntitiesNumberResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesNumberResponse::dump_to(std::string &out) const { void ListEntitiesNumberResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesNumberResponse {\n"); out.append("ListEntitiesNumberResponse {\n");
out.append(" object_id: "); out.append(" object_id: ");
out.append("'").append(this->object_id).append("'"); out.append("'").append(this->object_id).append("'");
@@ -3929,7 +3929,7 @@ void NumberStateResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void NumberStateResponse::dump_to(std::string &out) const { void NumberStateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("NumberStateResponse {\n"); out.append("NumberStateResponse {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -3967,7 +3967,7 @@ void NumberCommandRequest::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void NumberCommandRequest::dump_to(std::string &out) const { void NumberCommandRequest::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("NumberCommandRequest {\n"); out.append("NumberCommandRequest {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -4045,7 +4045,7 @@ void ListEntitiesSelectResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesSelectResponse::dump_to(std::string &out) const { void ListEntitiesSelectResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("ListEntitiesSelectResponse {\n"); out.append("ListEntitiesSelectResponse {\n");
out.append(" object_id: "); out.append(" object_id: ");
out.append("'").append(this->object_id).append("'"); out.append("'").append(this->object_id).append("'");
@@ -4121,7 +4121,7 @@ void SelectStateResponse::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void SelectStateResponse::dump_to(std::string &out) const { void SelectStateResponse::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("SelectStateResponse {\n"); out.append("SelectStateResponse {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -4164,7 +4164,7 @@ void SelectCommandRequest::encode(ProtoWriteBuffer buffer) const {
} }
#ifdef HAS_PROTO_MESSAGE_DUMP #ifdef HAS_PROTO_MESSAGE_DUMP
void SelectCommandRequest::dump_to(std::string &out) const { void SelectCommandRequest::dump_to(std::string &out) const {
char buffer[64]; __attribute__((unused)) char buffer[64];
out.append("SelectCommandRequest {\n"); out.append("SelectCommandRequest {\n");
out.append(" key: "); out.append(" key: ");
sprintf(buffer, "%u", this->key); sprintf(buffer, "%u", this->key);
@@ -85,14 +85,7 @@ void CaptivePortal::start() {
this->dns_server_->start(53, "*", (uint32_t) ip); this->dns_server_->start(53, "*", (uint32_t) ip);
this->base_->get_server()->onNotFound([this](AsyncWebServerRequest *req) { this->base_->get_server()->onNotFound([this](AsyncWebServerRequest *req) {
bool not_found = false; if (!this->active_ || req->host().c_str() == wifi::global_wifi_component->wifi_soft_ap_ip().str()) {
if (!this->active_) {
not_found = true;
} else if (req->host().c_str() == wifi::global_wifi_component->wifi_soft_ap_ip().str()) {
not_found = true;
}
if (not_found) {
req->send(404, "text/html", "File not found"); req->send(404, "text/html", "File not found");
return; return;
} }
-2
View File
@@ -102,8 +102,6 @@ void CS5460AComponent::hw_init_() {
/* Doesn't reset the register values etc., just restarts the "computation cycle" */ /* Doesn't reset the register values etc., just restarts the "computation cycle" */
void CS5460AComponent::restart_() { void CS5460AComponent::restart_() {
int cnt;
this->enable(); this->enable();
/* Stop running conversion, wake up if needed */ /* Stop running conversion, wake up if needed */
this->write_byte(CMD_POWER_UP); this->write_byte(CMD_POWER_UP);
+3 -3
View File
@@ -149,9 +149,9 @@ void CSE7766Component::parse_data_() {
} }
} }
void CSE7766Component::update() { void CSE7766Component::update() {
float voltage = this->voltage_counts_ > 0 ? this->voltage_acc_ / this->voltage_counts_ : 0.0; float voltage = this->voltage_counts_ > 0 ? this->voltage_acc_ / this->voltage_counts_ : 0.0f;
float current = this->current_counts_ > 0 ? this->current_acc_ / this->current_counts_ : 0.0; float current = this->current_counts_ > 0 ? this->current_acc_ / this->current_counts_ : 0.0f;
float power = this->power_counts_ > 0 ? this->power_acc_ / this->power_counts_ : 0.0; float power = this->power_counts_ > 0 ? this->power_acc_ / this->power_counts_ : 0.0f;
ESP_LOGV(TAG, "Got voltage_acc=%.2f current_acc=%.2f power_acc=%.2f", this->voltage_acc_, this->current_acc_, ESP_LOGV(TAG, "Got voltage_acc=%.2f current_acc=%.2f power_acc=%.2f", this->voltage_acc_, this->current_acc_,
this->power_acc_); this->power_acc_);
+1 -1
View File
@@ -231,7 +231,7 @@ bool DaikinClimate::on_receive(remote_base::RemoteReceiveData data) {
// frame header // frame header
if (byte != 0x27) if (byte != 0x27)
return false; return false;
} else if (pos == 3) { } else if (pos == 3) { // NOLINT(bugprone-branch-clone)
// frame header // frame header
if (byte != 0x00) if (byte != 0x00)
return false; return false;
@@ -496,7 +496,7 @@ bool Animation::get_pixel(int x, int y) const {
return false; return false;
const uint32_t width_8 = ((this->width_ + 7u) / 8u) * 8u; const uint32_t width_8 = ((this->width_ + 7u) / 8u) * 8u;
const uint32_t frame_index = this->height_ * width_8 * this->current_frame_; const uint32_t frame_index = this->height_ * width_8 * this->current_frame_;
if (frame_index >= this->width_ * this->height_ * this->animation_frame_count_) if (frame_index >= (uint32_t)(this->width_ * this->height_ * this->animation_frame_count_))
return false; return false;
const uint32_t pos = x + y * width_8 + frame_index; const uint32_t pos = x + y * width_8 + frame_index;
return progmem_read_byte(this->data_start_ + (pos / 8u)) & (0x80 >> (pos % 8u)); return progmem_read_byte(this->data_start_ + (pos / 8u)) & (0x80 >> (pos % 8u));
@@ -505,7 +505,7 @@ Color Animation::get_color_pixel(int x, int y) const {
if (x < 0 || x >= this->width_ || y < 0 || y >= this->height_) if (x < 0 || x >= this->width_ || y < 0 || y >= this->height_)
return Color::BLACK; return Color::BLACK;
const uint32_t frame_index = this->width_ * this->height_ * this->current_frame_; const uint32_t frame_index = this->width_ * this->height_ * this->current_frame_;
if (frame_index >= this->width_ * this->height_ * this->animation_frame_count_) if (frame_index >= (uint32_t)(this->width_ * this->height_ * this->animation_frame_count_))
return Color::BLACK; return Color::BLACK;
const uint32_t pos = (x + y * this->width_ + frame_index) * 3; const uint32_t pos = (x + y * this->width_ + frame_index) * 3;
const uint32_t color32 = (progmem_read_byte(this->data_start_ + pos + 2) << 0) | const uint32_t color32 = (progmem_read_byte(this->data_start_ + pos + 2) << 0) |
@@ -517,7 +517,7 @@ Color Animation::get_grayscale_pixel(int x, int y) const {
if (x < 0 || x >= this->width_ || y < 0 || y >= this->height_) if (x < 0 || x >= this->width_ || y < 0 || y >= this->height_)
return Color::BLACK; return Color::BLACK;
const uint32_t frame_index = this->width_ * this->height_ * this->current_frame_; const uint32_t frame_index = this->width_ * this->height_ * this->current_frame_;
if (frame_index >= this->width_ * this->height_ * this->animation_frame_count_) if (frame_index >= (uint32_t)(this->width_ * this->height_ * this->animation_frame_count_))
return Color::BLACK; return Color::BLACK;
const uint32_t pos = (x + y * this->width_ + frame_index); const uint32_t pos = (x + y * this->width_ + frame_index);
const uint8_t gray = progmem_read_byte(this->data_start_ + pos); const uint8_t gray = progmem_read_byte(this->data_start_ + pos);
+2 -2
View File
@@ -114,10 +114,10 @@ class Dsmr : public Component, public uart::UARTDevice {
bool receive_timeout_reached_(); bool receive_timeout_reached_();
size_t max_telegram_len_; size_t max_telegram_len_;
char *telegram_{nullptr}; char *telegram_{nullptr};
int bytes_read_{0}; size_t bytes_read_{0};
uint8_t *crypt_telegram_{nullptr}; uint8_t *crypt_telegram_{nullptr};
size_t crypt_telegram_len_{0}; size_t crypt_telegram_len_{0};
int crypt_bytes_read_{0}; size_t crypt_bytes_read_{0};
uint32_t last_read_time_{0}; uint32_t last_read_time_{0};
bool header_found_{false}; bool header_found_{false};
bool footer_found_{false}; bool footer_found_{false};
+1 -1
View File
@@ -9,7 +9,7 @@ namespace esp8266 {
static const char *const TAG = "esp8266"; static const char *const TAG = "esp8266";
static int IRAM_ATTR flags_to_mode(gpio::Flags flags, uint8_t pin) { static int IRAM_ATTR flags_to_mode(gpio::Flags flags, uint8_t pin) {
if (flags == gpio::FLAG_INPUT) { if (flags == gpio::FLAG_INPUT) { // NOLINT(bugprone-branch-clone)
return INPUT; return INPUT;
} else if (flags == gpio::FLAG_OUTPUT) { } else if (flags == gpio::FLAG_OUTPUT) {
return OUTPUT; return OUTPUT;
+2 -2
View File
@@ -55,7 +55,7 @@ static inline bool esp_rtc_user_mem_write(uint32_t index, uint32_t value) {
extern "C" uint32_t _SPIFFS_end; // NOLINT extern "C" uint32_t _SPIFFS_end; // NOLINT
static const uint32_t get_esp8266_flash_sector() { static uint32_t get_esp8266_flash_sector() {
union { union {
uint32_t *ptr; uint32_t *ptr;
uint32_t uint; uint32_t uint;
@@ -63,7 +63,7 @@ static const uint32_t get_esp8266_flash_sector() {
data.ptr = &_SPIFFS_end; data.ptr = &_SPIFFS_end;
return (data.uint - 0x40200000) / SPI_FLASH_SEC_SIZE; return (data.uint - 0x40200000) / SPI_FLASH_SEC_SIZE;
} }
static const uint32_t get_esp8266_flash_address() { return get_esp8266_flash_sector() * SPI_FLASH_SEC_SIZE; } static uint32_t get_esp8266_flash_address() { return get_esp8266_flash_sector() * SPI_FLASH_SEC_SIZE; }
template<class It> uint32_t calculate_crc(It first, It last, uint32_t type) { template<class It> uint32_t calculate_crc(It first, It last, uint32_t type) {
uint32_t crc = type; uint32_t crc = type;
+1 -1
View File
@@ -75,7 +75,7 @@ void EZOSensor::loop() {
return; return;
// some sensors return multiple comma-separated values, terminate string after first one // some sensors return multiple comma-separated values, terminate string after first one
for (int i = 1; i < sizeof(buf) - 1; i++) for (size_t i = 1; i < sizeof(buf) - 1; i++)
if (buf[i] == ',') if (buf[i] == ',')
buf[i] = '\0'; buf[i] = '\0';
+8 -8
View File
@@ -86,7 +86,7 @@ void Graph::draw(DisplayBuffer *buff, uint16_t x_offset, uint16_t y_offset, Colo
// Look back in trace data to best-fit into local range // Look back in trace data to best-fit into local range
float mx = NAN; float mx = NAN;
float mn = NAN; float mn = NAN;
for (int16_t i = 0; i < this->width_; i++) { for (uint32_t i = 0; i < this->width_; i++) {
for (auto *trace : traces_) { for (auto *trace : traces_) {
float v = trace->get_tracedata()->get_value(i); float v = trace->get_tracedata()->get_value(i);
if (!std::isnan(v)) { if (!std::isnan(v)) {
@@ -132,7 +132,7 @@ void Graph::draw(DisplayBuffer *buff, uint16_t x_offset, uint16_t y_offset, Colo
if (!std::isnan(this->gridspacing_y_)) { if (!std::isnan(this->gridspacing_y_)) {
for (int y = yn; y <= ym; y++) { for (int y = yn; y <= ym; y++) {
int16_t py = (int16_t) roundf((this->height_ - 1) * (1.0 - (float) (y - yn) / (ym - yn))); int16_t py = (int16_t) roundf((this->height_ - 1) * (1.0 - (float) (y - yn) / (ym - yn)));
for (int x = 0; x < this->width_; x += 2) { for (uint32_t x = 0; x < this->width_; x += 2) {
buff->draw_pixel_at(x_offset + x, y_offset + py, color); buff->draw_pixel_at(x_offset + x, y_offset + py, color);
} }
} }
@@ -147,7 +147,7 @@ void Graph::draw(DisplayBuffer *buff, uint16_t x_offset, uint16_t y_offset, Colo
ESP_LOGW(TAG, "Graphing reducing x-scale to prevent too many gridlines"); ESP_LOGW(TAG, "Graphing reducing x-scale to prevent too many gridlines");
} }
for (int i = 0; i <= n; i++) { for (int i = 0; i <= n; i++) {
for (int y = 0; y < this->height_; y += 2) { for (uint32_t y = 0; y < this->height_; y += 2) {
buff->draw_pixel_at(x_offset + i * (this->width_ - 1) / n, y_offset + y, color); buff->draw_pixel_at(x_offset + i * (this->width_ - 1) / n, y_offset + y, color);
} }
} }
@@ -158,14 +158,14 @@ void Graph::draw(DisplayBuffer *buff, uint16_t x_offset, uint16_t y_offset, Colo
for (auto *trace : traces_) { for (auto *trace : traces_) {
Color c = trace->get_line_color(); Color c = trace->get_line_color();
uint16_t thick = trace->get_line_thickness(); uint16_t thick = trace->get_line_thickness();
for (int16_t i = 0; i < this->width_; i++) { for (uint32_t i = 0; i < this->width_; i++) {
float v = (trace->get_tracedata()->get_value(i) - ymin) / yrange; float v = (trace->get_tracedata()->get_value(i) - ymin) / yrange;
if (!std::isnan(v) && (thick > 0)) { if (!std::isnan(v) && (thick > 0)) {
int16_t x = this->width_ - 1 - i; int16_t x = this->width_ - 1 - i;
uint8_t b = (i % (thick * LineType::PATTERN_LENGTH)) / thick; uint8_t b = (i % (thick * LineType::PATTERN_LENGTH)) / thick;
if (((uint8_t) trace->get_line_type() & (1 << b)) == (1 << b)) { if (((uint8_t) trace->get_line_type() & (1 << b)) == (1 << b)) {
int16_t y = (int16_t) roundf((this->height_ - 1) * (1.0 - v)) - thick / 2; int16_t y = (int16_t) roundf((this->height_ - 1) * (1.0 - v)) - thick / 2;
for (int16_t t = 0; t < thick; t++) { for (uint16_t t = 0; t < thick; t++) {
buff->draw_pixel_at(x_offset + x, y_offset + y + t, c); buff->draw_pixel_at(x_offset + x, y_offset + y + t, c);
} }
} }
@@ -179,8 +179,8 @@ void GraphLegend::init(Graph *g) {
parent_ = g; parent_ = g;
// Determine maximum expected text and value width / height // Determine maximum expected text and value width / height
int txtw = 0, txtos = 0, txtbl = 0, txth = 0; int txtw = 0, txth = 0;
int valw = 0, valos = 0, valbl = 0, valh = 0; int valw = 0, valh = 0;
int lt = 0; int lt = 0;
for (auto *trace : g->traces_) { for (auto *trace : g->traces_) {
std::string txtstr = trace->get_name(); std::string txtstr = trace->get_name();
@@ -320,7 +320,7 @@ void Graph::draw_legend(display::DisplayBuffer *buff, uint16_t x_offset, uint16_
if (legend_->lines_) { if (legend_->lines_) {
uint16_t thick = trace->get_line_thickness(); uint16_t thick = trace->get_line_thickness();
for (int16_t i = 0; i < legend_->x0_ * 4 / 3; i++) { for (int i = 0; i < legend_->x0_ * 4 / 3; i++) {
uint8_t b = (i % (thick * LineType::PATTERN_LENGTH)) / thick; uint8_t b = (i % (thick * LineType::PATTERN_LENGTH)) / thick;
if (((uint8_t) trace->get_line_type() & (1 << b)) == (1 << b)) { if (((uint8_t) trace->get_line_type() & (1 << b)) == (1 << b)) {
buff->vertical_line(x - legend_->x0_ * 2 / 3 + i, y + legend_->yl_ - thick / 2, thick, buff->vertical_line(x - legend_->x0_ * 2 / 3 + i, y + legend_->yl_ - thick / 2, thick,
@@ -299,9 +299,7 @@ bool HitachiClimate::parse_swing_(const uint8_t remote_state[]) {
GETBITS8(remote_state[HITACHI_AC344_SWINGH_BYTE], HITACHI_AC344_SWINGH_OFFSET, HITACHI_AC344_SWINGH_SIZE); GETBITS8(remote_state[HITACHI_AC344_SWINGH_BYTE], HITACHI_AC344_SWINGH_OFFSET, HITACHI_AC344_SWINGH_SIZE);
ESP_LOGV(TAG, "SwingH: %02X %02X", remote_state[HITACHI_AC344_SWINGH_BYTE], swing_modeh); ESP_LOGV(TAG, "SwingH: %02X %02X", remote_state[HITACHI_AC344_SWINGH_BYTE], swing_modeh);
if ((swing_modeh & 0x7) == 0x0) { if ((swing_modeh & 0x3) == 0x3) {
this->swing_mode = climate::CLIMATE_SWING_HORIZONTAL;
} else if ((swing_modeh & 0x3) == 0x3) {
this->swing_mode = climate::CLIMATE_SWING_OFF; this->swing_mode = climate::CLIMATE_SWING_OFF;
} else { } else {
this->swing_mode = climate::CLIMATE_SWING_HORIZONTAL; this->swing_mode = climate::CLIMATE_SWING_HORIZONTAL;
@@ -300,9 +300,7 @@ bool HitachiClimate::parse_swing_(const uint8_t remote_state[]) {
HITACHI_AC424_SWINGH_SIZE); HITACHI_AC424_SWINGH_SIZE);
ESP_LOGV(TAG, "SwingH: %02X %02X", remote_state[HITACHI_AC424_SWINGH_BYTE], swing_modeh); ESP_LOGV(TAG, "SwingH: %02X %02X", remote_state[HITACHI_AC424_SWINGH_BYTE], swing_modeh);
if ((swing_modeh & 0x7) == 0x0) { if ((swing_modeh & 0x3) == 0x3) {
this->swing_mode = climate::CLIMATE_SWING_HORIZONTAL;
} else if ((swing_modeh & 0x3) == 0x3) {
this->swing_mode = climate::CLIMATE_SWING_OFF; this->swing_mode = climate::CLIMATE_SWING_OFF;
} else { } else {
this->swing_mode = climate::CLIMATE_SWING_HORIZONTAL; this->swing_mode = climate::CLIMATE_SWING_HORIZONTAL;
@@ -86,8 +86,8 @@ void ILI9341Display::update() {
void ILI9341Display::display_() { void ILI9341Display::display_() {
// we will only update the changed window to the display // we will only update the changed window to the display
int w = this->x_high_ - this->x_low_ + 1; uint16_t w = this->x_high_ - this->x_low_ + 1;
int h = this->y_high_ - this->y_low_ + 1; uint16_t h = this->y_high_ - this->y_low_ + 1;
set_addr_window_(this->x_low_, this->y_low_, w, h); set_addr_window_(this->x_low_, this->y_low_, w, h);
this->start_data_(); this->start_data_();
@@ -145,7 +145,7 @@ bool ImprovSerialComponent::parse_improv_serial_byte_(uint8_t byte) {
if (at == 8 + data_len + 1) { if (at == 8 + data_len + 1) {
uint8_t checksum = 0x00; uint8_t checksum = 0x00;
for (uint8_t i = 0; i < at; i++) for (size_t i = 0; i < at; i++)
checksum += raw[i]; checksum += raw[i];
if (checksum != byte) { if (checksum != byte) {
@@ -17,7 +17,7 @@ void GPIOLCDDisplay::setup() {
this->enable_pin_->setup(); // OUTPUT this->enable_pin_->setup(); // OUTPUT
this->enable_pin_->digital_write(false); this->enable_pin_->digital_write(false);
for (uint8_t i = 0; i < (this->is_four_bit_mode() ? 4 : 8); i++) { for (uint8_t i = 0; i < (uint8_t)(this->is_four_bit_mode() ? 4u : 8u); i++) {
this->data_pins_[i]->setup(); // OUTPUT this->data_pins_[i]->setup(); // OUTPUT
this->data_pins_[i]->digital_write(false); this->data_pins_[i]->digital_write(false);
} }
@@ -167,7 +167,7 @@ class AddressableScanEffect : public AddressableLightEffect {
this->last_move_ = now; this->last_move_ = now;
it.all() = Color::BLACK; it.all() = Color::BLACK;
for (auto i = 0; i < this->scan_width_; i++) { for (uint32_t i = 0; i < this->scan_width_; i++) {
it[this->at_led_ + i] = current_color; it[this->at_led_ + i] = current_color;
} }
@@ -178,7 +178,7 @@ class AddressableScanEffect : public AddressableLightEffect {
uint32_t move_interval_{}; uint32_t move_interval_{};
uint32_t scan_width_{1}; uint32_t scan_width_{1};
uint32_t last_move_{0}; uint32_t last_move_{0};
int at_led_{0}; uint32_t at_led_{0};
bool direction_{true}; bool direction_{true};
}; };
+1 -1
View File
@@ -98,7 +98,7 @@ void LightCall::perform() {
// EFFECT // EFFECT
auto effect = this->effect_; auto effect = this->effect_;
const char *effect_s; const char *effect_s;
if (effect == 0) if (effect == 0u)
effect_s = "None"; effect_s = "None";
else else
effect_s = this->parent_->effects_[*this->effect_ - 1]->get_name().c_str(); effect_s = this->parent_->effects_[*this->effect_ - 1]->get_name().c_str();
+1 -1
View File
@@ -97,7 +97,7 @@ void LTR390Component::read_mode_(int mode_index) {
// If there are more modes to read then begin the next // If there are more modes to read then begin the next
// otherwise stop // otherwise stop
if (mode_index + 1 < this->mode_funcs_.size()) { if (mode_index + 1 < (int) this->mode_funcs_.size()) {
this->read_mode_(mode_index + 1); this->read_mode_(mode_index + 1);
} else { } else {
this->reading_ = false; this->reading_ = false;
+6 -6
View File
@@ -203,16 +203,16 @@ float MAX31865Sensor::calc_temperature_(float rtd_ratio) {
rtd_resistance *= 100; rtd_resistance *= 100;
} }
float rpoly = rtd_resistance; float rpoly = rtd_resistance;
float neg_temp = -242.02; float neg_temp = -242.02f;
neg_temp += 2.2228 * rpoly; neg_temp += 2.2228f * rpoly;
rpoly *= rtd_resistance; // square rpoly *= rtd_resistance; // square
neg_temp += 2.5859e-3 * rpoly; neg_temp += 2.5859e-3f * rpoly;
rpoly *= rtd_resistance; // ^3 rpoly *= rtd_resistance; // ^3
neg_temp -= 4.8260e-6 * rpoly; neg_temp -= 4.8260e-6f * rpoly;
rpoly *= rtd_resistance; // ^4 rpoly *= rtd_resistance; // ^4
neg_temp -= 2.8183e-8 * rpoly; neg_temp -= 2.8183e-8f * rpoly;
rpoly *= rtd_resistance; // ^5 rpoly *= rtd_resistance; // ^5
neg_temp += 1.5243e-10 * rpoly; neg_temp += 1.5243e-10f * rpoly;
return neg_temp; return neg_temp;
} }
@@ -76,7 +76,7 @@ void MAX7219Component::loop() {
this->stepsleft_ = 0; this->stepsleft_ = 0;
// Return if there is no need to scroll or scroll is off // Return if there is no need to scroll or scroll is off
if (!this->scroll_ || (this->max_displaybuffer_[0].size() <= get_width_internal())) { if (!this->scroll_ || (this->max_displaybuffer_[0].size() <= (size_t) get_width_internal())) {
this->display(); this->display();
return; return;
} }
@@ -88,7 +88,7 @@ void MAX7219Component::loop() {
// Dwell time at end of string in case of stop at end // Dwell time at end of string in case of stop at end
if (this->scroll_mode_ == ScrollMode::STOP) { if (this->scroll_mode_ == ScrollMode::STOP) {
if (this->stepsleft_ >= this->max_displaybuffer_[0].size() - get_width_internal() + 1) { if (this->stepsleft_ >= this->max_displaybuffer_[0].size() - (size_t) get_width_internal() + 1) {
if (now - this->last_scroll_ >= this->scroll_dwell_) { if (now - this->last_scroll_ >= this->scroll_dwell_) {
this->stepsleft_ = 0; this->stepsleft_ = 0;
this->last_scroll_ = now; this->last_scroll_ = now;
@@ -155,7 +155,7 @@ int MAX7219Component::get_height_internal() {
int MAX7219Component::get_width_internal() { return this->num_chips_ / this->num_chip_lines_ * 8; } int MAX7219Component::get_width_internal() { return this->num_chips_ / this->num_chip_lines_ * 8; }
void HOT MAX7219Component::draw_absolute_pixel_internal(int x, int y, Color color) { void HOT MAX7219Component::draw_absolute_pixel_internal(int x, int y, Color color) {
if (x + 1 > this->max_displaybuffer_[0].size()) { // Extend the display buffer in case required if (x + 1 > (int) this->max_displaybuffer_[0].size()) { // Extend the display buffer in case required
for (int chip_line = 0; chip_line < this->num_chip_lines_; chip_line++) { for (int chip_line = 0; chip_line < this->num_chip_lines_; chip_line++) {
this->max_displaybuffer_[chip_line].resize(x + 1, this->bckgrnd_); this->max_displaybuffer_[chip_line].resize(x + 1, this->bckgrnd_);
} }
-1
View File
@@ -35,7 +35,6 @@ void MCP23S08::dump_config() {
} }
bool MCP23S08::read_reg(uint8_t reg, uint8_t *value) { bool MCP23S08::read_reg(uint8_t reg, uint8_t *value) {
uint8_t data;
this->enable(); this->enable();
this->transfer_byte(this->device_opcode_ | 1); this->transfer_byte(this->device_opcode_ | 1);
this->transfer_byte(reg); this->transfer_byte(reg);
-3
View File
@@ -127,9 +127,6 @@ canbus::Error MCP2515::set_mode_(const CanctrlReqopMode mode) {
} }
canbus::Error MCP2515::set_clk_out_(const CanClkOut divisor) { canbus::Error MCP2515::set_clk_out_(const CanClkOut divisor) {
canbus::Error res;
uint8_t cfg3;
if (divisor == CLKOUT_DISABLE) { if (divisor == CLKOUT_DISABLE) {
/* Turn off CLKEN */ /* Turn off CLKEN */
modify_register_(MCP_CANCTRL, CANCTRL_CLKEN, 0x00); modify_register_(MCP_CANCTRL, CANCTRL_CLKEN, 0x00);
@@ -13,8 +13,6 @@ void ModbusBinarySensor::parse_and_publish(const std::vector<uint8_t> &data) {
switch (this->register_type) { switch (this->register_type) {
case ModbusRegisterType::DISCRETE_INPUT: case ModbusRegisterType::DISCRETE_INPUT:
value = coil_from_vector(this->offset, data);
break;
case ModbusRegisterType::COIL: case ModbusRegisterType::COIL:
// offset for coil is the actual number of the coil not the byte offset // offset for coil is the actual number of the coil not the byte offset
value = coil_from_vector(this->offset, data); value = coil_from_vector(this->offset, data);
@@ -102,8 +102,6 @@ inline ModbusFunctionCode modbus_register_write_function(ModbusRegisterType reg_
return ModbusFunctionCode::READ_WRITE_MULTIPLE_REGISTERS; return ModbusFunctionCode::READ_WRITE_MULTIPLE_REGISTERS;
break; break;
case ModbusRegisterType::READ: case ModbusRegisterType::READ:
return ModbusFunctionCode::CUSTOM;
break;
default: default:
return ModbusFunctionCode::CUSTOM; return ModbusFunctionCode::CUSTOM;
break; break;
@@ -221,7 +219,7 @@ template<typename N> N mask_and_shift_by_rightbit(N data, uint32_t mask) {
if (result == 0) { if (result == 0) {
return result; return result;
} }
for (int pos = 0; pos < sizeof(N) << 3; pos++) { for (size_t pos = 0; pos < sizeof(N) << 3; pos++) {
if ((mask & (1 << pos)) != 0) if ((mask & (1 << pos)) != 0)
return result >> pos; return result >> pos;
} }
@@ -8,11 +8,6 @@ namespace modbus_controller {
static const char *const TAG = "modbus.number"; static const char *const TAG = "modbus.number";
void ModbusNumber::parse_and_publish(const std::vector<uint8_t> &data) { void ModbusNumber::parse_and_publish(const std::vector<uint8_t> &data) {
union {
float float_value;
uint32_t raw;
} raw_to_float;
float result = payload_to_float(data, *this); float result = payload_to_float(data, *this);
// Is there a lambda registered // Is there a lambda registered
@@ -31,13 +26,7 @@ void ModbusNumber::parse_and_publish(const std::vector<uint8_t> &data) {
} }
void ModbusNumber::control(float value) { void ModbusNumber::control(float value) {
union {
float float_value;
uint32_t raw;
} raw_to_float;
std::vector<uint16_t> data; std::vector<uint16_t> data;
auto original_value = value;
// Is there are lambda configured? // Is there are lambda configured?
if (this->write_transform_func_.has_value()) { if (this->write_transform_func_.has_value()) {
// data is passed by reference // data is passed by reference
@@ -13,11 +13,6 @@ void ModbusOutput::setup() {}
* *
*/ */
void ModbusOutput::write_state(float value) { void ModbusOutput::write_state(float value) {
union {
float float_value;
uint32_t raw;
} raw_to_float;
std::vector<uint16_t> data; std::vector<uint16_t> data;
auto original_value = value; auto original_value = value;
// Is there are lambda configured? // Is there are lambda configured?
@@ -10,11 +10,6 @@ static const char *const TAG = "modbus_controller.sensor";
void ModbusSensor::dump_config() { LOG_SENSOR(TAG, "Modbus Controller Sensor", this); } void ModbusSensor::dump_config() { LOG_SENSOR(TAG, "Modbus Controller Sensor", this); }
void ModbusSensor::parse_and_publish(const std::vector<uint8_t> &data) { void ModbusSensor::parse_and_publish(const std::vector<uint8_t> &data) {
union {
float float_value;
uint32_t raw;
} raw_to_float;
float result = payload_to_float(data, *this); float result = payload_to_float(data, *this);
// Is there a lambda registered // Is there a lambda registered
+10 -14
View File
@@ -64,7 +64,7 @@ bool Nextion::check_connect_() {
if (response.empty() || response.find("comok") == std::string::npos) { if (response.empty() || response.find("comok") == std::string::npos) {
#ifdef NEXTION_PROTOCOL_LOG #ifdef NEXTION_PROTOCOL_LOG
ESP_LOGN(TAG, "Bad connect request %s", response.c_str()); ESP_LOGN(TAG, "Bad connect request %s", response.c_str());
for (int i = 0; i < response.length(); i++) { for (size_t i = 0; i < response.length(); i++) {
ESP_LOGN(TAG, "response %s %d %d %c", response.c_str(), i, response[i], response[i]); ESP_LOGN(TAG, "response %s %d %d %c", response.c_str(), i, response[i], response[i]);
} }
#endif #endif
@@ -563,11 +563,10 @@ void Nextion::process_nextion_commands_() {
// FF FF FF - End // FF FF FF - End
case 0x90: { // Switched component case 0x90: { // Switched component
std::string variable_name; std::string variable_name;
uint8_t index = 0;
// Get variable name // Get variable name
index = to_process.find('\0'); auto index = to_process.find('\0');
if (static_cast<char>(index) == std::string::npos || (to_process_length - index - 1) < 1) { if (index == std::string::npos || (to_process_length - index - 1) < 1) {
ESP_LOGE(TAG, "Bad switch component data received for 0x90 event!"); ESP_LOGE(TAG, "Bad switch component data received for 0x90 event!");
ESP_LOGN(TAG, "to_process %s %zu %d", to_process.c_str(), to_process_length, index); ESP_LOGN(TAG, "to_process %s %zu %d", to_process.c_str(), to_process_length, index);
break; break;
@@ -591,10 +590,9 @@ void Nextion::process_nextion_commands_() {
// FF FF FF - End // FF FF FF - End
case 0x91: { // Sensor component case 0x91: { // Sensor component
std::string variable_name; std::string variable_name;
uint8_t index = 0;
index = to_process.find('\0'); auto index = to_process.find('\0');
if (static_cast<char>(index) == std::string::npos || (to_process_length - index - 1) != 4) { if (index == std::string::npos || (to_process_length - index - 1) != 4) {
ESP_LOGE(TAG, "Bad sensor component data received for 0x91 event!"); ESP_LOGE(TAG, "Bad sensor component data received for 0x91 event!");
ESP_LOGN(TAG, "to_process %s %zu %d", to_process.c_str(), to_process_length, index); ESP_LOGN(TAG, "to_process %s %zu %d", to_process.c_str(), to_process_length, index);
break; break;
@@ -626,11 +624,10 @@ void Nextion::process_nextion_commands_() {
case 0x92: { // Text Sensor Component case 0x92: { // Text Sensor Component
std::string variable_name; std::string variable_name;
std::string text_value; std::string text_value;
uint8_t index = 0;
// Get variable name // Get variable name
index = to_process.find('\0'); auto index = to_process.find('\0');
if (static_cast<char>(index) == std::string::npos || (to_process_length - index - 1) < 1) { if (index == std::string::npos || (to_process_length - index - 1) < 1) {
ESP_LOGE(TAG, "Bad text sensor component data received for 0x92 event!"); ESP_LOGE(TAG, "Bad text sensor component data received for 0x92 event!");
ESP_LOGN(TAG, "to_process %s %zu %d", to_process.c_str(), to_process_length, index); ESP_LOGN(TAG, "to_process %s %zu %d", to_process.c_str(), to_process_length, index);
break; break;
@@ -660,11 +657,10 @@ void Nextion::process_nextion_commands_() {
// FF FF FF - End // FF FF FF - End
case 0x93: { // Binary Sensor component case 0x93: { // Binary Sensor component
std::string variable_name; std::string variable_name;
uint8_t index = 0;
// Get variable name // Get variable name
index = to_process.find('\0'); auto index = to_process.find('\0');
if (static_cast<char>(index) == std::string::npos || (to_process_length - index - 1) < 1) { if (index == std::string::npos || (to_process_length - index - 1) < 1) {
ESP_LOGE(TAG, "Bad binary sensor component data received for 0x92 event!"); ESP_LOGE(TAG, "Bad binary sensor component data received for 0x92 event!");
ESP_LOGN(TAG, "to_process %s %zu %d", to_process.c_str(), to_process_length, index); ESP_LOGN(TAG, "to_process %s %zu %d", to_process.c_str(), to_process_length, index);
break; break;
@@ -736,7 +732,7 @@ void Nextion::process_nextion_commands_() {
uint32_t ms = millis(); uint32_t ms = millis();
if (!this->nextion_queue_.empty() && this->nextion_queue_.front()->queue_time + this->max_q_age_ms_ < ms) { if (!this->nextion_queue_.empty() && this->nextion_queue_.front()->queue_time + this->max_q_age_ms_ < ms) {
for (int i = 0; i < this->nextion_queue_.size(); i++) { for (size_t i = 0; i < this->nextion_queue_.size(); i++) {
NextionComponentBase *component = this->nextion_queue_[i]->component; NextionComponentBase *component = this->nextion_queue_[i]->component;
if (this->nextion_queue_[i]->queue_time + this->max_q_age_ms_ < ms) { if (this->nextion_queue_[i]->queue_time + this->max_q_age_ms_ < ms) {
if (this->nextion_queue_[i]->queue_time == 0) if (this->nextion_queue_[i]->queue_time == 0)
@@ -95,7 +95,7 @@ int Nextion::upload_by_chunks_(HTTPClient *http, int range_start) {
} }
http->end(); http->end();
ESP_LOGN(TAG, "this->content_length_ %d sent %d", this->content_length_, sent); ESP_LOGN(TAG, "this->content_length_ %d sent %d", this->content_length_, sent);
for (uint32_t i = 0; i < range; i += 4096) { for (int i = 0; i < range; i += 4096) {
this->write_array(&this->transfer_buffer_[i], 4096); this->write_array(&this->transfer_buffer_[i], 4096);
this->content_length_ -= 4096; this->content_length_ -= 4096;
ESP_LOGN(TAG, "this->content_length_ %d range %d range_end %d range_start %d", this->content_length_, range, ESP_LOGN(TAG, "this->content_length_ %d range %d range_end %d range_start %d", this->content_length_, range,
@@ -238,7 +238,7 @@ void Nextion::upload_tft() {
// The Nextion display will, if it's ready to accept data, send a 0x05 byte. // The Nextion display will, if it's ready to accept data, send a 0x05 byte.
ESP_LOGD(TAG, "Upgrade response is %s %zu", response.c_str(), response.length()); ESP_LOGD(TAG, "Upgrade response is %s %zu", response.c_str(), response.length());
for (int i = 0; i < response.length(); i++) { for (size_t i = 0; i < response.length(); i++) {
ESP_LOGD(TAG, "Available %d : 0x%02X", i, response[i]); ESP_LOGD(TAG, "Available %d : 0x%02X", i, response[i]);
} }
@@ -24,7 +24,7 @@ void NextionSensor::add_to_wave_buffer(float state) {
wave_buffer_.push_back(wave_state); wave_buffer_.push_back(wave_state);
if (this->wave_buffer_.size() > this->wave_max_length_) { if (this->wave_buffer_.size() > (size_t) this->wave_max_length_) {
this->wave_buffer_.erase(this->wave_buffer_.begin()); this->wave_buffer_.erase(this->wave_buffer_.begin());
} }
} }
+1 -1
View File
@@ -93,7 +93,7 @@ bool NdefMessage::add_uri_record(const std::string &uri) { return this->add_reco
std::vector<uint8_t> NdefMessage::encode() { std::vector<uint8_t> NdefMessage::encode() {
std::vector<uint8_t> data; std::vector<uint8_t> data;
for (uint8_t i = 0; i < this->records_.size(); i++) { for (size_t i = 0; i < this->records_.size(); i++) {
auto encoded_record = this->records_[i]->encode(i == 0, (i + 1) == this->records_.size()); auto encoded_record = this->records_[i]->encode(i == 0, (i + 1) == this->records_.size());
data.insert(data.end(), encoded_record.begin(), encoded_record.end()); data.insert(data.end(), encoded_record.begin(), encoded_record.end());
} }
+2 -2
View File
@@ -10,7 +10,7 @@ static const char *const TAG = "nfc";
std::string format_uid(std::vector<uint8_t> &uid) { std::string format_uid(std::vector<uint8_t> &uid) {
char buf[(uid.size() * 2) + uid.size() - 1]; char buf[(uid.size() * 2) + uid.size() - 1];
int offset = 0; int offset = 0;
for (uint8_t i = 0; i < uid.size(); i++) { for (size_t i = 0; i < uid.size(); i++) {
const char *format = "%02X"; const char *format = "%02X";
if (i + 1 < uid.size()) if (i + 1 < uid.size())
format = "%02X-"; format = "%02X-";
@@ -22,7 +22,7 @@ std::string format_uid(std::vector<uint8_t> &uid) {
std::string format_bytes(std::vector<uint8_t> &bytes) { std::string format_bytes(std::vector<uint8_t> &bytes) {
char buf[(bytes.size() * 2) + bytes.size() - 1]; char buf[(bytes.size() * 2) + bytes.size() - 1];
int offset = 0; int offset = 0;
for (uint8_t i = 0; i < bytes.size(); i++) { for (size_t i = 0; i < bytes.size(); i++) {
const char *format = "%02X"; const char *format = "%02X";
if (i + 1 < bytes.size()) if (i + 1 < bytes.size())
format = "%02X "; format = "%02X ";
+14 -14
View File
@@ -141,14 +141,14 @@ void OTAComponent::handle_() {
if (!this->readall_(buf, 5)) { if (!this->readall_(buf, 5)) {
ESP_LOGW(TAG, "Reading magic bytes failed!"); ESP_LOGW(TAG, "Reading magic bytes failed!");
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} }
// 0x6C, 0x26, 0xF7, 0x5C, 0x45 // 0x6C, 0x26, 0xF7, 0x5C, 0x45
if (buf[0] != 0x6C || buf[1] != 0x26 || buf[2] != 0xF7 || buf[3] != 0x5C || buf[4] != 0x45) { if (buf[0] != 0x6C || buf[1] != 0x26 || buf[2] != 0xF7 || buf[3] != 0x5C || buf[4] != 0x45) {
ESP_LOGW(TAG, "Magic bytes do not match! 0x%02X-0x%02X-0x%02X-0x%02X-0x%02X", buf[0], buf[1], buf[2], buf[3], ESP_LOGW(TAG, "Magic bytes do not match! 0x%02X-0x%02X-0x%02X-0x%02X-0x%02X", buf[0], buf[1], buf[2], buf[3],
buf[4]); buf[4]);
error_code = OTA_RESPONSE_ERROR_MAGIC; error_code = OTA_RESPONSE_ERROR_MAGIC;
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} }
// Send OK and version - 2 bytes // Send OK and version - 2 bytes
@@ -161,7 +161,7 @@ void OTAComponent::handle_() {
// Read features - 1 byte // Read features - 1 byte
if (!this->readall_(buf, 1)) { if (!this->readall_(buf, 1)) {
ESP_LOGW(TAG, "Reading features failed!"); ESP_LOGW(TAG, "Reading features failed!");
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} }
ota_features = buf[0]; // NOLINT ota_features = buf[0]; // NOLINT
ESP_LOGV(TAG, "OTA features is 0x%02X", ota_features); ESP_LOGV(TAG, "OTA features is 0x%02X", ota_features);
@@ -189,7 +189,7 @@ void OTAComponent::handle_() {
// Send nonce, 32 bytes hex MD5 // Send nonce, 32 bytes hex MD5
if (!this->writeall_(reinterpret_cast<uint8_t *>(sbuf), 32)) { if (!this->writeall_(reinterpret_cast<uint8_t *>(sbuf), 32)) {
ESP_LOGW(TAG, "Auth: Writing nonce failed!"); ESP_LOGW(TAG, "Auth: Writing nonce failed!");
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} }
// prepare challenge // prepare challenge
@@ -201,7 +201,7 @@ void OTAComponent::handle_() {
// Receive cnonce, 32 bytes hex MD5 // Receive cnonce, 32 bytes hex MD5
if (!this->readall_(buf, 32)) { if (!this->readall_(buf, 32)) {
ESP_LOGW(TAG, "Auth: Reading cnonce failed!"); ESP_LOGW(TAG, "Auth: Reading cnonce failed!");
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} }
sbuf[32] = '\0'; sbuf[32] = '\0';
ESP_LOGV(TAG, "Auth: CNonce is %s", sbuf); ESP_LOGV(TAG, "Auth: CNonce is %s", sbuf);
@@ -216,7 +216,7 @@ void OTAComponent::handle_() {
// Receive result, 32 bytes hex MD5 // Receive result, 32 bytes hex MD5
if (!this->readall_(buf + 64, 32)) { if (!this->readall_(buf + 64, 32)) {
ESP_LOGW(TAG, "Auth: Reading response failed!"); ESP_LOGW(TAG, "Auth: Reading response failed!");
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} }
sbuf[64 + 32] = '\0'; sbuf[64 + 32] = '\0';
ESP_LOGV(TAG, "Auth: Response is %s", sbuf + 64); ESP_LOGV(TAG, "Auth: Response is %s", sbuf + 64);
@@ -228,7 +228,7 @@ void OTAComponent::handle_() {
if (!matches) { if (!matches) {
ESP_LOGW(TAG, "Auth failed! Passwords do not match!"); ESP_LOGW(TAG, "Auth failed! Passwords do not match!");
error_code = OTA_RESPONSE_ERROR_AUTH_INVALID; error_code = OTA_RESPONSE_ERROR_AUTH_INVALID;
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} }
} }
#endif // USE_OTA_PASSWORD #endif // USE_OTA_PASSWORD
@@ -240,7 +240,7 @@ void OTAComponent::handle_() {
// Read size, 4 bytes MSB first // Read size, 4 bytes MSB first
if (!this->readall_(buf, 4)) { if (!this->readall_(buf, 4)) {
ESP_LOGW(TAG, "Reading size failed!"); ESP_LOGW(TAG, "Reading size failed!");
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} }
ota_size = 0; ota_size = 0;
for (uint8_t i = 0; i < 4; i++) { for (uint8_t i = 0; i < 4; i++) {
@@ -251,7 +251,7 @@ void OTAComponent::handle_() {
error_code = backend->begin(ota_size); error_code = backend->begin(ota_size);
if (error_code != OTA_RESPONSE_OK) if (error_code != OTA_RESPONSE_OK)
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
update_started = true; update_started = true;
// Acknowledge prepare OK - 1 byte // Acknowledge prepare OK - 1 byte
@@ -261,7 +261,7 @@ void OTAComponent::handle_() {
// Read binary MD5, 32 bytes // Read binary MD5, 32 bytes
if (!this->readall_(buf, 32)) { if (!this->readall_(buf, 32)) {
ESP_LOGW(TAG, "Reading binary MD5 checksum failed!"); ESP_LOGW(TAG, "Reading binary MD5 checksum failed!");
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} }
sbuf[32] = '\0'; sbuf[32] = '\0';
ESP_LOGV(TAG, "Update: Binary MD5 is %s", sbuf); ESP_LOGV(TAG, "Update: Binary MD5 is %s", sbuf);
@@ -281,19 +281,19 @@ void OTAComponent::handle_() {
continue; continue;
} }
ESP_LOGW(TAG, "Error receiving data for update, errno: %d", errno); ESP_LOGW(TAG, "Error receiving data for update, errno: %d", errno);
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} else if (read == 0) { } else if (read == 0) {
// $ man recv // $ man recv
// "When a stream socket peer has performed an orderly shutdown, the return value will // "When a stream socket peer has performed an orderly shutdown, the return value will
// be 0 (the traditional "end-of-file" return)." // be 0 (the traditional "end-of-file" return)."
ESP_LOGW(TAG, "Remote end closed connection"); ESP_LOGW(TAG, "Remote end closed connection");
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} }
error_code = backend->write(buf, read); error_code = backend->write(buf, read);
if (error_code != OTA_RESPONSE_OK) { if (error_code != OTA_RESPONSE_OK) {
ESP_LOGW(TAG, "Error writing binary data to flash!"); ESP_LOGW(TAG, "Error writing binary data to flash!");
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} }
total += read; total += read;
@@ -317,7 +317,7 @@ void OTAComponent::handle_() {
error_code = backend->end(); error_code = backend->end();
if (error_code != OTA_RESPONSE_OK) { if (error_code != OTA_RESPONSE_OK) {
ESP_LOGW(TAG, "Error ending OTA!"); ESP_LOGW(TAG, "Error ending OTA!");
goto error; goto error; // NOLINT(cppcoreguidelines-avoid-goto)
} }
// Acknowledge Update end OK - 1 byte // Acknowledge Update end OK - 1 byte
+1 -1
View File
@@ -330,7 +330,7 @@ bool PIDAutotuner::OscillationAmplitudeDetector::has_enough_data() const {
float PIDAutotuner::OscillationAmplitudeDetector::get_mean_oscillation_amplitude() const { float PIDAutotuner::OscillationAmplitudeDetector::get_mean_oscillation_amplitude() const {
float total_amplitudes = 0; float total_amplitudes = 0;
size_t total_amplitudes_n = 0; size_t total_amplitudes_n = 0;
for (int i = 1; i < std::min(phase_mins.size(), phase_maxs.size()) - 1; i++) { for (size_t i = 1; i < std::min(phase_mins.size(), phase_maxs.size()) - 1; i++) {
total_amplitudes += std::abs(phase_maxs[i] - phase_mins[i + 1]); total_amplitudes += std::abs(phase_maxs[i] - phase_mins[i + 1]);
total_amplitudes_n++; total_amplitudes_n++;
} }
+2 -4
View File
@@ -413,8 +413,6 @@ void Pipsolar::loop() {
this->state_ = STATE_IDLE; this->state_ = STATE_IDLE;
break; break;
case POLLING_QT: case POLLING_QT:
this->state_ = STATE_IDLE;
break;
case POLLING_QMN: case POLLING_QMN:
this->state_ = STATE_IDLE; this->state_ = STATE_IDLE;
break; break;
@@ -481,7 +479,7 @@ void Pipsolar::loop() {
ESP_LOGD(TAG, "Decode QFLAG"); ESP_LOGD(TAG, "Decode QFLAG");
// result like:"(EbkuvxzDajy" // result like:"(EbkuvxzDajy"
// get through all char: ignore first "(" Enable flag on 'E', Disable on 'D') else set the corresponding value // get through all char: ignore first "(" Enable flag on 'E', Disable on 'D') else set the corresponding value
for (int i = 1; i < strlen(tmp); i++) { for (size_t i = 1; i < strlen(tmp); i++) {
switch (tmp[i]) { switch (tmp[i]) {
case 'E': case 'E':
enabled = true; enabled = true;
@@ -530,7 +528,7 @@ void Pipsolar::loop() {
this->value_warnings_present_ = false; this->value_warnings_present_ = false;
this->value_faults_present_ = true; this->value_faults_present_ = true;
for (int i = 1; i < strlen(tmp); i++) { for (size_t i = 1; i < strlen(tmp); i++) {
enabled = tmp[i] == '1'; enabled = tmp[i] == '1';
switch (i) { switch (i) {
case 1: case 1:
+2 -2
View File
@@ -145,7 +145,7 @@ void PN532::loop() {
if (nfcid.size() == this->current_uid_.size()) { if (nfcid.size() == this->current_uid_.size()) {
bool same_uid = false; bool same_uid = false;
for (uint8_t i = 0; i < nfcid.size(); i++) for (size_t i = 0; i < nfcid.size(); i++)
same_uid |= nfcid[i] == this->current_uid_[i]; same_uid |= nfcid[i] == this->current_uid_[i];
if (same_uid) if (same_uid)
return; return;
@@ -367,7 +367,7 @@ bool PN532BinarySensor::process(std::vector<uint8_t> &data) {
if (data.size() != this->uid_.size()) if (data.size() != this->uid_.size())
return false; return false;
for (uint8_t i = 0; i < data.size(); i++) { for (size_t i = 0; i < data.size(); i++) {
if (data[i] != this->uid_[i]) if (data[i] != this->uid_[i])
return false; return false;
} }
@@ -35,7 +35,7 @@ void PulseMeterSensor::loop() {
this->publish_state(0); this->publish_state(0);
} else { } else {
// Calculate pulses/min from the pulse width in ms // Calculate pulses/min from the pulse width in ms
this->publish_state((60.0 * 1000.0) / pulse_width_ms); this->publish_state((60.0f * 1000.0f) / pulse_width_ms);
} }
} }
+2 -2
View File
@@ -28,7 +28,7 @@ std::string format_buffer(uint8_t *b, uint8_t len) {
std::string format_uid(std::vector<uint8_t> &uid) { std::string format_uid(std::vector<uint8_t> &uid) {
char buf[32]; char buf[32];
int offset = 0; int offset = 0;
for (uint8_t i = 0; i < uid.size(); i++) { for (size_t i = 0; i < uid.size(); i++) {
const char *format = "%02X"; const char *format = "%02X";
if (i + 1 < uid.size()) if (i + 1 < uid.size())
format = "%02X-"; format = "%02X-";
@@ -479,7 +479,7 @@ bool RC522BinarySensor::process(std::vector<uint8_t> &data) {
if (data.size() != this->uid_.size()) if (data.size() != this->uid_.size())
result = false; result = false;
else { else {
for (uint8_t i = 0; i < data.size(); i++) { for (size_t i = 0; i < data.size(); i++) {
if (data[i] != this->uid_[i]) { if (data[i] != this->uid_[i]) {
result = false; result = false;
break; break;
@@ -113,7 +113,7 @@ void ProntoProtocol::send_pronto_(RemoteTransmitData *dst, const std::string &st
const char *p = str.c_str(); const char *p = str.c_str();
char *endptr[1]; char *endptr[1];
for (uint16_t i = 0; i < len; i++) { for (size_t i = 0; i < len; i++) {
uint16_t x = strtol(p, endptr, 16); uint16_t x = strtol(p, endptr, 16);
if (x == 0 && i >= NUMBERS_IN_PREAMBLE) { if (x == 0 && i >= NUMBERS_IN_PREAMBLE) {
// Alignment error?, bail immediately (often right result). // Alignment error?, bail immediately (often right result).
@@ -33,7 +33,7 @@ void RemoteTransmitterBase::send_(uint32_t send_times, uint32_t send_wait) {
uint32_t buffer_offset = 0; uint32_t buffer_offset = 0;
buffer_offset += sprintf(buffer, "Sending times=%u wait=%ums: ", send_times, send_wait); buffer_offset += sprintf(buffer, "Sending times=%u wait=%ums: ", send_times, send_wait);
for (int32_t i = 0; i < vec.size(); i++) { for (size_t i = 0; i < vec.size(); i++) {
const int32_t value = vec[i]; const int32_t value = vec[i];
const uint32_t remaining_length = sizeof(buffer) - buffer_offset; const uint32_t remaining_length = sizeof(buffer) - buffer_offset;
int written; int written;
@@ -113,7 +113,7 @@ void RemoteTransmitterComponent::send_internal(uint32_t send_times, uint32_t sen
this->rmt_temp_.push_back(rmt_item); this->rmt_temp_.push_back(rmt_item);
} }
for (uint16_t i = 0; i < send_times; i++) { for (uint32_t i = 0; i < send_times; i++) {
esp_err_t error = rmt_write_items(this->channel_, this->rmt_temp_.data(), this->rmt_temp_.size(), true); esp_err_t error = rmt_write_items(this->channel_, this->rmt_temp_.data(), this->rmt_temp_.size(), true);
if (error != ESP_OK) { if (error != ESP_OK) {
ESP_LOGW(TAG, "rmt_write_items failed: %s", esp_err_to_name(error)); ESP_LOGW(TAG, "rmt_write_items failed: %s", esp_err_to_name(error));

Some files were not shown because too many files have changed in this diff Show More