From 9d8e5dae568343cb8488328bee0c4e41cb253416 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 20 Jan 2024 14:43:24 -1000 Subject: [PATCH] clang-format --- components/ratgdo/callbacks.h | 12 +++++------- components/ratgdo/ratgdo.cpp | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/components/ratgdo/callbacks.h b/components/ratgdo/callbacks.h index 6230816..3023b3a 100644 --- a/components/ratgdo/callbacks.h +++ b/components/ratgdo/callbacks.h @@ -27,7 +27,6 @@ namespace ratgdo { std::vector> callbacks_; }; - template class ExpiringCallbacks; @@ -35,9 +34,9 @@ namespace ratgdo { class ExpiringCallbacks { public: template - void operator()(uint32_t expiration, Callback&& callback) - { - this->callbacks_.push_back(std::make_pair(expiration, std::forward(callback))); + void operator()(uint32_t expiration, Callback&& callback) + { + this->callbacks_.push_back(std::make_pair(expiration, std::forward(callback))); } void trigger(uint32_t now, Ts... args) @@ -50,7 +49,7 @@ namespace ratgdo { this->callbacks_.clear(); } - bool is_expired(uint32_t now) const + bool is_expired(uint32_t now) const { bool expired = true; for (auto& cb : this->callbacks_) { @@ -61,7 +60,7 @@ namespace ratgdo { return expired; } - void clear() + void clear() { this->callbacks_.clear(); } @@ -70,6 +69,5 @@ namespace ratgdo { std::vector>> callbacks_; }; - } // namespace ratgdo } // namespace esphome diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index c84628c..7d3079b 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -198,7 +198,7 @@ namespace ratgdo { } if (learn_state == LearnState::INACTIVE) { - defer([=](){ this->query_paired_devices(); }); + defer([=]() { this->query_paired_devices(); }); } this->learn_state = learn_state; @@ -249,7 +249,7 @@ namespace ratgdo { this->motion_state = MotionState::CLEAR; }); if (*this->light_state == LightState::OFF) { - defer([=]() {this->query_status(); }); + defer([=]() { this->query_status(); }); } } }