1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-03 18:42:23 +01:00

Revert nextion clang-tidy changes (#2566)

This commit is contained in:
Otto Winter
2021-10-20 20:31:13 +02:00
committed by GitHub
parent 64a45dc6a6
commit 15b5968418
13 changed files with 78 additions and 70 deletions

View File

@@ -34,7 +34,7 @@ void NextionSensor::update() {
return;
if (this->wave_chan_id_ == UINT8_MAX) {
this->nextion_->add_to_get_queue(shared_from_this());
this->nextion_->add_to_get_queue(this);
} else {
if (this->send_last_value_) {
this->add_to_wave_buffer(this->last_value_);
@@ -62,9 +62,9 @@ void NextionSensor::set_state(float state, bool publish, bool send_to_nextion) {
double to_multiply = pow(10, this->precision_);
int state_value = (int) (state * to_multiply);
this->nextion_->add_no_result_to_queue_with_set(shared_from_this(), (int) state_value);
this->nextion_->add_no_result_to_queue_with_set(this, (int) state_value);
} else {
this->nextion_->add_no_result_to_queue_with_set(shared_from_this(), (int) state);
this->nextion_->add_no_result_to_queue_with_set(this, (int) state);
}
}
}
@@ -103,7 +103,7 @@ void NextionSensor::wave_update_() {
buffer_to_send, this->wave_buffer_.size(), this->component_id_, this->wave_chan_id_);
#endif
this->nextion_->add_addt_command_to_queue(shared_from_this());
this->nextion_->add_addt_command_to_queue(this);
}
} // namespace nextion

View File

@@ -8,10 +8,7 @@ namespace esphome {
namespace nextion {
class NextionSensor;
class NextionSensor : public NextionComponent,
public sensor::Sensor,
public PollingComponent,
public std::enable_shared_from_this<NextionSensor> {
class NextionSensor : public NextionComponent, public sensor::Sensor, public PollingComponent {
public:
NextionSensor(NextionBase *nextion) { this->nextion_ = nextion; }
void send_state_to_nextion() override { this->set_state(this->state, false, true); };