mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-29 17:28:28 +02:00
Activate some clang-tidy checks (#1884)
This commit is contained in:
@@ -7,13 +7,13 @@ namespace esphome {
|
||||
namespace text_sensor {
|
||||
|
||||
#define LOG_TEXT_SENSOR(prefix, type, obj) \
|
||||
if (obj != nullptr) { \
|
||||
ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, type, obj->get_name().c_str()); \
|
||||
if (!obj->get_icon().empty()) { \
|
||||
ESP_LOGCONFIG(TAG, "%s Icon: '%s'", prefix, obj->get_icon().c_str()); \
|
||||
if ((obj) != nullptr) { \
|
||||
ESP_LOGCONFIG(TAG, "%s%s '%s'", prefix, type, (obj)->get_name().c_str()); \
|
||||
if (!(obj)->get_icon().empty()) { \
|
||||
ESP_LOGCONFIG(TAG, "%s Icon: '%s'", prefix, (obj)->get_icon().c_str()); \
|
||||
} \
|
||||
if (!obj->unique_id().empty()) { \
|
||||
ESP_LOGV(TAG, "%s Unique ID: '%s'", prefix, obj->unique_id().c_str()); \
|
||||
if (!(obj)->unique_id().empty()) { \
|
||||
ESP_LOGV(TAG, "%s Unique ID: '%s'", prefix, (obj)->unique_id().c_str()); \
|
||||
} \
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class TextSensor : public Nameable {
|
||||
explicit TextSensor();
|
||||
explicit TextSensor(const std::string &name);
|
||||
|
||||
void publish_state(std::string state);
|
||||
void publish_state(const std::string &state);
|
||||
|
||||
void set_icon(const std::string &icon);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user