mirror of
https://github.com/esphome/esphome.git
synced 2024-12-05 13:54:09 +01:00
fixed more clang-tidy issues
This commit is contained in:
parent
c13d14fcde
commit
8eb6ea2f00
@ -157,7 +157,7 @@ void DatapointComponent::datapoint_value_changed(uint32_t value) {
|
||||
ESP_LOGW(TAG, "unused value update by sensor %s", get_component_name().c_str());
|
||||
}
|
||||
|
||||
void DatapointComponent::datapoint_value_changed(std::string value) {
|
||||
void DatapointComponent::datapoint_value_changed(const std::string &value) {
|
||||
ESP_LOGW(TAG, "unused value update by sensor %s", get_component_name().c_str());
|
||||
}
|
||||
|
||||
@ -266,7 +266,7 @@ void DatapointComponent::subscribe_hass_(const std::string &entity_id, const std
|
||||
return;
|
||||
}
|
||||
}
|
||||
HassSubscription subscription{entity_id};
|
||||
HassSubscription subscription{entity_id, ""};
|
||||
subscription.callbacks.push_back(f);
|
||||
hass_subscriptions_.push_back(subscription);
|
||||
|
||||
|
@ -42,7 +42,7 @@ class DatapointComponent {
|
||||
virtual void datapoint_value_changed(uint8_t value);
|
||||
virtual void datapoint_value_changed(uint16_t value);
|
||||
virtual void datapoint_value_changed(uint32_t value);
|
||||
virtual void datapoint_value_changed(std::string value);
|
||||
virtual void datapoint_value_changed(const std::string &value);
|
||||
virtual void datapoint_value_changed(uint8_t *value, size_t length);
|
||||
|
||||
void write_datapoint_value_(float value);
|
||||
|
@ -23,7 +23,7 @@ void OptolinkSelect::control(const std::string &value) {
|
||||
}
|
||||
};
|
||||
|
||||
void OptolinkSelect::datapoint_value_changed(std::string value) {
|
||||
void OptolinkSelect::datapoint_value_changed(const std::string &value) {
|
||||
auto pos = mapping_->find(value);
|
||||
if (pos == mapping_->end()) {
|
||||
set_optolink_state_("value %s not found in select %s", value.c_str(), get_component_name().c_str());
|
||||
|
@ -29,7 +29,7 @@ class OptolinkSelect : public DatapointComponent, public esphome::select::Select
|
||||
void control(const std::string &value) override;
|
||||
|
||||
const StringRef &get_component_name() override { return get_name(); }
|
||||
void datapoint_value_changed(std::string value) override;
|
||||
void datapoint_value_changed(const std::string &value) override;
|
||||
void datapoint_value_changed(uint8_t value) override;
|
||||
void datapoint_value_changed(uint16_t value) override;
|
||||
void datapoint_value_changed(uint32_t value) override;
|
||||
|
@ -34,6 +34,7 @@ uint8_t *encode_time_string(const std::string &input) {
|
||||
char *token = strtok(buffer, " ");
|
||||
while (token && time_count < 8) {
|
||||
Time current_time;
|
||||
// NOLINTNEXTLINE
|
||||
if (sscanf(token, "%d:%d", ¤t_time.hours, ¤t_time.minutes) == 2) {
|
||||
if (check_time_values(current_time) && check_time_sequence(prev_time, current_time)) {
|
||||
time_values[time_count++] = current_time;
|
||||
|
Loading…
Reference in New Issue
Block a user