Activate owning-memory clang-tidy check (#1891)

* Activate owning-memory clang-tidy check

* Lint

* Lint

* Fix issue with new NfcTag constructor

* Update pointers for number and select

* Add back the NOLINT to display buffer

* Fix merge

* DSMR fixes

* Nextion fixes

* Fix pipsolar

* Fix lwip socket

* Format

* Change socket fix

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Otto Winter
2021-09-13 11:31:02 +02:00
committed by GitHub
parent e0cff214b2
commit a4867a00ea
75 changed files with 293 additions and 321 deletions
@@ -34,7 +34,7 @@ void NextionSensor::update() {
return;
if (this->wave_chan_id_ == UINT8_MAX) {
this->nextion_->add_to_get_queue(this);
this->nextion_->add_to_get_queue(shared_from_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(this, (int) state_value);
this->nextion_->add_no_result_to_queue_with_set(shared_from_this(), (int) state_value);
} else {
this->nextion_->add_no_result_to_queue_with_set(this, (int) state);
this->nextion_->add_no_result_to_queue_with_set(shared_from_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(this);
this->nextion_->add_addt_command_to_queue(shared_from_this());
}
} // namespace nextion
@@ -8,7 +8,10 @@ namespace esphome {
namespace nextion {
class NextionSensor;
class NextionSensor : public NextionComponent, public sensor::Sensor, public PollingComponent {
class NextionSensor : public NextionComponent,
public sensor::Sensor,
public PollingComponent,
public std::enable_shared_from_this<NextionSensor> {
public:
NextionSensor(NextionBase *nextion) { this->nextion_ = nextion; }
void send_state_to_nextion() override { this->set_state(this->state, false, true); };