fixed more clang-tidy issues

This commit is contained in:
j0ta29 2024-02-19 21:19:19 +00:00
parent c296453639
commit f3b4e07358
3 changed files with 3 additions and 3 deletions

View File

@ -259,7 +259,7 @@ void DatapointComponent::set_optolink_state_(const char *format, ...) {
std::string DatapointComponent::get_optolink_state_() { return optolink_->get_state(); }
void DatapointComponent::subscribe_hass_(const std::string entity_id, std::function<void(std::string)> f) {
void DatapointComponent::subscribe_hass_(const std::string &entity_id, const std::function<void(std::string)> &f) {
for (auto &subscription : hass_subscriptions_) {
if (subscription.entity_id == entity_id) {
subscription.callbacks.push_back(f);

View File

@ -55,7 +55,7 @@ class DatapointComponent {
void set_optolink_state_(const char *format, ...);
std::string get_optolink_state_();
void subscribe_hass_(const std::string entity_id, std::function<void(std::string)> f);
void subscribe_hass_(const std::string &entity_id, const std::function<void(std::string)> &f);
private:
const size_t max_retries_until_reset_ = 10;

View File

@ -23,7 +23,7 @@ bool check_time_values(const Time &time) {
return (time.hours >= 0 && time.hours <= 23) && (time.minutes >= 0 && time.minutes <= 59);
}
uint8_t *encode_time_string(const std::string input) {
uint8_t *encode_time_string(const std::string &input) {
char buffer[49];
strncpy(buffer, input.c_str(), sizeof(buffer));
buffer[sizeof(buffer) - 1] = 0x00;