mirror of
https://github.com/esphome/esphome.git
synced 2026-08-31 18:16:03 +00:00
[pid][nextion][pn532_i2c][pipsolar] Fix copy-paste and logic bugs (#14551)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
9ab5f5d451
commit
a9cceebb33
@@ -88,7 +88,7 @@ void NextionComponent::update_component_settings(bool force_update) {
|
||||
this->send_state_to_nextion();
|
||||
}
|
||||
|
||||
if (this->component_flags_.bco_needs_update || (force_update && this->component_flags_.bco2_is_set)) {
|
||||
if (this->component_flags_.bco_needs_update || (force_update && this->component_flags_.bco_is_set)) {
|
||||
this->nextion_->set_component_background_color(this->variable_name_.c_str(), this->bco_);
|
||||
this->component_flags_.bco_needs_update = false;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ PIDAutotuner::PIDAutotuneResult PIDAutotuner::update(float setpoint, float proce
|
||||
}
|
||||
|
||||
bool zc_symmetrical = this->frequency_detector_.is_increase_decrease_symmetrical();
|
||||
bool amplitude_convergent = this->frequency_detector_.is_increase_decrease_symmetrical();
|
||||
bool amplitude_convergent = this->amplitude_detector_.is_amplitude_convergent();
|
||||
if (!zc_symmetrical || !amplitude_convergent) {
|
||||
// The frequency/amplitude is not fully accurate yet, try to wait
|
||||
// until the fault clears, or terminate after a while anyway
|
||||
@@ -362,7 +362,7 @@ bool PIDAutotuner::OscillationAmplitudeDetector::is_amplitude_convergent() const
|
||||
for (auto v : this->phase_mins)
|
||||
global_min = std::min(global_min, v);
|
||||
for (auto v : this->phase_maxs)
|
||||
global_max = std::min(global_max, v);
|
||||
global_max = std::max(global_max, v);
|
||||
float global_amplitude = (global_max - global_min) / 2.0f;
|
||||
float mean_amplitude = this->get_mean_oscillation_amplitude();
|
||||
return (mean_amplitude - global_amplitude) / (global_amplitude) < 0.05f;
|
||||
|
||||
@@ -647,6 +647,7 @@ void Pipsolar::handle_qpiws_(const char *message) {
|
||||
case 34:
|
||||
this->publish_binary_sensor_(enabled, this->warning_high_ac_input_during_bus_soft_start_);
|
||||
value_warnings_present |= enabled.value_or(false);
|
||||
break;
|
||||
case 35:
|
||||
this->publish_binary_sensor_(enabled, this->warning_battery_equalization_);
|
||||
value_warnings_present |= enabled.value_or(false);
|
||||
|
||||
@@ -49,7 +49,7 @@ bool PN532I2C::read_response(uint8_t command, std::vector<uint8_t> &data) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (data[1] != 0x00 && data[2] != 0x00 && data[3] != 0xFF) {
|
||||
if (data[1] != 0x00 || data[2] != 0x00 || data[3] != 0xFF) {
|
||||
// invalid packet
|
||||
ESP_LOGV(TAG, "read data invalid preamble!");
|
||||
return false;
|
||||
@@ -95,7 +95,7 @@ uint8_t PN532I2C::read_response_length_() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (data[1] != 0x00 && data[2] != 0x00 && data[3] != 0xFF) {
|
||||
if (data[1] != 0x00 || data[2] != 0x00 || data[3] != 0xFF) {
|
||||
// invalid packet
|
||||
ESP_LOGV(TAG, "read data invalid preamble!");
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user