mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 12:46:22 +01:00
fixed more clang-tidy issues
This commit is contained in:
parent
c296453639
commit
f3b4e07358
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user