diff --git a/esphome/components/a01nyub/a01nyub.cpp b/esphome/components/a01nyub/a01nyub.cpp index 6111af2b7e..8c97169cbf 100644 --- a/esphome/components/a01nyub/a01nyub.cpp +++ b/esphome/components/a01nyub/a01nyub.cpp @@ -6,7 +6,7 @@ namespace esphome::a01nyub { -static const char *const TAG = "a01nyub.sensor"; +ESPHOME_LOG_TAG(TAG, "a01nyub.sensor"); void A01nyubComponent::loop() { uint8_t data; diff --git a/esphome/components/a02yyuw/a02yyuw.cpp b/esphome/components/a02yyuw/a02yyuw.cpp index 2832334ef1..20e8f6c7b5 100644 --- a/esphome/components/a02yyuw/a02yyuw.cpp +++ b/esphome/components/a02yyuw/a02yyuw.cpp @@ -6,7 +6,7 @@ namespace esphome::a02yyuw { -static const char *const TAG = "a02yyuw.sensor"; +ESPHOME_LOG_TAG(TAG, "a02yyuw.sensor"); void A02yyuwComponent::loop() { uint8_t data; diff --git a/esphome/components/a4988/a4988.cpp b/esphome/components/a4988/a4988.cpp index d8fc6752f3..4af9e8baef 100644 --- a/esphome/components/a4988/a4988.cpp +++ b/esphome/components/a4988/a4988.cpp @@ -3,7 +3,7 @@ namespace esphome::a4988 { -static const char *const TAG = "a4988.stepper"; +ESPHOME_LOG_TAG(TAG, "a4988.stepper"); void A4988::setup() { if (this->sleep_pin_ != nullptr) { diff --git a/esphome/components/absolute_humidity/absolute_humidity.cpp b/esphome/components/absolute_humidity/absolute_humidity.cpp index 3137a59fad..36b6534c0d 100644 --- a/esphome/components/absolute_humidity/absolute_humidity.cpp +++ b/esphome/components/absolute_humidity/absolute_humidity.cpp @@ -3,7 +3,7 @@ namespace esphome::absolute_humidity { -static const char *const TAG{"absolute_humidity.sensor"}; +ESPHOME_LOG_TAG(TAG, "absolute_humidity.sensor"); void AbsoluteHumidityComponent::setup() { this->temperature_sensor_->add_on_state_callback([this](float state) { diff --git a/esphome/components/ac_dimmer/ac_dimmer.cpp b/esphome/components/ac_dimmer/ac_dimmer.cpp index 477962a040..e126a3d52a 100644 --- a/esphome/components/ac_dimmer/ac_dimmer.cpp +++ b/esphome/components/ac_dimmer/ac_dimmer.cpp @@ -14,7 +14,7 @@ namespace esphome::ac_dimmer { -static const char *const TAG = "ac_dimmer"; +ESPHOME_LOG_TAG(TAG, "ac_dimmer"); // Global array to store dimmer objects static AcDimmerDataStore *all_dimmers[32]; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/components/ac_dimmer/hw_timer_esp_idf.cpp b/esphome/components/ac_dimmer/hw_timer_esp_idf.cpp index 543b476085..fd26e6bccd 100644 --- a/esphome/components/ac_dimmer/hw_timer_esp_idf.cpp +++ b/esphome/components/ac_dimmer/hw_timer_esp_idf.cpp @@ -9,7 +9,7 @@ #include "esp_clk_tree.h" #include "soc/clk_tree_defs.h" -static const char *const TAG = "hw_timer_esp_idf"; +ESPHOME_LOG_TAG(TAG, "hw_timer_esp_idf"); namespace esphome::ac_dimmer { diff --git a/esphome/components/adalight/adalight_light_effect.cpp b/esphome/components/adalight/adalight_light_effect.cpp index bf6849acaf..e3510d380e 100644 --- a/esphome/components/adalight/adalight_light_effect.cpp +++ b/esphome/components/adalight/adalight_light_effect.cpp @@ -3,7 +3,7 @@ namespace esphome::adalight { -static const char *const TAG = "adalight_light_effect"; +ESPHOME_LOG_TAG(TAG, "adalight_light_effect"); static const uint32_t ADALIGHT_ACK_INTERVAL = 1000; static const uint32_t ADALIGHT_RECEIVE_TIMEOUT = 1000; diff --git a/esphome/components/adc/adc_sensor_common.cpp b/esphome/components/adc/adc_sensor_common.cpp index 70211000c3..dcb4138201 100644 --- a/esphome/components/adc/adc_sensor_common.cpp +++ b/esphome/components/adc/adc_sensor_common.cpp @@ -3,7 +3,7 @@ namespace esphome::adc { -static const char *const TAG = "adc"; +ESPHOME_LOG_TAG(TAG, "adc"); const LogString *sampling_mode_to_str(SamplingMode mode) { switch (mode) { diff --git a/esphome/components/adc/adc_sensor_esp32.cpp b/esphome/components/adc/adc_sensor_esp32.cpp index c9887cea7c..6bab6fc469 100644 --- a/esphome/components/adc/adc_sensor_esp32.cpp +++ b/esphome/components/adc/adc_sensor_esp32.cpp @@ -6,7 +6,7 @@ namespace esphome::adc { -static const char *const TAG = "adc"; +ESPHOME_LOG_TAG(TAG, "adc"); adc_oneshot_unit_handle_t ADCSensor::shared_adc_handles[2] = {nullptr, nullptr}; diff --git a/esphome/components/adc/adc_sensor_esp8266.cpp b/esphome/components/adc/adc_sensor_esp8266.cpp index 77a192e025..db231f7598 100644 --- a/esphome/components/adc/adc_sensor_esp8266.cpp +++ b/esphome/components/adc/adc_sensor_esp8266.cpp @@ -13,7 +13,7 @@ ADC_MODE(ADC_VCC) namespace esphome::adc { -static const char *const TAG = "adc"; +ESPHOME_LOG_TAG(TAG, "adc"); void ADCSensor::setup() { #ifndef USE_ADC_SENSOR_VCC diff --git a/esphome/components/adc/adc_sensor_libretiny.cpp b/esphome/components/adc/adc_sensor_libretiny.cpp index dfa545b395..2ea9da935f 100644 --- a/esphome/components/adc/adc_sensor_libretiny.cpp +++ b/esphome/components/adc/adc_sensor_libretiny.cpp @@ -5,7 +5,7 @@ namespace esphome::adc { -static const char *const TAG = "adc"; +ESPHOME_LOG_TAG(TAG, "adc"); void ADCSensor::setup() { #ifndef USE_ADC_SENSOR_VCC diff --git a/esphome/components/adc/adc_sensor_rp2.cpp b/esphome/components/adc/adc_sensor_rp2.cpp index ce665e8501..5756ac038a 100644 --- a/esphome/components/adc/adc_sensor_rp2.cpp +++ b/esphome/components/adc/adc_sensor_rp2.cpp @@ -17,7 +17,7 @@ namespace esphome::adc { -static const char *const TAG = "adc"; +ESPHOME_LOG_TAG(TAG, "adc"); // The on-die temperature sensor sits on the last ADC channel: input 4 on RP2040 // and RP2350A, but input 8 on RP2350B, which has eight external channels rather diff --git a/esphome/components/adc/adc_sensor_zephyr.cpp b/esphome/components/adc/adc_sensor_zephyr.cpp index bf45059740..c2f4aedd49 100644 --- a/esphome/components/adc/adc_sensor_zephyr.cpp +++ b/esphome/components/adc/adc_sensor_zephyr.cpp @@ -7,7 +7,7 @@ namespace esphome::adc { -static const char *const TAG = "adc"; +ESPHOME_LOG_TAG(TAG, "adc"); void ADCSensor::setup() { if (!adc_is_ready_dt(this->channel_)) { diff --git a/esphome/components/adc128s102/adc128s102.cpp b/esphome/components/adc128s102/adc128s102.cpp index ef0db4730a..bbe95d03be 100644 --- a/esphome/components/adc128s102/adc128s102.cpp +++ b/esphome/components/adc128s102/adc128s102.cpp @@ -3,7 +3,7 @@ namespace esphome::adc128s102 { -static const char *const TAG = "adc128s102"; +ESPHOME_LOG_TAG(TAG, "adc128s102"); float ADC128S102::get_setup_priority() const { return setup_priority::HARDWARE; } diff --git a/esphome/components/adc128s102/sensor/adc128s102_sensor.cpp b/esphome/components/adc128s102/sensor/adc128s102_sensor.cpp index 01b6a3f2b8..3cc3f0c056 100644 --- a/esphome/components/adc128s102/sensor/adc128s102_sensor.cpp +++ b/esphome/components/adc128s102/sensor/adc128s102_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::adc128s102 { -static const char *const TAG = "adc128s102.sensor"; +ESPHOME_LOG_TAG(TAG, "adc128s102.sensor"); ADC128S102Sensor::ADC128S102Sensor(uint8_t channel) : channel_(channel) {} diff --git a/esphome/components/addressable_light/addressable_light_display.cpp b/esphome/components/addressable_light/addressable_light_display.cpp index 4cbcb3324b..6a3df025e6 100644 --- a/esphome/components/addressable_light/addressable_light_display.cpp +++ b/esphome/components/addressable_light/addressable_light_display.cpp @@ -3,7 +3,7 @@ namespace esphome::addressable_light { -static const char *const TAG = "addressable_light.display"; +ESPHOME_LOG_TAG(TAG, "addressable_light.display"); int AddressableLightDisplay::get_width_internal() { return this->width_; } int AddressableLightDisplay::get_height_internal() { return this->height_; } diff --git a/esphome/components/ade7880/ade7880.cpp b/esphome/components/ade7880/ade7880.cpp index 0f4189ad90..e131980ebb 100644 --- a/esphome/components/ade7880/ade7880.cpp +++ b/esphome/components/ade7880/ade7880.cpp @@ -15,7 +15,7 @@ namespace esphome::ade7880 { -static const char *const TAG = "ade7880"; +ESPHOME_LOG_TAG(TAG, "ade7880"); void IRAM_ATTR ADE7880Store::gpio_intr(ADE7880Store *arg) { arg->reset_done = true; } diff --git a/esphome/components/ade7953_base/ade7953_base.cpp b/esphome/components/ade7953_base/ade7953_base.cpp index 1adf44f8f7..21a16c5081 100644 --- a/esphome/components/ade7953_base/ade7953_base.cpp +++ b/esphome/components/ade7953_base/ade7953_base.cpp @@ -5,7 +5,7 @@ namespace esphome::ade7953_base { -static const char *const TAG = "ade7953"; +ESPHOME_LOG_TAG(TAG, "ade7953"); constexpr uint16_t CONFIG_DEFAULT = 0x8004u; constexpr uint16_t CONFIG_LOCK_BIT = 0x8000u; diff --git a/esphome/components/ade7953_i2c/ade7953_i2c.cpp b/esphome/components/ade7953_i2c/ade7953_i2c.cpp index 252e55ee5c..cc0fb7e80d 100644 --- a/esphome/components/ade7953_i2c/ade7953_i2c.cpp +++ b/esphome/components/ade7953_i2c/ade7953_i2c.cpp @@ -4,7 +4,7 @@ namespace esphome::ade7953_i2c { -static const char *const TAG = "ade7953"; +ESPHOME_LOG_TAG(TAG, "ade7953"); void AdE7953I2c::dump_config() { ESP_LOGCONFIG(TAG, "ADE7953_i2c:"); diff --git a/esphome/components/ade7953_spi/ade7953_spi.cpp b/esphome/components/ade7953_spi/ade7953_spi.cpp index c2d85231d6..e7c7bac97f 100644 --- a/esphome/components/ade7953_spi/ade7953_spi.cpp +++ b/esphome/components/ade7953_spi/ade7953_spi.cpp @@ -4,7 +4,7 @@ namespace esphome::ade7953_spi { -static const char *const TAG = "ade7953"; +ESPHOME_LOG_TAG(TAG, "ade7953"); // Datasheet requires at least 1.2µs after clearing CONFIG LOCK_BIT before raising CS constexpr uint8_t CONFIG_LOCK_SETTLE_US = 2; diff --git a/esphome/components/ads1115/ads1115.cpp b/esphome/components/ads1115/ads1115.cpp index 58704bf7c6..b75e1b7304 100644 --- a/esphome/components/ads1115/ads1115.cpp +++ b/esphome/components/ads1115/ads1115.cpp @@ -4,7 +4,7 @@ namespace esphome::ads1115 { -static const char *const TAG = "ads1115"; +ESPHOME_LOG_TAG(TAG, "ads1115"); static const uint8_t ADS1115_REGISTER_CONVERSION = 0x00; static const uint8_t ADS1115_REGISTER_CONFIG = 0x01; diff --git a/esphome/components/ads1115/sensor/ads1115_sensor.cpp b/esphome/components/ads1115/sensor/ads1115_sensor.cpp index 8086d97231..776346171b 100644 --- a/esphome/components/ads1115/sensor/ads1115_sensor.cpp +++ b/esphome/components/ads1115/sensor/ads1115_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::ads1115 { -static const char *const TAG = "ads1115.sensor"; +ESPHOME_LOG_TAG(TAG, "ads1115.sensor"); float ADS1115Sensor::sample() { return this->parent_->request_measurement(this->multiplexer_, this->gain_, this->resolution_, this->samplerate_); diff --git a/esphome/components/ads1118/ads1118.cpp b/esphome/components/ads1118/ads1118.cpp index 0a07193bfe..c21dc2d3f0 100644 --- a/esphome/components/ads1118/ads1118.cpp +++ b/esphome/components/ads1118/ads1118.cpp @@ -4,7 +4,7 @@ namespace esphome::ads1118 { -static const char *const TAG = "ads1118"; +ESPHOME_LOG_TAG(TAG, "ads1118"); static const uint8_t ADS1118_DATA_RATE_860_SPS = 0b111; void ADS1118::setup() { diff --git a/esphome/components/ads1118/sensor/ads1118_sensor.cpp b/esphome/components/ads1118/sensor/ads1118_sensor.cpp index 383a3d25fc..2b3d68d1f4 100644 --- a/esphome/components/ads1118/sensor/ads1118_sensor.cpp +++ b/esphome/components/ads1118/sensor/ads1118_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::ads1118 { -static const char *const TAG = "ads1118.sensor"; +ESPHOME_LOG_TAG(TAG, "ads1118.sensor"); void ADS1118Sensor::dump_config() { LOG_SENSOR(" ", "ADS1118 Sensor", this); diff --git a/esphome/components/ags10/ags10.cpp b/esphome/components/ags10/ags10.cpp index 377677ccdb..2db39a206d 100644 --- a/esphome/components/ags10/ags10.cpp +++ b/esphome/components/ags10/ags10.cpp @@ -4,7 +4,7 @@ #include namespace esphome::ags10 { -static const char *const TAG = "ags10"; +ESPHOME_LOG_TAG(TAG, "ags10"); // Data acquisition. static const uint8_t REG_TVOC = 0x00; diff --git a/esphome/components/aht10/aht10.cpp b/esphome/components/aht10/aht10.cpp index cc90abfc3a..83ab55e657 100644 --- a/esphome/components/aht10/aht10.cpp +++ b/esphome/components/aht10/aht10.cpp @@ -19,7 +19,7 @@ namespace esphome::aht10 { -static const char *const TAG = "aht10"; +ESPHOME_LOG_TAG(TAG, "aht10"); static const uint8_t AHT10_INITIALIZE_CMD[] = {0xE1, 0x08, 0x00}; static const uint8_t AHT20_INITIALIZE_CMD[] = {0xBE, 0x08, 0x00}; static const uint8_t AHT10_MEASURE_CMD[] = {0xAC, 0x33, 0x00}; diff --git a/esphome/components/aic3204/aic3204.cpp b/esphome/components/aic3204/aic3204.cpp index 0ba960fd70..892a6c56ac 100644 --- a/esphome/components/aic3204/aic3204.cpp +++ b/esphome/components/aic3204/aic3204.cpp @@ -6,7 +6,7 @@ namespace esphome::aic3204 { -static const char *const TAG = "aic3204"; +ESPHOME_LOG_TAG(TAG, "aic3204"); #define ERROR_CHECK(err, msg) \ if (!(err)) { \ diff --git a/esphome/components/airthings_ble/airthings_listener.cpp b/esphome/components/airthings_ble/airthings_listener.cpp index f2625a7832..5f0e2eb3ec 100644 --- a/esphome/components/airthings_ble/airthings_listener.cpp +++ b/esphome/components/airthings_ble/airthings_listener.cpp @@ -4,7 +4,7 @@ namespace esphome::airthings_ble { -static const char *const TAG = "airthings_ble"; +ESPHOME_LOG_TAG(TAG, "airthings_ble"); bool AirthingsListener::parse_device(const ble_device_base::ESPBTDevice &device) { for (auto &it : device.get_manufacturer_datas()) { diff --git a/esphome/components/airthings_wave_base/airthings_wave_base.cpp b/esphome/components/airthings_wave_base/airthings_wave_base.cpp index 5fa59f22fd..d67a2e4a0f 100644 --- a/esphome/components/airthings_wave_base/airthings_wave_base.cpp +++ b/esphome/components/airthings_wave_base/airthings_wave_base.cpp @@ -8,7 +8,7 @@ namespace esphome::airthings_wave_base { -static const char *const TAG = "airthings_wave_base"; +ESPHOME_LOG_TAG(TAG, "airthings_wave_base"); void AirthingsWaveBase::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) { diff --git a/esphome/components/airthings_wave_mini/airthings_wave_mini.cpp b/esphome/components/airthings_wave_mini/airthings_wave_mini.cpp index f487e9dbc0..54dbc21a6d 100644 --- a/esphome/components/airthings_wave_mini/airthings_wave_mini.cpp +++ b/esphome/components/airthings_wave_mini/airthings_wave_mini.cpp @@ -4,7 +4,7 @@ namespace esphome::airthings_wave_mini { -static const char *const TAG = "airthings_wave_mini"; +ESPHOME_LOG_TAG(TAG, "airthings_wave_mini"); void AirthingsWaveMini::read_sensors(uint8_t *raw_value, uint16_t value_len) { auto *value = (WaveMiniReadings *) raw_value; diff --git a/esphome/components/airthings_wave_plus/airthings_wave_plus.cpp b/esphome/components/airthings_wave_plus/airthings_wave_plus.cpp index 80fe081b57..4b23cb685c 100644 --- a/esphome/components/airthings_wave_plus/airthings_wave_plus.cpp +++ b/esphome/components/airthings_wave_plus/airthings_wave_plus.cpp @@ -4,7 +4,7 @@ namespace esphome::airthings_wave_plus { -static const char *const TAG = "airthings_wave_plus"; +ESPHOME_LOG_TAG(TAG, "airthings_wave_plus"); void AirthingsWavePlus::read_sensors(uint8_t *raw_value, uint16_t value_len) { auto *value = (WavePlusReadings *) raw_value; diff --git a/esphome/components/alarm_control_panel/alarm_control_panel.cpp b/esphome/components/alarm_control_panel/alarm_control_panel.cpp index fc72c13ce3..6f23b1aca8 100644 --- a/esphome/components/alarm_control_panel/alarm_control_panel.cpp +++ b/esphome/components/alarm_control_panel/alarm_control_panel.cpp @@ -10,7 +10,7 @@ namespace esphome::alarm_control_panel { -static const char *const TAG = "alarm_control_panel"; +ESPHOME_LOG_TAG(TAG, "alarm_control_panel"); AlarmControlPanelCall AlarmControlPanel::make_call() { return AlarmControlPanelCall(this); } diff --git a/esphome/components/alarm_control_panel/alarm_control_panel_call.cpp b/esphome/components/alarm_control_panel/alarm_control_panel_call.cpp index 0c43cd555a..667cae42a0 100644 --- a/esphome/components/alarm_control_panel/alarm_control_panel_call.cpp +++ b/esphome/components/alarm_control_panel/alarm_control_panel_call.cpp @@ -6,7 +6,7 @@ namespace esphome::alarm_control_panel { -static const char *const TAG = "alarm_control_panel"; +ESPHOME_LOG_TAG(TAG, "alarm_control_panel"); AlarmControlPanelCall::AlarmControlPanelCall(AlarmControlPanel *parent) : parent_(parent) {} diff --git a/esphome/components/alpha3/alpha3.cpp b/esphome/components/alpha3/alpha3.cpp index 92b00d87cb..ce81ca4025 100644 --- a/esphome/components/alpha3/alpha3.cpp +++ b/esphome/components/alpha3/alpha3.cpp @@ -7,7 +7,7 @@ namespace esphome::alpha3 { -static const char *const TAG = "alpha3"; +ESPHOME_LOG_TAG(TAG, "alpha3"); void Alpha3::dump_config() { ESP_LOGCONFIG(TAG, "ALPHA3"); diff --git a/esphome/components/am2315c/am2315c.cpp b/esphome/components/am2315c/am2315c.cpp index 8980a8dfc3..d34061889b 100644 --- a/esphome/components/am2315c/am2315c.cpp +++ b/esphome/components/am2315c/am2315c.cpp @@ -26,7 +26,7 @@ namespace esphome::am2315c { -static const char *const TAG = "am2315c"; +ESPHOME_LOG_TAG(TAG, "am2315c"); bool AM2315C::reset_register_(uint8_t reg) { // code based on demo code sent by www.aosong.com diff --git a/esphome/components/am2320/am2320.cpp b/esphome/components/am2320/am2320.cpp index 5445ab3898..94053ab5dc 100644 --- a/esphome/components/am2320/am2320.cpp +++ b/esphome/components/am2320/am2320.cpp @@ -10,7 +10,7 @@ namespace esphome::am2320 { -static const char *const TAG = "am2320"; +ESPHOME_LOG_TAG(TAG, "am2320"); void AM2320Component::update() { uint8_t data[8]; diff --git a/esphome/components/am43/cover/am43_cover.cpp b/esphome/components/am43/cover/am43_cover.cpp index 4b096983a4..6fb8c0c7eb 100644 --- a/esphome/components/am43/cover/am43_cover.cpp +++ b/esphome/components/am43/cover/am43_cover.cpp @@ -5,7 +5,7 @@ namespace esphome::am43 { -static const char *const TAG = "am43_cover"; +ESPHOME_LOG_TAG(TAG, "am43_cover"); using namespace esphome::cover; diff --git a/esphome/components/am43/sensor/am43_sensor.cpp b/esphome/components/am43/sensor/am43_sensor.cpp index ddc3eadae9..1a30af03ae 100644 --- a/esphome/components/am43/sensor/am43_sensor.cpp +++ b/esphome/components/am43/sensor/am43_sensor.cpp @@ -6,7 +6,7 @@ namespace esphome::am43 { -static const char *const TAG = "am43"; +ESPHOME_LOG_TAG(TAG, "am43"); void Am43::dump_config() { ESP_LOGCONFIG(TAG, "AM43"); diff --git a/esphome/components/analog_threshold/analog_threshold_binary_sensor.cpp b/esphome/components/analog_threshold/analog_threshold_binary_sensor.cpp index d25c10021c..c5061365a2 100644 --- a/esphome/components/analog_threshold/analog_threshold_binary_sensor.cpp +++ b/esphome/components/analog_threshold/analog_threshold_binary_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::analog_threshold { -static const char *const TAG = "analog_threshold.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "analog_threshold.binary_sensor"); void AnalogThresholdBinarySensor::setup() { float sensor_value = this->sensor_->get_state(); diff --git a/esphome/components/anova/anova.cpp b/esphome/components/anova/anova.cpp index b0769bb622..28e2da93e9 100644 --- a/esphome/components/anova/anova.cpp +++ b/esphome/components/anova/anova.cpp @@ -5,7 +5,7 @@ namespace esphome::anova { -static const char *const TAG = "anova"; +ESPHOME_LOG_TAG(TAG, "anova"); using namespace esphome::climate; diff --git a/esphome/components/apds9306/apds9306.cpp b/esphome/components/apds9306/apds9306.cpp index 57a502ca42..daf6bb6b33 100644 --- a/esphome/components/apds9306/apds9306.cpp +++ b/esphome/components/apds9306/apds9306.cpp @@ -7,7 +7,7 @@ namespace esphome::apds9306 { -static const char *const TAG = "apds9306"; +ESPHOME_LOG_TAG(TAG, "apds9306"); enum { // APDS9306 registers APDS9306_MAIN_CTRL = 0x00, diff --git a/esphome/components/apds9960/apds9960.cpp b/esphome/components/apds9960/apds9960.cpp index da8029b4ee..ef5d43e2cb 100644 --- a/esphome/components/apds9960/apds9960.cpp +++ b/esphome/components/apds9960/apds9960.cpp @@ -4,7 +4,7 @@ namespace esphome::apds9960 { -static const char *const TAG = "apds9960"; +ESPHOME_LOG_TAG(TAG, "apds9960"); #define APDS9960_ERROR_CHECK(func) \ if (!(func)) { \ diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 7d56b1ce58..42ef372667 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -88,7 +88,7 @@ static_assert(sizeof(ESPHOME_VERSION) - 1 <= 32, "Update max_data_length for esp static_assert(ESPHOME_DEVICE_NAME_MAX_LEN <= 31, "Update max_data_length for name in api.proto"); static_assert(ESPHOME_FRIENDLY_NAME_MAX_LEN <= 120, "Update max_data_length for friendly_name in api.proto"); -static const char *const TAG = "api.connection"; +ESPHOME_LOG_TAG(TAG, "api.connection"); #if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_WARN void log_dropped_message(const char *tag, int line, const LogString *what) { diff --git a/esphome/components/api/api_frame_helper.cpp b/esphome/components/api/api_frame_helper.cpp index 41d1230aaa..de50eb109f 100644 --- a/esphome/components/api/api_frame_helper.cpp +++ b/esphome/components/api/api_frame_helper.cpp @@ -10,7 +10,7 @@ namespace esphome::api { -static const char *const TAG = "api.frame_helper"; +ESPHOME_LOG_TAG(TAG, "api.frame_helper"); // Maximum bytes to log in hex format (168 * 3 = 504, under TX buffer size of 512) static constexpr size_t API_MAX_LOG_BYTES = 168; diff --git a/esphome/components/api/api_frame_helper_noise.cpp b/esphome/components/api/api_frame_helper_noise.cpp index 21ef085c53..47772fe590 100644 --- a/esphome/components/api/api_frame_helper_noise.cpp +++ b/esphome/components/api/api_frame_helper_noise.cpp @@ -22,7 +22,7 @@ using noise::noise_err_to_logstr; static_assert(MAX_HANDSHAKE_SIZE == noise::MAX_HANDSHAKE_SIZE, "api and noise component handshake size limits must match"); -static const char *const TAG = "api.noise"; +ESPHOME_LOG_TAG(TAG, "api.noise"); static constexpr char PROLOGUE_INIT[] PROGMEM = "NoiseAPIInit"; static constexpr size_t PROLOGUE_INIT_LEN = 12; // strlen("NoiseAPIInit") diff --git a/esphome/components/api/api_frame_helper_plaintext.cpp b/esphome/components/api/api_frame_helper_plaintext.cpp index d4e3354fa0..dc00d8ec1e 100644 --- a/esphome/components/api/api_frame_helper_plaintext.cpp +++ b/esphome/components/api/api_frame_helper_plaintext.cpp @@ -16,7 +16,7 @@ namespace esphome::api { -static const char *const TAG = "api.plaintext"; +ESPHOME_LOG_TAG(TAG, "api.plaintext"); // Maximum bytes to log in hex format (168 * 3 = 504, under TX buffer size of 512) static constexpr size_t API_MAX_LOG_BYTES = 168; diff --git a/esphome/components/api/api_outgoing_connection.cpp b/esphome/components/api/api_outgoing_connection.cpp index c86107cef0..b38976e8cd 100644 --- a/esphome/components/api/api_outgoing_connection.cpp +++ b/esphome/components/api/api_outgoing_connection.cpp @@ -15,7 +15,7 @@ namespace esphome::api { -static const char *const TAG = "api.outgoing"; +ESPHOME_LOG_TAG(TAG, "api.outgoing"); #ifndef API_OUTGOING_CONNECTION_HOST static constexpr uint32_t OUTGOING_TARGET_PREF_HASH = 629847102UL; diff --git a/esphome/components/api/api_pb2_service.cpp b/esphome/components/api/api_pb2_service.cpp index 1ef70f1fd4..fee775daa0 100644 --- a/esphome/components/api/api_pb2_service.cpp +++ b/esphome/components/api/api_pb2_service.cpp @@ -6,7 +6,7 @@ namespace esphome::api { -static const char *const TAG = "api.service"; +ESPHOME_LOG_TAG(TAG, "api.service"); #ifdef HAS_PROTO_MESSAGE_DUMP void APIServerConnectionBase::log_send_message_(const LogString *name, const char *dump) { diff --git a/esphome/components/api/api_server.cpp b/esphome/components/api/api_server.cpp index 33869dd976..7dad4e390e 100644 --- a/esphome/components/api/api_server.cpp +++ b/esphome/components/api/api_server.cpp @@ -23,7 +23,7 @@ namespace esphome::api { -static const char *const TAG = "api"; +ESPHOME_LOG_TAG(TAG, "api"); // APIServer APIServer *global_api_server = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/components/api/api_wizard.cpp b/esphome/components/api/api_wizard.cpp index 986017a138..10a5cbc70c 100644 --- a/esphome/components/api/api_wizard.cpp +++ b/esphome/components/api/api_wizard.cpp @@ -11,7 +11,7 @@ namespace esphome::api { -static const char *const TAG = "api.wizard"; +ESPHOME_LOG_TAG(TAG, "api.wizard"); #ifdef USE_API_WIZARD_INPUTS static bool wizard_entity_id_valid(const char *entity_id, size_t length) { diff --git a/esphome/components/api/proto.cpp b/esphome/components/api/proto.cpp index 6738d5d8b7..e808e8a9ec 100644 --- a/esphome/components/api/proto.cpp +++ b/esphome/components/api/proto.cpp @@ -6,7 +6,7 @@ namespace esphome::api { -static const char *const TAG = "api.proto"; +ESPHOME_LOG_TAG(TAG, "api.proto"); uint32_t ProtoSize::varint_slow(uint32_t value) { return varint_wide(value); } diff --git a/esphome/components/aqi/aqi_sensor.cpp b/esphome/components/aqi/aqi_sensor.cpp index e78f301b30..d7fb120741 100644 --- a/esphome/components/aqi/aqi_sensor.cpp +++ b/esphome/components/aqi/aqi_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::aqi { -static const char *const TAG = "aqi"; +ESPHOME_LOG_TAG(TAG, "aqi"); void AQISensor::setup() { if (this->pm_2_5_sensor_ != nullptr) { diff --git a/esphome/components/as3935/as3935.cpp b/esphome/components/as3935/as3935.cpp index a1d74c78de..00ac7ef365 100644 --- a/esphome/components/as3935/as3935.cpp +++ b/esphome/components/as3935/as3935.cpp @@ -3,7 +3,7 @@ namespace esphome::as3935 { -static const char *const TAG = "as3935"; +ESPHOME_LOG_TAG(TAG, "as3935"); void AS3935Component::setup() { this->irq_pin_->setup(); diff --git a/esphome/components/as3935_i2c/as3935_i2c.cpp b/esphome/components/as3935_i2c/as3935_i2c.cpp index b3d015114f..06f816182e 100644 --- a/esphome/components/as3935_i2c/as3935_i2c.cpp +++ b/esphome/components/as3935_i2c/as3935_i2c.cpp @@ -3,7 +3,7 @@ namespace esphome::as3935_i2c { -static const char *const TAG = "as3935_i2c"; +ESPHOME_LOG_TAG(TAG, "as3935_i2c"); void I2CAS3935Component::write_register(uint8_t reg, uint8_t mask, uint8_t bits, uint8_t start_pos) { uint8_t write_reg; diff --git a/esphome/components/as3935_spi/as3935_spi.cpp b/esphome/components/as3935_spi/as3935_spi.cpp index 026fde2f21..f966126357 100644 --- a/esphome/components/as3935_spi/as3935_spi.cpp +++ b/esphome/components/as3935_spi/as3935_spi.cpp @@ -3,7 +3,7 @@ namespace esphome::as3935_spi { -static const char *const TAG = "as3935_spi"; +ESPHOME_LOG_TAG(TAG, "as3935_spi"); void SPIAS3935Component::setup() { this->spi_setup(); diff --git a/esphome/components/as5600/as5600.cpp b/esphome/components/as5600/as5600.cpp index da1add5458..fc768b383b 100644 --- a/esphome/components/as5600/as5600.cpp +++ b/esphome/components/as5600/as5600.cpp @@ -3,7 +3,7 @@ namespace esphome::as5600 { -static const char *const TAG = "as5600"; +ESPHOME_LOG_TAG(TAG, "as5600"); // Configuration registers static const uint8_t REGISTER_ZMCO = 0x00; // 8 bytes / R diff --git a/esphome/components/as5600/sensor/as5600_sensor.cpp b/esphome/components/as5600/sensor/as5600_sensor.cpp index ba295659a1..88884805a0 100644 --- a/esphome/components/as5600/sensor/as5600_sensor.cpp +++ b/esphome/components/as5600/sensor/as5600_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::as5600 { -static const char *const TAG = "as5600.sensor"; +ESPHOME_LOG_TAG(TAG, "as5600.sensor"); // Configuration registers static const uint8_t REGISTER_ZMCO = 0x00; // 8 bytes / R diff --git a/esphome/components/as7341/as7341.cpp b/esphome/components/as7341/as7341.cpp index 32094ddf10..359636a499 100644 --- a/esphome/components/as7341/as7341.cpp +++ b/esphome/components/as7341/as7341.cpp @@ -4,7 +4,7 @@ namespace esphome::as7341 { -static const char *const TAG = "as7341"; +ESPHOME_LOG_TAG(TAG, "as7341"); void AS7341Component::setup() { LOG_I2C_DEVICE(this); diff --git a/esphome/components/async_tcp/async_tcp_socket.cpp b/esphome/components/async_tcp/async_tcp_socket.cpp index 853ff206c2..03191f6e37 100644 --- a/esphome/components/async_tcp/async_tcp_socket.cpp +++ b/esphome/components/async_tcp/async_tcp_socket.cpp @@ -9,7 +9,7 @@ namespace esphome::async_tcp { -static const char *const TAG = "async_tcp"; +ESPHOME_LOG_TAG(TAG, "async_tcp"); // Read buffer size matches TCP MSS (1500 MTU - 40 bytes IP/TCP headers). // This implementation only runs on ESP-IDF and host which have ample stack. diff --git a/esphome/components/at581x/at581x.cpp b/esphome/components/at581x/at581x.cpp index 575a9afd40..618e4bee5b 100644 --- a/esphome/components/at581x/at581x.cpp +++ b/esphome/components/at581x/at581x.cpp @@ -51,7 +51,7 @@ const uint8_t SELF_CHECK_TIME_ADDR = 0x38; // 2 bytes, up to 0x39 namespace esphome::at581x { -static const char *const TAG = "at581x"; +ESPHOME_LOG_TAG(TAG, "at581x"); bool AT581XComponent::i2c_write_reg(uint8_t addr, uint8_t data) { return this->write_register(addr, &data, 1) == esphome::i2c::NO_ERROR; diff --git a/esphome/components/atc_mithermometer/atc_mithermometer.cpp b/esphome/components/atc_mithermometer/atc_mithermometer.cpp index 22cb2b3150..95b482c840 100644 --- a/esphome/components/atc_mithermometer/atc_mithermometer.cpp +++ b/esphome/components/atc_mithermometer/atc_mithermometer.cpp @@ -3,7 +3,7 @@ namespace esphome::atc_mithermometer { -static const char *const TAG = "atc_mithermometer"; +ESPHOME_LOG_TAG(TAG, "atc_mithermometer"); void ATCMiThermometer::dump_config() { ESP_LOGCONFIG(TAG, "ATC MiThermometer"); diff --git a/esphome/components/atm90e26/atm90e26.cpp b/esphome/components/atm90e26/atm90e26.cpp index 46948be47d..8ec611357c 100644 --- a/esphome/components/atm90e26/atm90e26.cpp +++ b/esphome/components/atm90e26/atm90e26.cpp @@ -4,7 +4,7 @@ namespace esphome::atm90e26 { -static const char *const TAG = "atm90e26"; +ESPHOME_LOG_TAG(TAG, "atm90e26"); void ATM90E26Component::update() { if (this->read16_(ATM90E26_REGISTER_FUNCEN) != 0x0030) { diff --git a/esphome/components/atm90e32/atm90e32.cpp b/esphome/components/atm90e32/atm90e32.cpp index 23701e7834..0c4f095ab5 100644 --- a/esphome/components/atm90e32/atm90e32.cpp +++ b/esphome/components/atm90e32/atm90e32.cpp @@ -7,7 +7,7 @@ namespace esphome::atm90e32 { -static const char *const TAG = "atm90e32"; +ESPHOME_LOG_TAG(TAG, "atm90e32"); static const LogString *offset_calibration_name(bool power_offsets) { return power_offsets ? LOG_STR("Power offset") : LOG_STR("Offset"); diff --git a/esphome/components/atm90e32/button/atm90e32_button.cpp b/esphome/components/atm90e32/button/atm90e32_button.cpp index e120e45364..0387149521 100644 --- a/esphome/components/atm90e32/button/atm90e32_button.cpp +++ b/esphome/components/atm90e32/button/atm90e32_button.cpp @@ -4,7 +4,7 @@ namespace esphome::atm90e32 { -static const char *const TAG = "atm90e32.button"; +ESPHOME_LOG_TAG(TAG, "atm90e32.button"); void ATM90E32GainCalibrationButton::press_action() { if (this->parent_ == nullptr) { diff --git a/esphome/components/audio/audio_decoder.cpp b/esphome/components/audio/audio_decoder.cpp index 051395606c..13dea3f9bc 100644 --- a/esphome/components/audio/audio_decoder.cpp +++ b/esphome/components/audio/audio_decoder.cpp @@ -7,7 +7,7 @@ namespace esphome::audio { -static const char *const TAG = "audio.decoder"; +ESPHOME_LOG_TAG(TAG, "audio.decoder"); static const uint32_t READ_WRITE_TIMEOUT_MS = 20; // Timeout for transferring audio data diff --git a/esphome/components/audio/audio_reader.cpp b/esphome/components/audio/audio_reader.cpp index 9f2960620e..ea3c82e637 100644 --- a/esphome/components/audio/audio_reader.cpp +++ b/esphome/components/audio/audio_reader.cpp @@ -22,7 +22,7 @@ static const size_t HTTP_STREAM_BUFFER_SIZE = 2048; static const uint8_t MAX_REDIRECTIONS = 5; -static const char *const TAG = "audio_reader"; +ESPHOME_LOG_TAG(TAG, "audio_reader"); // Some common HTTP status codes - borrowed from http_request component accessed 20241224 enum HttpStatus { diff --git a/esphome/components/audio_file/media_source/audio_file_media_source.cpp b/esphome/components/audio_file/media_source/audio_file_media_source.cpp index 0cda1eca9e..0aebcc176f 100644 --- a/esphome/components/audio_file/media_source/audio_file_media_source.cpp +++ b/esphome/components/audio_file/media_source/audio_file_media_source.cpp @@ -11,7 +11,7 @@ namespace esphome::audio_file { -static const char *const TAG = "audio_file_media_source"; +ESPHOME_LOG_TAG(TAG, "audio_file_media_source"); static constexpr uint32_t AUDIO_WRITE_TIMEOUT_MS = 50; static constexpr size_t DECODER_TASK_STACK_SIZE = 5120; diff --git a/esphome/components/audio_http/audio_http_media_source.cpp b/esphome/components/audio_http/audio_http_media_source.cpp index 6cea4d7311..ce1f254310 100644 --- a/esphome/components/audio_http/audio_http_media_source.cpp +++ b/esphome/components/audio_http/audio_http_media_source.cpp @@ -11,7 +11,7 @@ namespace esphome::audio_http { -static const char *const TAG = "audio_http_media_source"; +ESPHOME_LOG_TAG(TAG, "audio_http_media_source"); // Decoder task / buffer tuning. Kept here as constants so the header stays free of magic numbers. static constexpr size_t DEFAULT_TRANSFER_BUFFER_SIZE = 8 * 1024; // Staging buffer between HTTP reader and decoder diff --git a/esphome/components/axs15231/touchscreen/axs15231_touchscreen.cpp b/esphome/components/axs15231/touchscreen/axs15231_touchscreen.cpp index 3869224b91..1d6354549c 100644 --- a/esphome/components/axs15231/touchscreen/axs15231_touchscreen.cpp +++ b/esphome/components/axs15231/touchscreen/axs15231_touchscreen.cpp @@ -5,7 +5,7 @@ namespace esphome::axs15231 { -static const char *const TAG = "ax15231.touchscreen"; +ESPHOME_LOG_TAG(TAG, "ax15231.touchscreen"); constexpr static const uint8_t AXS_READ_TOUCHPAD[11] = {0xb5, 0xab, 0xa5, 0x5a, 0x0, 0x0, 0x0, 0x8}; diff --git a/esphome/components/b_parasite/b_parasite.cpp b/esphome/components/b_parasite/b_parasite.cpp index e0ae824b0d..8bed59b3db 100644 --- a/esphome/components/b_parasite/b_parasite.cpp +++ b/esphome/components/b_parasite/b_parasite.cpp @@ -3,7 +3,7 @@ namespace esphome::b_parasite { -static const char *const TAG = "b_parasite"; +ESPHOME_LOG_TAG(TAG, "b_parasite"); void BParasite::dump_config() { ESP_LOGCONFIG(TAG, "b_parasite"); diff --git a/esphome/components/ballu/ballu.cpp b/esphome/components/ballu/ballu.cpp index eebc970795..1553f33618 100644 --- a/esphome/components/ballu/ballu.cpp +++ b/esphome/components/ballu/ballu.cpp @@ -3,7 +3,7 @@ namespace esphome::ballu { -static const char *const TAG = "ballu.climate"; +ESPHOME_LOG_TAG(TAG, "ballu.climate"); const uint16_t BALLU_HEADER_MARK = 9000; const uint16_t BALLU_HEADER_SPACE = 4500; diff --git a/esphome/components/bang_bang/bang_bang_climate.cpp b/esphome/components/bang_bang/bang_bang_climate.cpp index a1104aa1b2..1546df9f10 100644 --- a/esphome/components/bang_bang/bang_bang_climate.cpp +++ b/esphome/components/bang_bang/bang_bang_climate.cpp @@ -3,7 +3,7 @@ namespace esphome::bang_bang { -static const char *const TAG = "bang_bang.climate"; +ESPHOME_LOG_TAG(TAG, "bang_bang.climate"); BangBangClimate::BangBangClimate() = default; diff --git a/esphome/components/beken_spi_led_strip/led_strip.cpp b/esphome/components/beken_spi_led_strip/led_strip.cpp index 0cf970b3cc..dcaae6d8d4 100644 --- a/esphome/components/beken_spi_led_strip/led_strip.cpp +++ b/esphome/components/beken_spi_led_strip/led_strip.cpp @@ -35,7 +35,7 @@ static const uint32_t SPI_RX_FINISH_EN = 1 << 3; namespace esphome::beken_spi_led_strip { -static const char *const TAG = "beken_spi_led_strip"; +ESPHOME_LOG_TAG(TAG, "beken_spi_led_strip"); struct SpiData { SemaphoreHandle_t dma_tx_semaphore; diff --git a/esphome/components/bh1750/bh1750.cpp b/esphome/components/bh1750/bh1750.cpp index ab952895a8..2d9709f422 100644 --- a/esphome/components/bh1750/bh1750.cpp +++ b/esphome/components/bh1750/bh1750.cpp @@ -4,7 +4,7 @@ namespace esphome::bh1750 { -static const char *const TAG = "bh1750.sensor"; +ESPHOME_LOG_TAG(TAG, "bh1750.sensor"); static const uint8_t BH1750_COMMAND_POWER_ON = 0b00000001; static const uint8_t BH1750_COMMAND_MT_REG_HI = 0b01000000; // last 3 bits diff --git a/esphome/components/bh1900nux/bh1900nux.cpp b/esphome/components/bh1900nux/bh1900nux.cpp index 4f746a17d4..6b7f1a3586 100644 --- a/esphome/components/bh1900nux/bh1900nux.cpp +++ b/esphome/components/bh1900nux/bh1900nux.cpp @@ -3,7 +3,7 @@ namespace esphome::bh1900nux { -static const char *const TAG = "bh1900nux.sensor"; +ESPHOME_LOG_TAG(TAG, "bh1900nux.sensor"); // I2C Registers static const uint8_t TEMPERATURE_REG = 0x00; diff --git a/esphome/components/binary/fan/binary_fan.cpp b/esphome/components/binary/fan/binary_fan.cpp index 118d87c09d..4cc0b145a2 100644 --- a/esphome/components/binary/fan/binary_fan.cpp +++ b/esphome/components/binary/fan/binary_fan.cpp @@ -3,7 +3,7 @@ namespace esphome::binary { -static const char *const TAG = "binary.fan"; +ESPHOME_LOG_TAG(TAG, "binary.fan"); void BinaryFan::setup() { auto restore = this->restore_state_(); diff --git a/esphome/components/binary_sensor/automation.cpp b/esphome/components/binary_sensor/automation.cpp index 65c7dbbdb6..d4b4906c30 100644 --- a/esphome/components/binary_sensor/automation.cpp +++ b/esphome/components/binary_sensor/automation.cpp @@ -8,7 +8,7 @@ namespace esphome::binary_sensor { #ifdef USE_BINARY_SENSOR_MULTI_CLICK_TRIGGER -static const char *const TAG = "binary_sensor.automation"; +ESPHOME_LOG_TAG(TAG, "binary_sensor.automation"); // MultiClickTrigger timeout IDs. // MultiClickTrigger is its own Component instance, so the scheduler scopes diff --git a/esphome/components/binary_sensor/binary_sensor.cpp b/esphome/components/binary_sensor/binary_sensor.cpp index 7596975a68..43915c4e17 100644 --- a/esphome/components/binary_sensor/binary_sensor.cpp +++ b/esphome/components/binary_sensor/binary_sensor.cpp @@ -5,7 +5,7 @@ namespace esphome::binary_sensor { -static const char *const TAG = "binary_sensor"; +ESPHOME_LOG_TAG(TAG, "binary_sensor"); // Function implementation of LOG_BINARY_SENSOR macro to reduce code size void log_binary_sensor(const char *tag, const char *prefix, const char *type, BinarySensor *obj) { diff --git a/esphome/components/binary_sensor/filter.cpp b/esphome/components/binary_sensor/filter.cpp index 8b882212c8..32b25f7211 100644 --- a/esphome/components/binary_sensor/filter.cpp +++ b/esphome/components/binary_sensor/filter.cpp @@ -8,7 +8,7 @@ namespace esphome::binary_sensor { -static const char *const TAG = "sensor.filter"; +ESPHOME_LOG_TAG(TAG, "sensor.filter"); void Filter::output(bool value) { if (this->next_ == nullptr) { diff --git a/esphome/components/binary_sensor_map/binary_sensor_map.cpp b/esphome/components/binary_sensor_map/binary_sensor_map.cpp index 3185f15697..4f00a85c8d 100644 --- a/esphome/components/binary_sensor_map/binary_sensor_map.cpp +++ b/esphome/components/binary_sensor_map/binary_sensor_map.cpp @@ -3,7 +3,7 @@ namespace esphome::binary_sensor_map { -static const char *const TAG = "binary_sensor_map"; +ESPHOME_LOG_TAG(TAG, "binary_sensor_map"); void BinarySensorMap::dump_config() { LOG_SENSOR(" ", "binary_sensor_map", this); } diff --git a/esphome/components/bk72xx_ble/bdk_scan.cpp b/esphome/components/bk72xx_ble/bdk_scan.cpp index 3192fc79d7..05b94e17f9 100644 --- a/esphome/components/bk72xx_ble/bdk_scan.cpp +++ b/esphome/components/bk72xx_ble/bdk_scan.cpp @@ -29,7 +29,7 @@ extern "C" { namespace esphome::bk72xx_ble { -static const char *const TAG = "bk72xx_ble"; +ESPHOME_LOG_TAG(TAG, "bk72xx_ble"); // Pin the SDK surface this file depends on: a beken-bdk bump that moves these // must fail the build, not corrupt the kernel message. diff --git a/esphome/components/bk72xx_ble/bk72xx_ble.cpp b/esphome/components/bk72xx_ble/bk72xx_ble.cpp index 7a4efff455..49167c3000 100644 --- a/esphome/components/bk72xx_ble/bk72xx_ble.cpp +++ b/esphome/components/bk72xx_ble/bk72xx_ble.cpp @@ -81,7 +81,7 @@ void ble_entry(void); namespace esphome::bk72xx_ble { -static const char *const TAG = "bk72xx_ble"; +ESPHOME_LOG_TAG(TAG, "bk72xx_ble"); static constexpr uint32_t RECONCILE_RETRY_MS = 10; // pump floor for fast loops static constexpr uint32_t RECONCILE_REJECTED_RETRY_MS = 500; // retry gate after a rejected release diff --git a/esphome/components/bk72xx_ble_tracker/bk72xx_ble_tracker.cpp b/esphome/components/bk72xx_ble_tracker/bk72xx_ble_tracker.cpp index 0939e1259f..7e7f04135e 100644 --- a/esphome/components/bk72xx_ble_tracker/bk72xx_ble_tracker.cpp +++ b/esphome/components/bk72xx_ble_tracker/bk72xx_ble_tracker.cpp @@ -16,7 +16,7 @@ namespace esphome::bk72xx_ble_tracker { -static const char *const TAG = "bk72xx_ble_tracker"; +ESPHOME_LOG_TAG(TAG, "bk72xx_ble_tracker"); // Minimum interval between scan (re)start attempts, so a failing controller start // cannot be retried every main-loop iteration (single-core CPU starvation). The diff --git a/esphome/components/bl0906/bl0906.cpp b/esphome/components/bl0906/bl0906.cpp index 9a27cffd04..38edb6ed91 100644 --- a/esphome/components/bl0906/bl0906.cpp +++ b/esphome/components/bl0906/bl0906.cpp @@ -5,7 +5,7 @@ namespace esphome::bl0906 { -static const char *const TAG = "bl0906"; +ESPHOME_LOG_TAG(TAG, "bl0906"); constexpr uint32_t to_uint32_t(ube24_t input) { return input.h << 16 | input.m << 8 | input.l; } diff --git a/esphome/components/bl0939/bl0939.cpp b/esphome/components/bl0939/bl0939.cpp index 9ae3360e3a..b0b9bb1c17 100644 --- a/esphome/components/bl0939/bl0939.cpp +++ b/esphome/components/bl0939/bl0939.cpp @@ -4,7 +4,7 @@ namespace esphome::bl0939 { -static const char *const TAG = "bl0939"; +ESPHOME_LOG_TAG(TAG, "bl0939"); // https://www.belling.com.cn/media/file_object/bel_product/BL0939/datasheet/BL0939_V1.2_cn.pdf // (unfortunately chinese, but the protocol can be understood with some translation tool) diff --git a/esphome/components/bl0940/bl0940.cpp b/esphome/components/bl0940/bl0940.cpp index 642368d93f..a8b470de7e 100644 --- a/esphome/components/bl0940/bl0940.cpp +++ b/esphome/components/bl0940/bl0940.cpp @@ -4,7 +4,7 @@ namespace esphome::bl0940 { -static const char *const TAG = "bl0940"; +ESPHOME_LOG_TAG(TAG, "bl0940"); static const uint8_t BL0940_FULL_PACKET = 0xAA; static const uint8_t BL0940_PACKET_HEADER = 0x55; // 0x58 according to en doc but 0x55 in cn doc diff --git a/esphome/components/bl0940/button/calibration_reset_button.cpp b/esphome/components/bl0940/button/calibration_reset_button.cpp index a0b41b9a5b..5598818f54 100644 --- a/esphome/components/bl0940/button/calibration_reset_button.cpp +++ b/esphome/components/bl0940/button/calibration_reset_button.cpp @@ -6,7 +6,7 @@ namespace esphome::bl0940 { -static const char *const TAG = "bl0940.button.calibration_reset"; +ESPHOME_LOG_TAG(TAG, "bl0940.button.calibration_reset"); void CalibrationResetButton::dump_config() { LOG_BUTTON("", "Calibration Reset Button", this); } diff --git a/esphome/components/bl0940/number/calibration_number.cpp b/esphome/components/bl0940/number/calibration_number.cpp index 6f054443a2..d382a12e69 100644 --- a/esphome/components/bl0940/number/calibration_number.cpp +++ b/esphome/components/bl0940/number/calibration_number.cpp @@ -3,7 +3,7 @@ namespace esphome::bl0940 { -static const char *const TAG = "bl0940.number"; +ESPHOME_LOG_TAG(TAG, "bl0940.number"); void CalibrationNumber::setup() { float value = 0.0f; diff --git a/esphome/components/bl0942/bl0942.cpp b/esphome/components/bl0942/bl0942.cpp index e952df21be..7d0eff8c9d 100644 --- a/esphome/components/bl0942/bl0942.cpp +++ b/esphome/components/bl0942/bl0942.cpp @@ -6,7 +6,7 @@ namespace esphome::bl0942 { -static const char *const TAG = "bl0942"; +ESPHOME_LOG_TAG(TAG, "bl0942"); static const uint8_t BL0942_READ_COMMAND = 0x58; static const uint8_t BL0942_FULL_PACKET = 0xAA; diff --git a/esphome/components/ble_client/ble_client.cpp b/esphome/components/ble_client/ble_client.cpp index 25001c8f74..eb24cdeeb4 100644 --- a/esphome/components/ble_client/ble_client.cpp +++ b/esphome/components/ble_client/ble_client.cpp @@ -9,7 +9,7 @@ namespace esphome::ble_client { -static const char *const TAG = "ble_client"; +ESPHOME_LOG_TAG(TAG, "ble_client"); void BLEClient::setup() { BLEClientBase::setup(); diff --git a/esphome/components/ble_client/output/ble_binary_output.cpp b/esphome/components/ble_client/output/ble_binary_output.cpp index 5d53c59708..479bfefd59 100644 --- a/esphome/components/ble_client/output/ble_binary_output.cpp +++ b/esphome/components/ble_client/output/ble_binary_output.cpp @@ -5,7 +5,7 @@ #ifdef USE_ESP32 namespace esphome::ble_client { -static const char *const TAG = "ble_binary_output"; +ESPHOME_LOG_TAG(TAG, "ble_binary_output"); void BLEBinaryOutput::dump_config() { ESP_LOGCONFIG(TAG, "BLE Binary Output:"); diff --git a/esphome/components/ble_client/sensor/ble_rssi_sensor.cpp b/esphome/components/ble_client/sensor/ble_rssi_sensor.cpp index 715298e592..69e7450dc2 100644 --- a/esphome/components/ble_client/sensor/ble_rssi_sensor.cpp +++ b/esphome/components/ble_client/sensor/ble_rssi_sensor.cpp @@ -8,7 +8,7 @@ namespace esphome::ble_client { -static const char *const TAG = "ble_rssi_sensor"; +ESPHOME_LOG_TAG(TAG, "ble_rssi_sensor"); void BLEClientRSSISensor::loop() { // Parent BLEClientNode has a loop() method, but this component uses diff --git a/esphome/components/ble_client/sensor/ble_sensor.cpp b/esphome/components/ble_client/sensor/ble_sensor.cpp index 5dbb7e42ed..1ddd50c307 100644 --- a/esphome/components/ble_client/sensor/ble_sensor.cpp +++ b/esphome/components/ble_client/sensor/ble_sensor.cpp @@ -8,7 +8,7 @@ namespace esphome::ble_client { -static const char *const TAG = "ble_sensor"; +ESPHOME_LOG_TAG(TAG, "ble_sensor"); void BLESensor::loop() { // Parent BLEClientNode has a loop() method, but this component uses diff --git a/esphome/components/ble_client/switch/ble_switch.cpp b/esphome/components/ble_client/switch/ble_switch.cpp index 5baca2adcf..1edd42760e 100644 --- a/esphome/components/ble_client/switch/ble_switch.cpp +++ b/esphome/components/ble_client/switch/ble_switch.cpp @@ -6,7 +6,7 @@ namespace esphome::ble_client { -static const char *const TAG = "ble_switch"; +ESPHOME_LOG_TAG(TAG, "ble_switch"); void BLEClientSwitch::write_state(bool state) { this->parent_->set_enabled(state); diff --git a/esphome/components/ble_client/text_sensor/ble_text_sensor.cpp b/esphome/components/ble_client/text_sensor/ble_text_sensor.cpp index ed2b0a63a0..f6df7b4336 100644 --- a/esphome/components/ble_client/text_sensor/ble_text_sensor.cpp +++ b/esphome/components/ble_client/text_sensor/ble_text_sensor.cpp @@ -9,7 +9,7 @@ namespace esphome::ble_client { -static const char *const TAG = "ble_text_sensor"; +ESPHOME_LOG_TAG(TAG, "ble_text_sensor"); void BLETextSensor::loop() { // Parent BLEClientNode has a loop() method, but this component uses diff --git a/esphome/components/ble_device_base/ble_device.cpp b/esphome/components/ble_device_base/ble_device.cpp index 23ca6b1dbd..f7fa488aac 100644 --- a/esphome/components/ble_device_base/ble_device.cpp +++ b/esphome/components/ble_device_base/ble_device.cpp @@ -16,7 +16,7 @@ namespace esphome::ble_device_base { -static const char *const TAG = "ble_device_base"; +ESPHOME_LOG_TAG(TAG, "ble_device_base"); // Longest advertisement payload worth hex-dumping at VERY_VERBOSE // (legacy advertising: 31-byte adv + 31-byte scan response). diff --git a/esphome/components/ble_nus/ble_nus.cpp b/esphome/components/ble_nus/ble_nus.cpp index b566122f8a..64a36c468f 100644 --- a/esphome/components/ble_nus/ble_nus.cpp +++ b/esphome/components/ble_nus/ble_nus.cpp @@ -19,7 +19,7 @@ RING_BUF_DECLARE(global_ble_rx_ring_buf, ESPHOME_BLE_NUS_RX_RING_BUFFER_SIZE); #endif // NOLINTEND(cppcoreguidelines-avoid-non-const-global-variables) -static const char *const TAG = "ble_nus"; +ESPHOME_LOG_TAG(TAG, "ble_nus"); void BLENUS::write_array(const uint8_t *data, size_t len) { if (atomic_get(&this->tx_status_) == TX_DISABLED) { diff --git a/esphome/components/ble_presence/ble_presence_device.cpp b/esphome/components/ble_presence/ble_presence_device.cpp index bc169623ce..91947ccd26 100644 --- a/esphome/components/ble_presence/ble_presence_device.cpp +++ b/esphome/components/ble_presence/ble_presence_device.cpp @@ -3,7 +3,7 @@ namespace esphome::ble_presence { -static const char *const TAG = "ble_presence"; +ESPHOME_LOG_TAG(TAG, "ble_presence"); void BLEPresenceDevice::dump_config() { LOG_BINARY_SENSOR("", "BLE Presence", this); } diff --git a/esphome/components/ble_rssi/ble_rssi_sensor.cpp b/esphome/components/ble_rssi/ble_rssi_sensor.cpp index 7c7c7b2148..eb049313a8 100644 --- a/esphome/components/ble_rssi/ble_rssi_sensor.cpp +++ b/esphome/components/ble_rssi/ble_rssi_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::ble_rssi { -static const char *const TAG = "ble_rssi"; +ESPHOME_LOG_TAG(TAG, "ble_rssi"); void BLERSSISensor::dump_config() { LOG_SENSOR("", "BLE RSSI Sensor", this); } diff --git a/esphome/components/ble_scanner/ble_scanner.cpp b/esphome/components/ble_scanner/ble_scanner.cpp index 3d7a301793..42a691b1d9 100644 --- a/esphome/components/ble_scanner/ble_scanner.cpp +++ b/esphome/components/ble_scanner/ble_scanner.cpp @@ -3,7 +3,7 @@ namespace esphome::ble_scanner { -static const char *const TAG = "ble_scanner"; +ESPHOME_LOG_TAG(TAG, "ble_scanner"); void BLEScanner::dump_config() { LOG_TEXT_SENSOR("", "BLE Scanner", this); } diff --git a/esphome/components/bluetooth_connection/bluetooth_connection.cpp b/esphome/components/bluetooth_connection/bluetooth_connection.cpp index a001729083..a99a39bc9e 100644 --- a/esphome/components/bluetooth_connection/bluetooth_connection.cpp +++ b/esphome/components/bluetooth_connection/bluetooth_connection.cpp @@ -12,7 +12,7 @@ namespace esphome::bluetooth_connection { -static const char *const TAG = "bluetooth_connection"; +ESPHOME_LOG_TAG(TAG, "bluetooth_connection"); BatchClose close_service_batch(api::BluetoothGATTGetServicesResponse &resp, size_t ¤t_size, int16_t &send_service, uint8_t connection_index, const char *address_str) { diff --git a/esphome/components/bluetooth_connection/bluetooth_connection_bluedroid.cpp b/esphome/components/bluetooth_connection/bluetooth_connection_bluedroid.cpp index d3af02780f..7b66c67183 100644 --- a/esphome/components/bluetooth_connection/bluetooth_connection_bluedroid.cpp +++ b/esphome/components/bluetooth_connection/bluetooth_connection_bluedroid.cpp @@ -27,7 +27,7 @@ namespace esphome::bluetooth_connection { -static const char *const TAG = "bluetooth_connection"; +ESPHOME_LOG_TAG(TAG, "bluetooth_connection"); using ble_device_base::FAST_CONN_TIMEOUT; using ble_device_base::FAST_MAX_CONN_INTERVAL; diff --git a/esphome/components/bluetooth_connection/bluetooth_connection_hub.cpp b/esphome/components/bluetooth_connection/bluetooth_connection_hub.cpp index ddab4812cc..5e358175bf 100644 --- a/esphome/components/bluetooth_connection/bluetooth_connection_hub.cpp +++ b/esphome/components/bluetooth_connection/bluetooth_connection_hub.cpp @@ -31,7 +31,7 @@ namespace esphome::bluetooth_connection { -static const char *const TAG = "bluetooth_connection"; +ESPHOME_LOG_TAG(TAG, "bluetooth_connection"); void BluetoothConnection::set_address(uint64_t address) { // Keep the proxy's pre-allocated connections-free message in step diff --git a/esphome/components/bluetooth_connection/bluetooth_connection_rp2.cpp b/esphome/components/bluetooth_connection/bluetooth_connection_rp2.cpp index eec2c8c318..c6e2703c48 100644 --- a/esphome/components/bluetooth_connection/bluetooth_connection_rp2.cpp +++ b/esphome/components/bluetooth_connection/bluetooth_connection_rp2.cpp @@ -15,7 +15,7 @@ namespace esphome::bluetooth_connection { -static const char *const TAG = "bluetooth_connection"; +ESPHOME_LOG_TAG(TAG, "bluetooth_connection"); using ble_device_base::ESPBTUUID; using ble_device_base::GATT_ERR_NOT_CONNECTED; diff --git a/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp b/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp index cb37057cd4..e4b9487074 100644 --- a/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +++ b/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp @@ -14,7 +14,7 @@ namespace esphome::bluetooth_proxy { -static const char *const TAG = "bluetooth_proxy"; +ESPHOME_LOG_TAG(TAG, "bluetooth_proxy"); // BLUETOOTH_PROXY_ADVERTISEMENT_BATCH_SIZE is defined during code generation // It sets the batch size for BLE advertisements to maximize WiFi efficiency diff --git a/esphome/components/bm8563/bm8563.cpp b/esphome/components/bm8563/bm8563.cpp index d911301c9d..df1cf96d69 100644 --- a/esphome/components/bm8563/bm8563.cpp +++ b/esphome/components/bm8563/bm8563.cpp @@ -6,7 +6,7 @@ namespace esphome::bm8563 { -static const char *const TAG = "bm8563"; +ESPHOME_LOG_TAG(TAG, "bm8563"); static constexpr uint8_t CONTROL_STATUS_1_REG = 0x00; static constexpr uint8_t CONTROL_STATUS_2_REG = 0x01; diff --git a/esphome/components/bme280_base/bme280_base.cpp b/esphome/components/bme280_base/bme280_base.cpp index 11c796352a..6cc011d76b 100644 --- a/esphome/components/bme280_base/bme280_base.cpp +++ b/esphome/components/bme280_base/bme280_base.cpp @@ -11,7 +11,7 @@ namespace esphome::bme280_base { -static const char *const TAG = "bme280.sensor"; +ESPHOME_LOG_TAG(TAG, "bme280.sensor"); static const uint8_t BME280_REGISTER_DIG_T1 = 0x88; static const uint8_t BME280_REGISTER_DIG_T2 = 0x8A; diff --git a/esphome/components/bme680/bme680.cpp b/esphome/components/bme680/bme680.cpp index bac8ed8a5a..2ff7ca2b8c 100644 --- a/esphome/components/bme680/bme680.cpp +++ b/esphome/components/bme680/bme680.cpp @@ -4,7 +4,7 @@ namespace esphome::bme680 { -static const char *const TAG = "bme680.sensor"; +ESPHOME_LOG_TAG(TAG, "bme680.sensor"); static const uint8_t BME680_REGISTER_COEFF1 = 0x89; static const uint8_t BME680_REGISTER_COEFF2 = 0xE1; diff --git a/esphome/components/bme680_bsec/bme680_bsec.cpp b/esphome/components/bme680_bsec/bme680_bsec.cpp index 8e16a28e33..219f72d3df 100644 --- a/esphome/components/bme680_bsec/bme680_bsec.cpp +++ b/esphome/components/bme680_bsec/bme680_bsec.cpp @@ -5,7 +5,7 @@ namespace esphome::bme680_bsec { #ifdef USE_BSEC -static const char *const TAG = "bme680_bsec.sensor"; +ESPHOME_LOG_TAG(TAG, "bme680_bsec.sensor"); static const std::string IAQ_ACCURACY_STATES[4] = {"Stabilizing", "Uncertain", "Calibrating", "Calibrated"}; diff --git a/esphome/components/bme68x_bsec2/bme68x_bsec2.cpp b/esphome/components/bme68x_bsec2/bme68x_bsec2.cpp index d4ac57d750..2b113c179f 100644 --- a/esphome/components/bme68x_bsec2/bme68x_bsec2.cpp +++ b/esphome/components/bme68x_bsec2/bme68x_bsec2.cpp @@ -13,7 +13,7 @@ namespace esphome::bme68x_bsec2 { #define BME68X_BSEC2_SAMPLE_RATE_LOG(r) (r == SAMPLE_RATE_DEFAULT ? "Default" : (r == SAMPLE_RATE_ULP ? "ULP" : "LP")) #define BME68X_BSEC2_VOLTAGE_LOG(v) (v == VOLTAGE_3_3V ? "3.3V" : "1.8V") -static const char *const TAG = "bme68x_bsec2.sensor"; +ESPHOME_LOG_TAG(TAG, "bme68x_bsec2.sensor"); static constexpr const char *const IAQ_ACCURACY_STATES[4] = {"Stabilizing", "Uncertain", "Calibrating", "Calibrated"}; diff --git a/esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp b/esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp index 2a2c5e2bcc..8672e4f6ff 100644 --- a/esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp +++ b/esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp @@ -11,7 +11,7 @@ namespace esphome::bme68x_bsec2_i2c { -static const char *const TAG = "bme68x_bsec2_i2c.sensor"; +ESPHOME_LOG_TAG(TAG, "bme68x_bsec2_i2c.sensor"); void BME68xBSEC2I2CComponent::setup() { // must set up our bme68x_dev instance before calling setup() diff --git a/esphome/components/bmi160/bmi160.cpp b/esphome/components/bmi160/bmi160.cpp index 442ee183bf..a90d490ae1 100644 --- a/esphome/components/bmi160/bmi160.cpp +++ b/esphome/components/bmi160/bmi160.cpp @@ -4,7 +4,7 @@ namespace esphome::bmi160 { -static const char *const TAG = "bmi160"; +ESPHOME_LOG_TAG(TAG, "bmi160"); static constexpr uint32_t GYRO_WAKEUP_TIMEOUT_MS = 100; const uint8_t BMI160_REGISTER_CHIPID = 0x00; diff --git a/esphome/components/bmi270/bmi270.cpp b/esphome/components/bmi270/bmi270.cpp index acb93158d4..a1709c1fa5 100644 --- a/esphome/components/bmi270/bmi270.cpp +++ b/esphome/components/bmi270/bmi270.cpp @@ -5,7 +5,7 @@ namespace esphome::bmi270 { -static const char *const TAG = "bmi270"; +ESPHOME_LOG_TAG(TAG, "bmi270"); #if defined(USE_ARDUINO) && !defined(USE_ESP32) static const size_t MAX_I2C_BUFFER_SIZE = 32; diff --git a/esphome/components/bmp085/bmp085.cpp b/esphome/components/bmp085/bmp085.cpp index f42875b208..4badfd95f5 100644 --- a/esphome/components/bmp085/bmp085.cpp +++ b/esphome/components/bmp085/bmp085.cpp @@ -3,7 +3,7 @@ namespace esphome::bmp085 { -static const char *const TAG = "bmp085.sensor"; +ESPHOME_LOG_TAG(TAG, "bmp085.sensor"); static const uint8_t BMP085_ADDRESS = 0x77; static const uint8_t BMP085_REGISTER_AC1_H = 0xAA; diff --git a/esphome/components/bmp280_base/bmp280_base.cpp b/esphome/components/bmp280_base/bmp280_base.cpp index 34e1d67101..88ff098581 100644 --- a/esphome/components/bmp280_base/bmp280_base.cpp +++ b/esphome/components/bmp280_base/bmp280_base.cpp @@ -6,7 +6,7 @@ namespace esphome::bmp280_base { -static const char *const TAG = "bmp280.sensor"; +ESPHOME_LOG_TAG(TAG, "bmp280.sensor"); static const uint8_t BMP280_REGISTER_STATUS = 0xF3; static const uint8_t BMP280_REGISTER_CONTROL = 0xF4; diff --git a/esphome/components/bmp3xx_base/bmp3xx_base.cpp b/esphome/components/bmp3xx_base/bmp3xx_base.cpp index aa5e799db1..ba85a20e3d 100644 --- a/esphome/components/bmp3xx_base/bmp3xx_base.cpp +++ b/esphome/components/bmp3xx_base/bmp3xx_base.cpp @@ -13,7 +13,7 @@ namespace esphome::bmp3xx_base { -static const char *const TAG = "bmp3xx.sensor"; +ESPHOME_LOG_TAG(TAG, "bmp3xx.sensor"); static const LogString *chip_type_to_str(uint8_t chip_type) { switch (chip_type) { diff --git a/esphome/components/bmp3xx_i2c/bmp3xx_i2c.cpp b/esphome/components/bmp3xx_i2c/bmp3xx_i2c.cpp index 704d415993..8d8f3122a9 100644 --- a/esphome/components/bmp3xx_i2c/bmp3xx_i2c.cpp +++ b/esphome/components/bmp3xx_i2c/bmp3xx_i2c.cpp @@ -4,7 +4,7 @@ namespace esphome::bmp3xx_i2c { -static const char *const TAG = "bmp3xx_i2c.sensor"; +ESPHOME_LOG_TAG(TAG, "bmp3xx_i2c.sensor"); bool BMP3XXI2CComponent::read_byte(uint8_t a_register, uint8_t *data) { return I2CDevice::read_byte(a_register, data); diff --git a/esphome/components/bmp3xx_spi/bmp3xx_spi.cpp b/esphome/components/bmp3xx_spi/bmp3xx_spi.cpp index 5657626c2d..741f656c07 100644 --- a/esphome/components/bmp3xx_spi/bmp3xx_spi.cpp +++ b/esphome/components/bmp3xx_spi/bmp3xx_spi.cpp @@ -3,7 +3,7 @@ namespace esphome::bmp3xx_spi { -static const char *const TAG = "bmp3xx_spi.sensor"; +ESPHOME_LOG_TAG(TAG, "bmp3xx_spi.sensor"); uint8_t set_bit(uint8_t num, int position) { int mask = 1 << position; diff --git a/esphome/components/bmp581_base/bmp581_base.cpp b/esphome/components/bmp581_base/bmp581_base.cpp index 7a627eee03..7d4761f516 100644 --- a/esphome/components/bmp581_base/bmp581_base.cpp +++ b/esphome/components/bmp581_base/bmp581_base.cpp @@ -17,7 +17,7 @@ namespace esphome::bmp581_base { -static const char *const TAG = "bmp581"; +ESPHOME_LOG_TAG(TAG, "bmp581"); // Oversampling strings indexed by Oversampling enum (0-7): NONE, X2, X4, X8, X16, X32, X64, X128 PROGMEM_STRING_TABLE(OversamplingStrings, "None", "2x", "4x", "8x", "16x", "32x", "64x", "128x", ""); diff --git a/esphome/components/bmp581_spi/bmp581_spi.cpp b/esphome/components/bmp581_spi/bmp581_spi.cpp index 01435880f0..129128026c 100644 --- a/esphome/components/bmp581_spi/bmp581_spi.cpp +++ b/esphome/components/bmp581_spi/bmp581_spi.cpp @@ -7,7 +7,7 @@ namespace esphome::bmp581_spi { -static const char *const TAG = "bmp581_spi"; +ESPHOME_LOG_TAG(TAG, "bmp581_spi"); // OR (|) register with BMP_SPI_READ for read inline constexpr uint8_t BMP_SPI_READ = 0x80; diff --git a/esphome/components/bp1658cj/bp1658cj.cpp b/esphome/components/bp1658cj/bp1658cj.cpp index 95a6b3be45..c7dc61c6f0 100644 --- a/esphome/components/bp1658cj/bp1658cj.cpp +++ b/esphome/components/bp1658cj/bp1658cj.cpp @@ -3,7 +3,7 @@ namespace esphome::bp1658cj { -static const char *const TAG = "bp1658cj"; +ESPHOME_LOG_TAG(TAG, "bp1658cj"); static const uint8_t BP1658CJ_MODEL_ID = 0x80; static const uint8_t BP1658CJ_ADDR_STANDBY = 0x0; diff --git a/esphome/components/bp5758d/bp5758d.cpp b/esphome/components/bp5758d/bp5758d.cpp index 3cd841b2cd..5789acdcb9 100644 --- a/esphome/components/bp5758d/bp5758d.cpp +++ b/esphome/components/bp5758d/bp5758d.cpp @@ -3,7 +3,7 @@ namespace esphome::bp5758d { -static const char *const TAG = "bp5758d"; +ESPHOME_LOG_TAG(TAG, "bp5758d"); static const uint8_t BP5758D_MODEL_ID = 0b10000000; static const uint8_t BP5758D_ADDR_STANDBY = 0b00000000; diff --git a/esphome/components/bthome_mithermometer/bthome_ble.cpp b/esphome/components/bthome_mithermometer/bthome_ble.cpp index 51f5d866a4..c055c43041 100644 --- a/esphome/components/bthome_mithermometer/bthome_ble.cpp +++ b/esphome/components/bthome_mithermometer/bthome_ble.cpp @@ -26,7 +26,7 @@ namespace esphome::bthome_mithermometer { -static const char *const TAG = "bthome_mithermometer"; +ESPHOME_LOG_TAG(TAG, "bthome_mithermometer"); static constexpr size_t BTHOME_BINDKEY_SIZE = 16; static constexpr size_t BTHOME_NONCE_SIZE = 13; static constexpr size_t BTHOME_MIC_SIZE = 4; diff --git a/esphome/components/button/button.cpp b/esphome/components/button/button.cpp index 2a2a645132..e85ce60df6 100644 --- a/esphome/components/button/button.cpp +++ b/esphome/components/button/button.cpp @@ -3,7 +3,7 @@ namespace esphome::button { -static const char *const TAG = "button"; +ESPHOME_LOG_TAG(TAG, "button"); // Function implementation of LOG_BUTTON macro to reduce code size void log_button(const char *tag, const char *prefix, const char *type, Button *obj) { diff --git a/esphome/components/camera_encoder/esp32_camera_jpeg_encoder.cpp b/esphome/components/camera_encoder/esp32_camera_jpeg_encoder.cpp index 55a3f0b96c..84d5a9117d 100644 --- a/esphome/components/camera_encoder/esp32_camera_jpeg_encoder.cpp +++ b/esphome/components/camera_encoder/esp32_camera_jpeg_encoder.cpp @@ -6,7 +6,7 @@ namespace esphome::camera_encoder { -static const char *const TAG = "camera_encoder"; +ESPHOME_LOG_TAG(TAG, "camera_encoder"); ESP32CameraJPEGEncoder::ESP32CameraJPEGEncoder(uint8_t quality, camera::EncoderBuffer *output) { this->quality_ = quality; diff --git a/esphome/components/canbus/canbus.cpp b/esphome/components/canbus/canbus.cpp index 1032a389c6..828eb77d1c 100644 --- a/esphome/components/canbus/canbus.cpp +++ b/esphome/components/canbus/canbus.cpp @@ -4,7 +4,7 @@ namespace esphome::canbus { -static const char *const TAG = "canbus"; +ESPHOME_LOG_TAG(TAG, "canbus"); void Canbus::setup() { if (!this->setup_internal()) { diff --git a/esphome/components/cap1188/cap1188.cpp b/esphome/components/cap1188/cap1188.cpp index 125a4aba51..d6d97329db 100644 --- a/esphome/components/cap1188/cap1188.cpp +++ b/esphome/components/cap1188/cap1188.cpp @@ -4,7 +4,7 @@ namespace esphome::cap1188 { -static const char *const TAG = "cap1188"; +ESPHOME_LOG_TAG(TAG, "cap1188"); void CAP1188Component::setup() { this->disable_loop(); diff --git a/esphome/components/captive_portal/captive_portal.cpp b/esphome/components/captive_portal/captive_portal.cpp index 599422a46b..36e9ec406d 100644 --- a/esphome/components/captive_portal/captive_portal.cpp +++ b/esphome/components/captive_portal/captive_portal.cpp @@ -13,7 +13,7 @@ namespace esphome::captive_portal { -static const char *const TAG = "captive_portal"; +ESPHOME_LOG_TAG(TAG, "captive_portal"); void CaptivePortal::handle_config(AsyncWebServerRequest *request) { AsyncResponseStream *stream = request->beginResponseStream(ESPHOME_F("application/json")); diff --git a/esphome/components/captive_portal/dns_server_esp32_idf.cpp b/esphome/components/captive_portal/dns_server_esp32_idf.cpp index 56ad9f7176..d7a46373b8 100644 --- a/esphome/components/captive_portal/dns_server_esp32_idf.cpp +++ b/esphome/components/captive_portal/dns_server_esp32_idf.cpp @@ -9,7 +9,7 @@ namespace esphome::captive_portal { -static const char *const TAG = "captive_portal.dns"; +ESPHOME_LOG_TAG(TAG, "captive_portal.dns"); // DNS constants static constexpr uint16_t DNS_PORT = 53; diff --git a/esphome/components/cc1101/cc1101.cpp b/esphome/components/cc1101/cc1101.cpp index 6a4a3a4d53..94d89b899d 100644 --- a/esphome/components/cc1101/cc1101.cpp +++ b/esphome/components/cc1101/cc1101.cpp @@ -11,7 +11,7 @@ namespace esphome::cc1101 { -static const char *const TAG = "cc1101"; +ESPHOME_LOG_TAG(TAG, "cc1101"); static constexpr size_t TX_FIFO_SIZE = 64; static void split_float(float value, int mbits, uint8_t &e, uint32_t &m) { diff --git a/esphome/components/ccs811/ccs811.cpp b/esphome/components/ccs811/ccs811.cpp index afaeac55aa..126ed0049d 100644 --- a/esphome/components/ccs811/ccs811.cpp +++ b/esphome/components/ccs811/ccs811.cpp @@ -5,7 +5,7 @@ namespace esphome::ccs811 { -static const char *const TAG = "ccs811"; +ESPHOME_LOG_TAG(TAG, "ccs811"); // based on // - https://cdn.sparkfun.com/datasheets/BreakoutBoards/CCS811_Programming_Guide.pdf diff --git a/esphome/components/cd74hc4067/cd74hc4067.cpp b/esphome/components/cd74hc4067/cd74hc4067.cpp index c275aca75f..b0a042e868 100644 --- a/esphome/components/cd74hc4067/cd74hc4067.cpp +++ b/esphome/components/cd74hc4067/cd74hc4067.cpp @@ -4,7 +4,7 @@ namespace esphome::cd74hc4067 { -static const char *const TAG = "cd74hc4067"; +ESPHOME_LOG_TAG(TAG, "cd74hc4067"); void CD74HC4067Component::setup() { this->pin_s0_->setup(); diff --git a/esphome/components/cdc_acm_uart/bridge/cdc_acm_uart_bridge.cpp b/esphome/components/cdc_acm_uart/bridge/cdc_acm_uart_bridge.cpp index 042688bfe6..a1bf0a1972 100644 --- a/esphome/components/cdc_acm_uart/bridge/cdc_acm_uart_bridge.cpp +++ b/esphome/components/cdc_acm_uart/bridge/cdc_acm_uart_bridge.cpp @@ -13,7 +13,7 @@ namespace esphome::cdc_acm_uart { -static const char *const TAG = "cdc_acm_uart"; +ESPHOME_LOG_TAG(TAG, "cdc_acm_uart"); static constexpr size_t UART_TASK_STACK_SIZE = 4096; static constexpr size_t RINGBUF_RETRY_CHUNK_SIZE = 64; diff --git a/esphome/components/ch422g/ch422g.cpp b/esphome/components/ch422g/ch422g.cpp index 85603f46f4..28b355a4f1 100644 --- a/esphome/components/ch422g/ch422g.cpp +++ b/esphome/components/ch422g/ch422g.cpp @@ -10,7 +10,7 @@ static const uint8_t CH422G_REG_IN = 0x26; // read reg for input bits static const uint8_t CH422G_REG_OUT = 0x38; // write reg for output bits 0-7 static const uint8_t CH422G_REG_OUT_UPPER = 0x23; // write reg for output bits 8-11 -static const char *const TAG = "ch422g"; +ESPHOME_LOG_TAG(TAG, "ch422g"); void CH422GComponent::setup() { // set outputs before mode diff --git a/esphome/components/ch423/ch423.cpp b/esphome/components/ch423/ch423.cpp index 8424d130b4..b7e9d224fa 100644 --- a/esphome/components/ch423/ch423.cpp +++ b/esphome/components/ch423/ch423.cpp @@ -12,7 +12,7 @@ static constexpr uint8_t CH423_REG_IO_RD = 0x26; // Read IO7-IO0 (0x4D >> 1, ro static constexpr uint8_t CH423_REG_OCL = 0x22; // Write OC7-OC0 (0x44 >> 1) static constexpr uint8_t CH423_REG_OCH = 0x23; // Write OC15-OC8 (0x46 >> 1) -static const char *const TAG = "ch423"; +ESPHOME_LOG_TAG(TAG, "ch423"); void CH423Component::setup() { // set outputs before mode diff --git a/esphome/components/climate/climate.cpp b/esphome/components/climate/climate.cpp index d08952115b..790307cec1 100644 --- a/esphome/components/climate/climate.cpp +++ b/esphome/components/climate/climate.cpp @@ -6,7 +6,7 @@ namespace esphome::climate { -static const char *const TAG = "climate"; +ESPHOME_LOG_TAG(TAG, "climate"); // Memory-efficient lookup tables struct StringToUint8 { diff --git a/esphome/components/climate_ir/climate_ir.cpp b/esphome/components/climate_ir/climate_ir.cpp index 47143e6e60..622aff243c 100644 --- a/esphome/components/climate_ir/climate_ir.cpp +++ b/esphome/components/climate_ir/climate_ir.cpp @@ -3,7 +3,7 @@ namespace esphome::climate_ir { -static const char *const TAG = "climate_ir"; +ESPHOME_LOG_TAG(TAG, "climate_ir"); climate::ClimateTraits ClimateIR::traits() { auto traits = climate::ClimateTraits(); diff --git a/esphome/components/climate_ir_lg/climate_ir_lg.cpp b/esphome/components/climate_ir_lg/climate_ir_lg.cpp index bb612eda7b..042d1dcb21 100644 --- a/esphome/components/climate_ir_lg/climate_ir_lg.cpp +++ b/esphome/components/climate_ir_lg/climate_ir_lg.cpp @@ -3,7 +3,7 @@ namespace esphome::climate_ir_lg { -static const char *const TAG = "climate.climate_ir_lg"; +ESPHOME_LOG_TAG(TAG, "climate.climate_ir_lg"); // All codes provided here are missing the checksum (last 4 bits) // this checksum needs to be calculated before sending (look at `calc_checksum_()`) diff --git a/esphome/components/cm1106/cm1106.cpp b/esphome/components/cm1106/cm1106.cpp index 2e3352b895..a25a753f75 100644 --- a/esphome/components/cm1106/cm1106.cpp +++ b/esphome/components/cm1106/cm1106.cpp @@ -5,7 +5,7 @@ namespace esphome::cm1106 { -static const char *const TAG = "cm1106"; +ESPHOME_LOG_TAG(TAG, "cm1106"); static const uint8_t C_M1106_CMD_GET_CO2[4] = {0x11, 0x01, 0x01, 0xED}; static const uint8_t C_M1106_CMD_SET_CO2_CALIB[6] = {0x11, 0x03, 0x03, 0x00, 0x00, 0x00}; static const uint8_t C_M1106_CMD_SET_CO2_CALIB_RESPONSE[4] = {0x16, 0x01, 0x03, 0xE6}; diff --git a/esphome/components/combination/combination.cpp b/esphome/components/combination/combination.cpp index 8ef0976e3b..d10490a20c 100644 --- a/esphome/components/combination/combination.cpp +++ b/esphome/components/combination/combination.cpp @@ -7,7 +7,7 @@ namespace esphome::combination { -static const char *const TAG = "combination"; +ESPHOME_LOG_TAG(TAG, "combination"); void CombinationComponent::log_config_(const LogString *combo_type) { LOG_SENSOR("", "Combination Sensor:", this); diff --git a/esphome/components/coolix/coolix.cpp b/esphome/components/coolix/coolix.cpp index 56eb43cd82..00a7b8a854 100644 --- a/esphome/components/coolix/coolix.cpp +++ b/esphome/components/coolix/coolix.cpp @@ -4,7 +4,7 @@ namespace esphome::coolix { -static const char *const TAG = "coolix.climate"; +ESPHOME_LOG_TAG(TAG, "coolix.climate"); static const uint32_t COOLIX_OFF = 0xB27BE0; static const uint32_t COOLIX_SWING = 0xB26BE0; diff --git a/esphome/components/copy/binary_sensor/copy_binary_sensor.cpp b/esphome/components/copy/binary_sensor/copy_binary_sensor.cpp index b084b0080a..80093a4a96 100644 --- a/esphome/components/copy/binary_sensor/copy_binary_sensor.cpp +++ b/esphome/components/copy/binary_sensor/copy_binary_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::copy { -static const char *const TAG = "copy.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "copy.binary_sensor"); void CopyBinarySensor::setup() { source_->add_on_state_callback([this](bool value) { this->publish_state(value); }); diff --git a/esphome/components/copy/button/copy_button.cpp b/esphome/components/copy/button/copy_button.cpp index 297e1b0c94..c9441500a9 100644 --- a/esphome/components/copy/button/copy_button.cpp +++ b/esphome/components/copy/button/copy_button.cpp @@ -3,7 +3,7 @@ namespace esphome::copy { -static const char *const TAG = "copy.button"; +ESPHOME_LOG_TAG(TAG, "copy.button"); void CopyButton::dump_config() { LOG_BUTTON("", "Copy Button", this); } diff --git a/esphome/components/copy/cover/copy_cover.cpp b/esphome/components/copy/cover/copy_cover.cpp index 3412784cc7..71bdef667e 100644 --- a/esphome/components/copy/cover/copy_cover.cpp +++ b/esphome/components/copy/cover/copy_cover.cpp @@ -3,7 +3,7 @@ namespace esphome::copy { -static const char *const TAG = "copy.cover"; +ESPHOME_LOG_TAG(TAG, "copy.cover"); void CopyCover::setup() { source_->add_on_state_callback([this]() { diff --git a/esphome/components/copy/fan/copy_fan.cpp b/esphome/components/copy/fan/copy_fan.cpp index 6eed787b05..1e721332be 100644 --- a/esphome/components/copy/fan/copy_fan.cpp +++ b/esphome/components/copy/fan/copy_fan.cpp @@ -3,7 +3,7 @@ namespace esphome::copy { -static const char *const TAG = "copy.fan"; +ESPHOME_LOG_TAG(TAG, "copy.fan"); void CopyFan::setup() { // Copy preset modes once from source fan — stored on Fan base class diff --git a/esphome/components/copy/lock/copy_lock.cpp b/esphome/components/copy/lock/copy_lock.cpp index 5fdb9a757b..d8b0b17f84 100644 --- a/esphome/components/copy/lock/copy_lock.cpp +++ b/esphome/components/copy/lock/copy_lock.cpp @@ -3,7 +3,7 @@ namespace esphome::copy { -static const char *const TAG = "copy.lock"; +ESPHOME_LOG_TAG(TAG, "copy.lock"); void CopyLock::setup() { source_->add_on_state_callback([this](lock::LockState state) { this->publish_state(state); }); diff --git a/esphome/components/copy/number/copy_number.cpp b/esphome/components/copy/number/copy_number.cpp index a10bd209f4..7ddc7da170 100644 --- a/esphome/components/copy/number/copy_number.cpp +++ b/esphome/components/copy/number/copy_number.cpp @@ -3,7 +3,7 @@ namespace esphome::copy { -static const char *const TAG = "copy.number"; +ESPHOME_LOG_TAG(TAG, "copy.number"); void CopyNumber::setup() { source_->add_on_state_callback([this](float value) { this->publish_state(value); }); diff --git a/esphome/components/copy/select/copy_select.cpp b/esphome/components/copy/select/copy_select.cpp index e4f97f3c16..2315514ac5 100644 --- a/esphome/components/copy/select/copy_select.cpp +++ b/esphome/components/copy/select/copy_select.cpp @@ -3,7 +3,7 @@ namespace esphome::copy { -static const char *const TAG = "copy.select"; +ESPHOME_LOG_TAG(TAG, "copy.select"); void CopySelect::setup() { source_->add_on_state_callback([this](size_t index) { this->publish_state(index); }); diff --git a/esphome/components/copy/sensor/copy_sensor.cpp b/esphome/components/copy/sensor/copy_sensor.cpp index 9df23ab92d..17eee92c12 100644 --- a/esphome/components/copy/sensor/copy_sensor.cpp +++ b/esphome/components/copy/sensor/copy_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::copy { -static const char *const TAG = "copy.sensor"; +ESPHOME_LOG_TAG(TAG, "copy.sensor"); void CopySensor::setup() { source_->add_on_state_callback([this](float value) { this->publish_state(value); }); diff --git a/esphome/components/copy/switch/copy_switch.cpp b/esphome/components/copy/switch/copy_switch.cpp index 555f0030a5..51850f898a 100644 --- a/esphome/components/copy/switch/copy_switch.cpp +++ b/esphome/components/copy/switch/copy_switch.cpp @@ -3,7 +3,7 @@ namespace esphome::copy { -static const char *const TAG = "copy.switch"; +ESPHOME_LOG_TAG(TAG, "copy.switch"); void CopySwitch::setup() { source_->add_on_state_callback([this](float value) { this->publish_state(value); }); diff --git a/esphome/components/copy/text/copy_text.cpp b/esphome/components/copy/text/copy_text.cpp index 5ec3ba05b7..fe8e1a010a 100644 --- a/esphome/components/copy/text/copy_text.cpp +++ b/esphome/components/copy/text/copy_text.cpp @@ -3,7 +3,7 @@ namespace esphome::copy { -static const char *const TAG = "copy.text"; +ESPHOME_LOG_TAG(TAG, "copy.text"); void CopyText::setup() { source_->add_on_state_callback([this](const std::string &value) { this->publish_state(value); }); diff --git a/esphome/components/copy/text_sensor/copy_text_sensor.cpp b/esphome/components/copy/text_sensor/copy_text_sensor.cpp index 97182e8a61..96a0aa32b5 100644 --- a/esphome/components/copy/text_sensor/copy_text_sensor.cpp +++ b/esphome/components/copy/text_sensor/copy_text_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::copy { -static const char *const TAG = "copy.text_sensor"; +ESPHOME_LOG_TAG(TAG, "copy.text_sensor"); void CopyTextSensor::setup() { source_->add_on_state_callback([this](const std::string &value) { this->publish_state(value); }); diff --git a/esphome/components/counter/counter_sensor.cpp b/esphome/components/counter/counter_sensor.cpp index 22adb49cca..c2f6688b2d 100644 --- a/esphome/components/counter/counter_sensor.cpp +++ b/esphome/components/counter/counter_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::counter { -static const char *const TAG = "counter"; +ESPHOME_LOG_TAG(TAG, "counter"); void CounterSensor::setup() { if (this->restore_) { diff --git a/esphome/components/cover/cover.cpp b/esphome/components/cover/cover.cpp index dc2db3bf32..30e7f70b02 100644 --- a/esphome/components/cover/cover.cpp +++ b/esphome/components/cover/cover.cpp @@ -8,7 +8,7 @@ namespace esphome::cover { -static const char *const TAG = "cover"; +ESPHOME_LOG_TAG(TAG, "cover"); const LogString *cover_command_to_str(float pos) { if (pos == COVER_OPEN) { diff --git a/esphome/components/cs5460a/cs5460a.cpp b/esphome/components/cs5460a/cs5460a.cpp index 1f9233841a..6ef4588b17 100644 --- a/esphome/components/cs5460a/cs5460a.cpp +++ b/esphome/components/cs5460a/cs5460a.cpp @@ -3,7 +3,7 @@ namespace esphome::cs5460a { -static const char *const TAG = "cs5460a"; +ESPHOME_LOG_TAG(TAG, "cs5460a"); void CS5460AComponent::write_register_(enum CS5460ARegister addr, uint32_t value) { this->write_byte(CMD_WRITE | (addr << 1)); diff --git a/esphome/components/cse7761/cse7761.cpp b/esphome/components/cse7761/cse7761.cpp index 103bc84452..695b7f33d6 100644 --- a/esphome/components/cse7761/cse7761.cpp +++ b/esphome/components/cse7761/cse7761.cpp @@ -4,7 +4,7 @@ namespace esphome::cse7761 { -static const char *const TAG = "cse7761"; +ESPHOME_LOG_TAG(TAG, "cse7761"); /*********************************************************************************************\ * CSE7761 - Energy (Sonoff Dual R3 Pow v1.x) diff --git a/esphome/components/cse7766/cse7766.cpp b/esphome/components/cse7766/cse7766.cpp index 30f1b7a867..9276901156 100644 --- a/esphome/components/cse7766/cse7766.cpp +++ b/esphome/components/cse7766/cse7766.cpp @@ -6,7 +6,7 @@ namespace esphome::cse7766 { -static const char *const TAG = "cse7766"; +ESPHOME_LOG_TAG(TAG, "cse7766"); void CSE7766Component::loop() { const uint32_t now = App.get_loop_component_start_time(); diff --git a/esphome/components/cst226/binary_sensor/cstt6_button.cpp b/esphome/components/cst226/binary_sensor/cstt6_button.cpp index c14da2b176..a755c3d09c 100644 --- a/esphome/components/cst226/binary_sensor/cstt6_button.cpp +++ b/esphome/components/cst226/binary_sensor/cstt6_button.cpp @@ -3,7 +3,7 @@ namespace esphome::cst226 { -static const char *const TAG = "CST226.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "CST226.binary_sensor"); void CST226Button::setup() { this->parent_->register_button_listener(this); diff --git a/esphome/components/cst226/touchscreen/cst226_touchscreen.cpp b/esphome/components/cst226/touchscreen/cst226_touchscreen.cpp index 49d61cbfbc..849cff4a49 100644 --- a/esphome/components/cst226/touchscreen/cst226_touchscreen.cpp +++ b/esphome/components/cst226/touchscreen/cst226_touchscreen.cpp @@ -2,7 +2,7 @@ namespace esphome::cst226 { -static const char *const TAG = "cst226.touchscreen"; +ESPHOME_LOG_TAG(TAG, "cst226.touchscreen"); void CST226Touchscreen::setup() { if (this->reset_pin_ != nullptr) { diff --git a/esphome/components/cst328/binary_sensor/cst328_button.cpp b/esphome/components/cst328/binary_sensor/cst328_button.cpp index b58f4b4b9f..2010f09751 100644 --- a/esphome/components/cst328/binary_sensor/cst328_button.cpp +++ b/esphome/components/cst328/binary_sensor/cst328_button.cpp @@ -2,7 +2,7 @@ #include "esphome/core/log.h" namespace esphome::cst328 { -static const char *const TAG = "cst328.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "cst328.binary_sensor"); void CST328Button::setup() { this->parent_->register_button_listener(this); diff --git a/esphome/components/cst328/touchscreen/cst328_touchscreen.cpp b/esphome/components/cst328/touchscreen/cst328_touchscreen.cpp index 5e1a2ebf72..946eab1b17 100644 --- a/esphome/components/cst328/touchscreen/cst328_touchscreen.cpp +++ b/esphome/components/cst328/touchscreen/cst328_touchscreen.cpp @@ -3,7 +3,7 @@ namespace esphome::cst328 { -static const char *const TAG = "cst328.touchscreen"; +ESPHOME_LOG_TAG(TAG, "cst328.touchscreen"); static const uint32_t CST328_BEFORE_RESET_TIMEOUT = 50; // 50 ms from datasheet static const uint32_t CST328_TRANSITION_TIMEOUT = 300; // 200 ms from datasheet, but typically much less diff --git a/esphome/components/ct_clamp/ct_clamp_sensor.cpp b/esphome/components/ct_clamp/ct_clamp_sensor.cpp index 613c3428be..d9e4b2b8fa 100644 --- a/esphome/components/ct_clamp/ct_clamp_sensor.cpp +++ b/esphome/components/ct_clamp/ct_clamp_sensor.cpp @@ -6,7 +6,7 @@ namespace esphome::ct_clamp { -static const char *const TAG = "ct_clamp"; +ESPHOME_LOG_TAG(TAG, "ct_clamp"); void CTClampSensor::dump_config() { LOG_SENSOR("", "CT Clamp Sensor", this); diff --git a/esphome/components/current_based/current_based_cover.cpp b/esphome/components/current_based/current_based_cover.cpp index d15b310a37..6311fd3cf3 100644 --- a/esphome/components/current_based/current_based_cover.cpp +++ b/esphome/components/current_based/current_based_cover.cpp @@ -6,7 +6,7 @@ namespace esphome::current_based { -static const char *const TAG = "current_based.cover"; +ESPHOME_LOG_TAG(TAG, "current_based.cover"); using namespace esphome::cover; diff --git a/esphome/components/d01/d01.cpp b/esphome/components/d01/d01.cpp index f7a0c08ec4..e15a5959cb 100644 --- a/esphome/components/d01/d01.cpp +++ b/esphome/components/d01/d01.cpp @@ -17,7 +17,7 @@ namespace esphome::d01 { -static const char *const TAG = "d01"; +ESPHOME_LOG_TAG(TAG, "d01"); static const uint8_t D01_FRAME_HEADER = 0xA5; diff --git a/esphome/components/dac7678/dac7678_output.cpp b/esphome/components/dac7678/dac7678_output.cpp index 15575583d9..d1a076733a 100644 --- a/esphome/components/dac7678/dac7678_output.cpp +++ b/esphome/components/dac7678/dac7678_output.cpp @@ -5,7 +5,7 @@ namespace esphome::dac7678 { -static const char *const TAG = "dac7678"; +ESPHOME_LOG_TAG(TAG, "dac7678"); static const uint8_t DAC7678_REG_INPUT_N = 0x00; static const uint8_t DAC7678_REG_SELECT_UPDATE_N = 0x10; diff --git a/esphome/components/daikin/daikin.cpp b/esphome/components/daikin/daikin.cpp index d45586ba2d..7a1310b9ac 100644 --- a/esphome/components/daikin/daikin.cpp +++ b/esphome/components/daikin/daikin.cpp @@ -3,7 +3,7 @@ namespace esphome::daikin { -static const char *const TAG = "daikin.climate"; +ESPHOME_LOG_TAG(TAG, "daikin.climate"); void DaikinClimate::transmit_state() { uint8_t remote_state[35] = {0x11, 0xDA, 0x27, 0x00, 0xC5, 0x00, 0x00, 0xD7, 0x11, 0xDA, 0x27, 0x00, diff --git a/esphome/components/daikin_arc/daikin_arc.cpp b/esphome/components/daikin_arc/daikin_arc.cpp index e31f72dfb9..e79135b185 100644 --- a/esphome/components/daikin_arc/daikin_arc.cpp +++ b/esphome/components/daikin_arc/daikin_arc.cpp @@ -7,7 +7,7 @@ namespace esphome::daikin_arc { -static const char *const TAG = "daikin.climate"; +ESPHOME_LOG_TAG(TAG, "daikin.climate"); void DaikinArcClimate::setup() { climate_ir::ClimateIR::setup(); diff --git a/esphome/components/daikin_brc/daikin_brc.cpp b/esphome/components/daikin_brc/daikin_brc.cpp index 1b085013f1..5d8ef52dc0 100644 --- a/esphome/components/daikin_brc/daikin_brc.cpp +++ b/esphome/components/daikin_brc/daikin_brc.cpp @@ -3,7 +3,7 @@ namespace esphome::daikin_brc { -static const char *const TAG = "daikin_brc.climate"; +ESPHOME_LOG_TAG(TAG, "daikin_brc.climate"); void DaikinBrcClimate::control(const climate::ClimateCall &call) { this->mode_button_ = 0x00; diff --git a/esphome/components/dallas_temp/dallas_temp.cpp b/esphome/components/dallas_temp/dallas_temp.cpp index c418362ced..2721383ae8 100644 --- a/esphome/components/dallas_temp/dallas_temp.cpp +++ b/esphome/components/dallas_temp/dallas_temp.cpp @@ -3,7 +3,7 @@ namespace esphome::dallas_temp { -static const char *const TAG = "dallas.temp.sensor"; +ESPHOME_LOG_TAG(TAG, "dallas.temp.sensor"); static const uint8_t DALLAS_MODEL_DS18S20 = 0x10; static const uint8_t DALLAS_MODEL_DS18B20 = 0x28; diff --git a/esphome/components/daly_bms/daly_bms.cpp b/esphome/components/daly_bms/daly_bms.cpp index 45d4db4972..a486037266 100644 --- a/esphome/components/daly_bms/daly_bms.cpp +++ b/esphome/components/daly_bms/daly_bms.cpp @@ -6,7 +6,7 @@ namespace esphome::daly_bms { -static const char *const TAG = "daly_bms"; +ESPHOME_LOG_TAG(TAG, "daly_bms"); static const uint8_t DALY_FRAME_SIZE = 13; static const uint8_t DALY_TEMPERATURE_OFFSET = 40; diff --git a/esphome/components/datetime/date_entity.cpp b/esphome/components/datetime/date_entity.cpp index b99b89259f..795d54afd9 100644 --- a/esphome/components/datetime/date_entity.cpp +++ b/esphome/components/datetime/date_entity.cpp @@ -7,7 +7,7 @@ namespace esphome::datetime { -static const char *const TAG = "datetime.date_entity"; +ESPHOME_LOG_TAG(TAG, "datetime.date_entity"); void DateEntity::publish_state() { if (this->year_ == 0 || this->month_ == 0 || this->day_ == 0) { diff --git a/esphome/components/datetime/datetime_entity.cpp b/esphome/components/datetime/datetime_entity.cpp index 8f180fd081..6aa1416343 100644 --- a/esphome/components/datetime/datetime_entity.cpp +++ b/esphome/components/datetime/datetime_entity.cpp @@ -7,7 +7,7 @@ namespace esphome::datetime { -static const char *const TAG = "datetime.datetime_entity"; +ESPHOME_LOG_TAG(TAG, "datetime.datetime_entity"); void DateTimeEntity::publish_state() { if (this->year_ == 0 || this->month_ == 0 || this->day_ == 0) { diff --git a/esphome/components/datetime/time_entity.cpp b/esphome/components/datetime/time_entity.cpp index da4c9eb31e..ea1a97256c 100644 --- a/esphome/components/datetime/time_entity.cpp +++ b/esphome/components/datetime/time_entity.cpp @@ -7,7 +7,7 @@ namespace esphome::datetime { -static const char *const TAG = "datetime.time_entity"; +ESPHOME_LOG_TAG(TAG, "datetime.time_entity"); void TimeEntity::publish_state() { if (this->hour_ > 23) { diff --git a/esphome/components/debug/debug_component.cpp b/esphome/components/debug/debug_component.cpp index 97f4522c62..9c7622d116 100644 --- a/esphome/components/debug/debug_component.cpp +++ b/esphome/components/debug/debug_component.cpp @@ -11,7 +11,7 @@ namespace esphome::debug { -static const char *const TAG = "debug"; +ESPHOME_LOG_TAG(TAG, "debug"); void DebugComponent::dump_config() { ESP_LOGCONFIG(TAG, "Debug component:"); diff --git a/esphome/components/debug/debug_esp32.cpp b/esphome/components/debug/debug_esp32.cpp index 8e1a67224e..1ffc0a2eb6 100644 --- a/esphome/components/debug/debug_esp32.cpp +++ b/esphome/components/debug/debug_esp32.cpp @@ -19,7 +19,7 @@ namespace esphome::debug { -static const char *const TAG = "debug"; +ESPHOME_LOG_TAG(TAG, "debug"); // index by values returned by esp_reset_reason diff --git a/esphome/components/debug/debug_esp8266.cpp b/esphome/components/debug/debug_esp8266.cpp index acce28818c..5b62eb6190 100644 --- a/esphome/components/debug/debug_esp8266.cpp +++ b/esphome/components/debug/debug_esp8266.cpp @@ -17,7 +17,7 @@ extern const char *core_release; namespace esphome::debug { -static const char *const TAG = "debug"; +ESPHOME_LOG_TAG(TAG, "debug"); // PROGMEM string table for reset reasons, indexed by reason code (0-6), with "Unknown" as fallback // clang-format off diff --git a/esphome/components/debug/debug_libretiny.cpp b/esphome/components/debug/debug_libretiny.cpp index 55b29310a1..a1166758e2 100644 --- a/esphome/components/debug/debug_libretiny.cpp +++ b/esphome/components/debug/debug_libretiny.cpp @@ -4,7 +4,7 @@ namespace esphome::debug { -static const char *const TAG = "debug"; +ESPHOME_LOG_TAG(TAG, "debug"); const char *DebugComponent::get_reset_reason_(std::span buffer) { // Return the static string directly diff --git a/esphome/components/debug/debug_rp2.cpp b/esphome/components/debug/debug_rp2.cpp index 4ace4be0a3..7cedac287c 100644 --- a/esphome/components/debug/debug_rp2.cpp +++ b/esphome/components/debug/debug_rp2.cpp @@ -15,7 +15,7 @@ #endif namespace esphome::debug { -static const char *const TAG = "debug"; +ESPHOME_LOG_TAG(TAG, "debug"); const char *DebugComponent::get_reset_reason_(std::span buffer) { char *buf = buffer.data(); diff --git a/esphome/components/debug/debug_zephyr.cpp b/esphome/components/debug/debug_zephyr.cpp index e23a0f668a..f020c8cd77 100644 --- a/esphome/components/debug/debug_zephyr.cpp +++ b/esphome/components/debug/debug_zephyr.cpp @@ -12,7 +12,7 @@ namespace esphome::debug { -static const char *const TAG = "debug"; +ESPHOME_LOG_TAG(TAG, "debug"); constexpr std::uintptr_t MBR_PARAM_PAGE_ADDR = 0xFFC; constexpr std::uintptr_t MBR_BOOTLOADER_ADDR = 0xFF8; diff --git a/esphome/components/deep_sleep/deep_sleep_bk72xx.cpp b/esphome/components/deep_sleep/deep_sleep_bk72xx.cpp index a955095875..47ebd3641e 100644 --- a/esphome/components/deep_sleep/deep_sleep_bk72xx.cpp +++ b/esphome/components/deep_sleep/deep_sleep_bk72xx.cpp @@ -5,7 +5,7 @@ namespace esphome::deep_sleep { -static const char *const TAG = "deep_sleep"; +ESPHOME_LOG_TAG(TAG, "deep_sleep"); #ifdef USE_DEEP_SLEEP_ON_WAKE WakeupCause get_wakeup_cause() { diff --git a/esphome/components/deep_sleep/deep_sleep_component.cpp b/esphome/components/deep_sleep/deep_sleep_component.cpp index d33102bf4f..f363a0f0ac 100644 --- a/esphome/components/deep_sleep/deep_sleep_component.cpp +++ b/esphome/components/deep_sleep/deep_sleep_component.cpp @@ -4,7 +4,7 @@ namespace esphome::deep_sleep { -static const char *const TAG = "deep_sleep"; +ESPHOME_LOG_TAG(TAG, "deep_sleep"); // 5 seconds for deep sleep to ensure clean disconnect from Home Assistant static const uint32_t TEARDOWN_TIMEOUT_DEEP_SLEEP_MS = 5000; diff --git a/esphome/components/deep_sleep/deep_sleep_esp32.cpp b/esphome/components/deep_sleep/deep_sleep_esp32.cpp index 20297028b2..eef392ad5c 100644 --- a/esphome/components/deep_sleep/deep_sleep_esp32.cpp +++ b/esphome/components/deep_sleep/deep_sleep_esp32.cpp @@ -28,7 +28,7 @@ namespace esphome::deep_sleep { // - Touch: Touch pad wakeup (esp_sleep_enable_touchpad_wakeup) // - GPIO wakeup: GPIO wakeup for RTC pins -static const char *const TAG = "deep_sleep"; +ESPHOME_LOG_TAG(TAG, "deep_sleep"); #ifdef USE_DEEP_SLEEP_ON_WAKE WakeupCause get_wakeup_cause() { diff --git a/esphome/components/deep_sleep/deep_sleep_esp8266.cpp b/esphome/components/deep_sleep/deep_sleep_esp8266.cpp index 2b98f4b855..408d5a6fe6 100644 --- a/esphome/components/deep_sleep/deep_sleep_esp8266.cpp +++ b/esphome/components/deep_sleep/deep_sleep_esp8266.cpp @@ -11,7 +11,7 @@ extern "C" { namespace esphome::deep_sleep { -static const char *const TAG = "deep_sleep"; +ESPHOME_LOG_TAG(TAG, "deep_sleep"); #ifdef USE_DEEP_SLEEP_ON_WAKE WakeupCause get_wakeup_cause() { diff --git a/esphome/components/deep_sleep/deep_sleep_zephyr.cpp b/esphome/components/deep_sleep/deep_sleep_zephyr.cpp index cadf7bf42d..aff5c0e9c7 100644 --- a/esphome/components/deep_sleep/deep_sleep_zephyr.cpp +++ b/esphome/components/deep_sleep/deep_sleep_zephyr.cpp @@ -8,7 +8,7 @@ namespace esphome::deep_sleep { -static const char *const TAG = "deep_sleep"; +ESPHOME_LOG_TAG(TAG, "deep_sleep"); // The Zephyr watchdog has a short window (2s, or 10s with Zigbee) and // WDT_OPT_PAUSE_IN_SLEEP only pauses it during true hardware sleep — not while a diff --git a/esphome/components/delonghi/delonghi.cpp b/esphome/components/delonghi/delonghi.cpp index fab2d68347..eec4d7f55b 100644 --- a/esphome/components/delonghi/delonghi.cpp +++ b/esphome/components/delonghi/delonghi.cpp @@ -3,7 +3,7 @@ namespace esphome::delonghi { -static const char *const TAG = "delonghi.climate"; +ESPHOME_LOG_TAG(TAG, "delonghi.climate"); void DelonghiClimate::transmit_state() { uint8_t remote_state[DELONGHI_STATE_FRAME_SIZE] = {0}; diff --git a/esphome/components/dew_point/dew_point.cpp b/esphome/components/dew_point/dew_point.cpp index 04ac305e3d..7012bcbb75 100644 --- a/esphome/components/dew_point/dew_point.cpp +++ b/esphome/components/dew_point/dew_point.cpp @@ -3,7 +3,7 @@ namespace esphome::dew_point { -static const char *const TAG = "dew_point.sensor"; +ESPHOME_LOG_TAG(TAG, "dew_point.sensor"); void DewPointComponent::setup() { // Register callbacks for sensor updates diff --git a/esphome/components/dfplayer/dfplayer.cpp b/esphome/components/dfplayer/dfplayer.cpp index 1195f595c8..c45e895b38 100644 --- a/esphome/components/dfplayer/dfplayer.cpp +++ b/esphome/components/dfplayer/dfplayer.cpp @@ -4,7 +4,7 @@ namespace esphome::dfplayer { -static const char *const TAG = "dfplayer"; +ESPHOME_LOG_TAG(TAG, "dfplayer"); void DFPlayer::next() { this->ack_set_is_playing_ = true; diff --git a/esphome/components/dfrobot_sen0395/commands.cpp b/esphome/components/dfrobot_sen0395/commands.cpp index 570bfef943..f5aee54943 100644 --- a/esphome/components/dfrobot_sen0395/commands.cpp +++ b/esphome/components/dfrobot_sen0395/commands.cpp @@ -8,7 +8,7 @@ namespace esphome::dfrobot_sen0395 { -static const char *const TAG = "dfrobot_sen0395.commands"; +ESPHOME_LOG_TAG(TAG, "dfrobot_sen0395.commands"); uint8_t Command::execute(DfrobotSen0395Component *parent) { this->parent_ = parent; diff --git a/esphome/components/dfrobot_sen0395/dfrobot_sen0395.cpp b/esphome/components/dfrobot_sen0395/dfrobot_sen0395.cpp index 42cfd5dff6..9c092982e5 100644 --- a/esphome/components/dfrobot_sen0395/dfrobot_sen0395.cpp +++ b/esphome/components/dfrobot_sen0395/dfrobot_sen0395.cpp @@ -5,7 +5,7 @@ namespace esphome::dfrobot_sen0395 { -static const char *const TAG = "dfrobot_sen0395"; +ESPHOME_LOG_TAG(TAG, "dfrobot_sen0395"); const char ASCII_CR = 0x0D; const char ASCII_LF = 0x0A; diff --git a/esphome/components/dht/dht.cpp b/esphome/components/dht/dht.cpp index 2196f3a982..12b8b0feba 100644 --- a/esphome/components/dht/dht.cpp +++ b/esphome/components/dht/dht.cpp @@ -4,7 +4,7 @@ namespace esphome::dht { -static const char *const TAG = "dht"; +ESPHOME_LOG_TAG(TAG, "dht"); void DHT::setup() { this->t_pin_->digital_write(true); diff --git a/esphome/components/dht12/dht12.cpp b/esphome/components/dht12/dht12.cpp index 78f9140929..e099b65d5b 100644 --- a/esphome/components/dht12/dht12.cpp +++ b/esphome/components/dht12/dht12.cpp @@ -7,7 +7,7 @@ namespace esphome::dht12 { -static const char *const TAG = "dht12"; +ESPHOME_LOG_TAG(TAG, "dht12"); void DHT12Component::update() { uint8_t data[5]; diff --git a/esphome/components/display/display.cpp b/esphome/components/display/display.cpp index 66fadf12ec..49cd2fc7c6 100644 --- a/esphome/components/display/display.cpp +++ b/esphome/components/display/display.cpp @@ -8,7 +8,7 @@ #include "esphome/core/log.h" namespace esphome::display { -static const char *const TAG = "display"; +ESPHOME_LOG_TAG(TAG, "display"); // COLOR_OFF and COLOR_ON are now inline constexpr in display.h diff --git a/esphome/components/display/display_buffer.cpp b/esphome/components/display/display_buffer.cpp index d564ea67bd..4558092702 100644 --- a/esphome/components/display/display_buffer.cpp +++ b/esphome/components/display/display_buffer.cpp @@ -6,7 +6,7 @@ namespace esphome::display { -static const char *const TAG = "display"; +ESPHOME_LOG_TAG(TAG, "display"); void DisplayBuffer::init_internal_(uint32_t buffer_length) { RAMAllocator allocator; diff --git a/esphome/components/display/rect.cpp b/esphome/components/display/rect.cpp index 3ecf6d1cf1..8eb9288a5a 100644 --- a/esphome/components/display/rect.cpp +++ b/esphome/components/display/rect.cpp @@ -4,7 +4,7 @@ namespace esphome::display { -static const char *const TAG = "display"; +ESPHOME_LOG_TAG(TAG, "display"); void Rect::expand(int16_t horizontal, int16_t vertical) { if (this->is_set() && (this->w >= (-2 * horizontal)) && (this->h >= (-2 * vertical))) { diff --git a/esphome/components/dlms_meter/dlms_meter.cpp b/esphome/components/dlms_meter/dlms_meter.cpp index e672fb200f..c34f712660 100644 --- a/esphome/components/dlms_meter/dlms_meter.cpp +++ b/esphome/components/dlms_meter/dlms_meter.cpp @@ -5,7 +5,7 @@ namespace esphome::dlms_meter { -static const char *const TAG = "dlms_meter"; +ESPHOME_LOG_TAG(TAG, "dlms_meter"); static void log_callback(dlms_parser::LogLevel level, const char *fmt, va_list args) { std::array buf; vsnprintf(buf.data(), buf.size(), fmt, args); diff --git a/esphome/components/dps310/dps310.cpp b/esphome/components/dps310/dps310.cpp index 3b4693139d..abb34d6598 100644 --- a/esphome/components/dps310/dps310.cpp +++ b/esphome/components/dps310/dps310.cpp @@ -4,7 +4,7 @@ namespace esphome::dps310 { -static const char *const TAG = "dps310"; +ESPHOME_LOG_TAG(TAG, "dps310"); void DPS310Component::setup() { uint8_t coef_data_raw[DPS310_NUM_COEF_REGS]; diff --git a/esphome/components/ds1307/ds1307.cpp b/esphome/components/ds1307/ds1307.cpp index 1d04b52168..4ddef04f41 100644 --- a/esphome/components/ds1307/ds1307.cpp +++ b/esphome/components/ds1307/ds1307.cpp @@ -6,7 +6,7 @@ namespace esphome::ds1307 { -static const char *const TAG = "ds1307"; +ESPHOME_LOG_TAG(TAG, "ds1307"); void DS1307Component::setup() { if (!this->read_rtc_()) { diff --git a/esphome/components/ds1603l/ds1603l.cpp b/esphome/components/ds1603l/ds1603l.cpp index b0b0ef8175..7762a593f1 100644 --- a/esphome/components/ds1603l/ds1603l.cpp +++ b/esphome/components/ds1603l/ds1603l.cpp @@ -7,7 +7,7 @@ namespace esphome::ds1603l { -static const char *const TAG = "ds1603l.sensor"; +ESPHOME_LOG_TAG(TAG, "ds1603l.sensor"); void DS1603L::loop() { // Assemble frames one byte at a time so a stream that starts mid-frame can realign diff --git a/esphome/components/ds2484/ds2484.cpp b/esphome/components/ds2484/ds2484.cpp index 69103ccbd2..5519848196 100644 --- a/esphome/components/ds2484/ds2484.cpp +++ b/esphome/components/ds2484/ds2484.cpp @@ -1,7 +1,7 @@ #include "ds2484.h" namespace esphome::ds2484 { -static const char *const TAG = "ds2484.onewire"; +ESPHOME_LOG_TAG(TAG, "ds2484.onewire"); void DS2484OneWireBus::setup() { this->reset_device(); diff --git a/esphome/components/ds248x/ds248x.cpp b/esphome/components/ds248x/ds248x.cpp index c8f7395119..db104b3d15 100644 --- a/esphome/components/ds248x/ds248x.cpp +++ b/esphome/components/ds248x/ds248x.cpp @@ -4,7 +4,7 @@ namespace esphome::ds248x { -static const char *const TAG = "ds248x"; +ESPHOME_LOG_TAG(TAG, "ds248x"); void DS248xComponent::setup() { ESP_LOGCONFIG(TAG, "Setting up DS248x..."); diff --git a/esphome/components/ds248x/ds248x_one_wire_bus.cpp b/esphome/components/ds248x/ds248x_one_wire_bus.cpp index ed5b05bab7..201261d4bf 100644 --- a/esphome/components/ds248x/ds248x_one_wire_bus.cpp +++ b/esphome/components/ds248x/ds248x_one_wire_bus.cpp @@ -4,7 +4,7 @@ namespace esphome::ds248x { -static const char *const TAG = "ds248x.one_wire"; +ESPHOME_LOG_TAG(TAG, "ds248x.one_wire"); void DS248xOneWireBus::setup() { ESP_LOGCONFIG(TAG, "Setting up DS248x 1-Wire Bus (Channel %d)...", this->channel_); diff --git a/esphome/components/duty_cycle/duty_cycle_sensor.cpp b/esphome/components/duty_cycle/duty_cycle_sensor.cpp index fd0a48b935..69a41eb548 100644 --- a/esphome/components/duty_cycle/duty_cycle_sensor.cpp +++ b/esphome/components/duty_cycle/duty_cycle_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::duty_cycle { -static const char *const TAG = "duty_cycle"; +ESPHOME_LOG_TAG(TAG, "duty_cycle"); void DutyCycleSensor::setup() { this->pin_->setup(); diff --git a/esphome/components/duty_time/duty_time_sensor.cpp b/esphome/components/duty_time/duty_time_sensor.cpp index 697a4e96f3..646c2febc6 100644 --- a/esphome/components/duty_time/duty_time_sensor.cpp +++ b/esphome/components/duty_time/duty_time_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::duty_time_sensor { -static const char *const TAG = "duty_time_sensor"; +ESPHOME_LOG_TAG(TAG, "duty_time_sensor"); #ifdef USE_BINARY_SENSOR void DutyTimeSensor::set_sensor(binary_sensor::BinarySensor *const sensor) { diff --git a/esphome/components/e131/e131.cpp b/esphome/components/e131/e131.cpp index 061af4c4c0..09c854c649 100644 --- a/esphome/components/e131/e131.cpp +++ b/esphome/components/e131/e131.cpp @@ -7,7 +7,7 @@ namespace esphome::e131 { -static const char *const TAG = "e131"; +ESPHOME_LOG_TAG(TAG, "e131"); static const int PORT = 5568; E131Component::E131Component() {} diff --git a/esphome/components/e131/e131_addressable_light_effect.cpp b/esphome/components/e131/e131_addressable_light_effect.cpp index 6157eba4e9..c8940052fd 100644 --- a/esphome/components/e131/e131_addressable_light_effect.cpp +++ b/esphome/components/e131/e131_addressable_light_effect.cpp @@ -5,7 +5,7 @@ namespace esphome::e131 { -static const char *const TAG = "e131_addressable_light_effect"; +ESPHOME_LOG_TAG(TAG, "e131_addressable_light_effect"); static const int MAX_DATA_SIZE = (sizeof(E131Packet::values) - 1); E131AddressableLightEffect::E131AddressableLightEffect(const char *name) : AddressableLightEffect(name) {} diff --git a/esphome/components/e131/e131_packet.cpp b/esphome/components/e131/e131_packet.cpp index afed2abe31..e3f2e3940a 100644 --- a/esphome/components/e131/e131_packet.cpp +++ b/esphome/components/e131/e131_packet.cpp @@ -14,7 +14,7 @@ namespace esphome::e131 { -static const char *const TAG = "e131"; +ESPHOME_LOG_TAG(TAG, "e131"); static const uint8_t ACN_ID[12] = {0x41, 0x53, 0x43, 0x2d, 0x45, 0x31, 0x2e, 0x31, 0x37, 0x00, 0x00, 0x00}; static const uint32_t VECTOR_ROOT = 4; diff --git a/esphome/components/ee895/ee895.cpp b/esphome/components/ee895/ee895.cpp index 2dd7405ff5..71ce5b0c70 100644 --- a/esphome/components/ee895/ee895.cpp +++ b/esphome/components/ee895/ee895.cpp @@ -4,7 +4,7 @@ namespace esphome::ee895 { -static const char *const TAG = "ee895"; +ESPHOME_LOG_TAG(TAG, "ee895"); // Serial number is 16 bytes static constexpr size_t EE895_SERIAL_NUMBER_SIZE = 16; diff --git a/esphome/components/ektf2232/touchscreen/ektf2232.cpp b/esphome/components/ektf2232/touchscreen/ektf2232.cpp index 51532548c1..81434c9db6 100644 --- a/esphome/components/ektf2232/touchscreen/ektf2232.cpp +++ b/esphome/components/ektf2232/touchscreen/ektf2232.cpp @@ -6,7 +6,7 @@ namespace esphome::ektf2232 { -static const char *const TAG = "ektf2232"; +ESPHOME_LOG_TAG(TAG, "ektf2232"); static const uint8_t SOFT_RESET_CMD[4] = {0x77, 0x77, 0x77, 0x77}; static const uint8_t HELLO[4] = {0x55, 0x55, 0x55, 0x55}; diff --git a/esphome/components/emc2101/emc2101.cpp b/esphome/components/emc2101/emc2101.cpp index bb041bfd6d..6a21b4e7b8 100644 --- a/esphome/components/emc2101/emc2101.cpp +++ b/esphome/components/emc2101/emc2101.cpp @@ -7,7 +7,7 @@ namespace esphome::emc2101 { -static const char *const TAG = "EMC2101"; +ESPHOME_LOG_TAG(TAG, "EMC2101"); static const uint8_t EMC2101_CHIP_ID = 0x16; // EMC2101 default device id from part id static const uint8_t EMC2101_ALT_CHIP_ID = 0x28; // EMC2101 alternate device id from part id diff --git a/esphome/components/emc2101/sensor/emc2101_sensor.cpp b/esphome/components/emc2101/sensor/emc2101_sensor.cpp index bb5eea21f3..bcc8c01c4f 100644 --- a/esphome/components/emc2101/sensor/emc2101_sensor.cpp +++ b/esphome/components/emc2101/sensor/emc2101_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::emc2101 { -static const char *const TAG = "EMC2101.sensor"; +ESPHOME_LOG_TAG(TAG, "EMC2101.sensor"); void EMC2101Sensor::dump_config() { ESP_LOGCONFIG(TAG, "Emc2101 sensor:"); diff --git a/esphome/components/emmeti/emmeti.cpp b/esphome/components/emmeti/emmeti.cpp index 82991aeac7..5cf0fd8ae1 100644 --- a/esphome/components/emmeti/emmeti.cpp +++ b/esphome/components/emmeti/emmeti.cpp @@ -3,7 +3,7 @@ namespace esphome::emmeti { -static const char *const TAG = "emmeti.climate"; +ESPHOME_LOG_TAG(TAG, "emmeti.climate"); // setters uint8_t EmmetiClimate::set_temp_() { diff --git a/esphome/components/emontx/emontx.cpp b/esphome/components/emontx/emontx.cpp index 8efc2de753..ae92b73731 100644 --- a/esphome/components/emontx/emontx.cpp +++ b/esphome/components/emontx/emontx.cpp @@ -4,7 +4,7 @@ namespace esphome::emontx { -static const char *const TAG = "emontx"; +ESPHOME_LOG_TAG(TAG, "emontx"); void EmonTx::setup() { this->buffer_pos_ = 0; } diff --git a/esphome/components/emontx/sensor/emontx_sensor.cpp b/esphome/components/emontx/sensor/emontx_sensor.cpp index 142df0150e..d6f3200e99 100644 --- a/esphome/components/emontx/sensor/emontx_sensor.cpp +++ b/esphome/components/emontx/sensor/emontx_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::emontx { -static const char *const TAG = "emontx_sensor"; +ESPHOME_LOG_TAG(TAG, "emontx_sensor"); void EmonTxSensor::dump_config() { LOG_SENSOR(" ", "EmonTx Sensor", this); } diff --git a/esphome/components/endstop/endstop_cover.cpp b/esphome/components/endstop/endstop_cover.cpp index b3c210a8d8..25b5b54209 100644 --- a/esphome/components/endstop/endstop_cover.cpp +++ b/esphome/components/endstop/endstop_cover.cpp @@ -5,7 +5,7 @@ namespace esphome::endstop { -static const char *const TAG = "endstop.cover"; +ESPHOME_LOG_TAG(TAG, "endstop.cover"); using namespace esphome::cover; diff --git a/esphome/components/ens160_base/ens160_base.cpp b/esphome/components/ens160_base/ens160_base.cpp index 20c67c3450..b06182e59c 100644 --- a/esphome/components/ens160_base/ens160_base.cpp +++ b/esphome/components/ens160_base/ens160_base.cpp @@ -20,7 +20,7 @@ namespace esphome::ens160_base { -static const char *const TAG = "ens160"; +ESPHOME_LOG_TAG(TAG, "ens160"); // Datasheet specifies 10ms, but some users report that 10ms is not sufficient for the // sensor to boot and be ready for commands. 11ms seems to be a safe value. diff --git a/esphome/components/ens160_i2c/ens160_i2c.cpp b/esphome/components/ens160_i2c/ens160_i2c.cpp index 1f02ddb718..b65855b373 100644 --- a/esphome/components/ens160_i2c/ens160_i2c.cpp +++ b/esphome/components/ens160_i2c/ens160_i2c.cpp @@ -7,7 +7,7 @@ namespace esphome::ens160_i2c { -static const char *const TAG = "ens160_i2c.sensor"; +ESPHOME_LOG_TAG(TAG, "ens160_i2c.sensor"); bool ENS160I2CComponent::read_byte(uint8_t a_register, uint8_t *data) { return I2CDevice::read_byte(a_register, data); diff --git a/esphome/components/ens160_spi/ens160_spi.cpp b/esphome/components/ens160_spi/ens160_spi.cpp index 41ab8298db..fe46c22c60 100644 --- a/esphome/components/ens160_spi/ens160_spi.cpp +++ b/esphome/components/ens160_spi/ens160_spi.cpp @@ -6,7 +6,7 @@ namespace esphome::ens160_spi { -static const char *const TAG = "ens160_spi.sensor"; +ESPHOME_LOG_TAG(TAG, "ens160_spi.sensor"); inline uint8_t reg_read(uint8_t reg) { return (reg << 1) | 0x01; } diff --git a/esphome/components/ens210/ens210.cpp b/esphome/components/ens210/ens210.cpp index 11b73afe37..fa1d459407 100644 --- a/esphome/components/ens210/ens210.cpp +++ b/esphome/components/ens210/ens210.cpp @@ -12,7 +12,7 @@ namespace esphome::ens210 { -static const char *const TAG = "ens210"; +ESPHOME_LOG_TAG(TAG, "ens210"); // ENS210 chip constants static const uint8_t ENS210_BOOTING_MS = 2; // Booting time in ms (also after reset, or going to high power) diff --git a/esphome/components/epaper_spi/epaper_spi.cpp b/esphome/components/epaper_spi/epaper_spi.cpp index 1fab038c28..0c1d9b0faf 100644 --- a/esphome/components/epaper_spi/epaper_spi.cpp +++ b/esphome/components/epaper_spi/epaper_spi.cpp @@ -6,7 +6,7 @@ namespace esphome::epaper_spi { -static const char *const TAG = "epaper_spi"; +ESPHOME_LOG_TAG(TAG, "epaper_spi"); static constexpr size_t EPAPER_MAX_CMD_LOG_BYTES = 128; static constexpr const char *const EPAPER_STATE_STRINGS[] = { diff --git a/esphome/components/epaper_spi/epaper_spi_4bpp.cpp b/esphome/components/epaper_spi/epaper_spi_4bpp.cpp index 820dc3c77a..0f7f7549d8 100644 --- a/esphome/components/epaper_spi/epaper_spi_4bpp.cpp +++ b/esphome/components/epaper_spi/epaper_spi_4bpp.cpp @@ -4,7 +4,7 @@ namespace esphome::epaper_spi { -static constexpr const char *const TAG = "epaper_spi.4bpp"; +ESPHOME_LOG_TAG(TAG, "epaper_spi.4bpp"); void EPaper4bpp::fill(Color color) { // If clipping is active, fall back to base implementation diff --git a/esphome/components/epaper_spi/epaper_spi_inkplate2.cpp b/esphome/components/epaper_spi/epaper_spi_inkplate2.cpp index fc0d674246..60e3245def 100644 --- a/esphome/components/epaper_spi/epaper_spi_inkplate2.cpp +++ b/esphome/components/epaper_spi/epaper_spi_inkplate2.cpp @@ -6,7 +6,7 @@ namespace esphome::epaper_spi { -static constexpr const char *const TAG = "epaper_spi.inkplate2"; +ESPHOME_LOG_TAG(TAG, "epaper_spi.inkplate2"); // Map RGB to the panel's black/white/red via the shared converter. enum class Inkplate2Color : uint8_t { BLACK, WHITE, RED }; diff --git a/esphome/components/epaper_spi/epaper_spi_inkplate6color.cpp b/esphome/components/epaper_spi/epaper_spi_inkplate6color.cpp index b81542b6c1..5bffba35c9 100644 --- a/esphome/components/epaper_spi/epaper_spi_inkplate6color.cpp +++ b/esphome/components/epaper_spi/epaper_spi_inkplate6color.cpp @@ -7,7 +7,7 @@ namespace esphome::epaper_spi { -static constexpr const char *const TAG = "epaper_spi.inkplate6color"; +ESPHOME_LOG_TAG(TAG, "epaper_spi.inkplate6color"); // Native hardware color codes for this panel's 4-bit color values. enum Inkplate6ColorHex : uint8_t { diff --git a/esphome/components/epaper_spi/epaper_spi_jd79660.cpp b/esphome/components/epaper_spi/epaper_spi_jd79660.cpp index 1cd1087c6b..0de044e8d7 100644 --- a/esphome/components/epaper_spi/epaper_spi_jd79660.cpp +++ b/esphome/components/epaper_spi/epaper_spi_jd79660.cpp @@ -4,7 +4,7 @@ #include "esphome/core/log.h" namespace esphome::epaper_spi { -static constexpr const char *const TAG = "epaper_spi.jd79660"; +ESPHOME_LOG_TAG(TAG, "epaper_spi.jd79660"); /** Pixel color as 2bpp. Must match IC LUT values. */ enum JD79660Color : uint8_t { diff --git a/esphome/components/epaper_spi/epaper_spi_mono.cpp b/esphome/components/epaper_spi/epaper_spi_mono.cpp index fffb2b5e84..b6653038c3 100644 --- a/esphome/components/epaper_spi/epaper_spi_mono.cpp +++ b/esphome/components/epaper_spi/epaper_spi_mono.cpp @@ -5,7 +5,7 @@ #include "esphome/core/log.h" namespace esphome::epaper_spi { -static constexpr const char *const TAG = "epaper_spi.mono"; +ESPHOME_LOG_TAG(TAG, "epaper_spi.mono"); void EPaperMono::refresh_screen(bool partial) { ESP_LOGV(TAG, "Refresh screen"); diff --git a/esphome/components/epaper_spi/epaper_spi_spectra_e6.cpp b/esphome/components/epaper_spi/epaper_spi_spectra_e6.cpp index f47d37d550..a2fe9bd641 100644 --- a/esphome/components/epaper_spi/epaper_spi_spectra_e6.cpp +++ b/esphome/components/epaper_spi/epaper_spi_spectra_e6.cpp @@ -4,7 +4,7 @@ #include "esphome/core/log.h" namespace esphome::epaper_spi { -static constexpr const char *const TAG = "epaper_spi.6c"; +ESPHOME_LOG_TAG(TAG, "epaper_spi.6c"); // Native hardware color codes for this panel's 4-bit color values. enum E6Color : uint8_t { diff --git a/esphome/components/epaper_spi/epaper_spi_ssd1677.cpp b/esphome/components/epaper_spi/epaper_spi_ssd1677.cpp index e845a5d585..a9245fa1c2 100644 --- a/esphome/components/epaper_spi/epaper_spi_ssd1677.cpp +++ b/esphome/components/epaper_spi/epaper_spi_ssd1677.cpp @@ -6,7 +6,7 @@ #include "esphome/core/log.h" namespace esphome::epaper_spi { -static constexpr const char *const TAG = "epaper_spi.ssd1677"; +ESPHOME_LOG_TAG(TAG, "epaper_spi.ssd1677"); void EPaperSSD1677::setup() { EPaperMono::setup(); diff --git a/esphome/components/epaper_spi/epaper_spi_ssd1677_gray4.cpp b/esphome/components/epaper_spi/epaper_spi_ssd1677_gray4.cpp index 18fbb016f3..34120c908b 100644 --- a/esphome/components/epaper_spi/epaper_spi_ssd1677_gray4.cpp +++ b/esphome/components/epaper_spi/epaper_spi_ssd1677_gray4.cpp @@ -4,7 +4,7 @@ namespace esphome::epaper_spi { -static constexpr const char *const TAG = "epaper_spi.ssd1677_gray4"; +ESPHOME_LOG_TAG(TAG, "epaper_spi.ssd1677_gray4"); // Combine two source bytes (4 pixels each, 2 bits per pixel, most significant pixel first) into // one plane byte covering the same 8 pixels (1 bit per pixel), choosing high or low bit diff --git a/esphome/components/epaper_spi/epaper_spi_ssd1683.cpp b/esphome/components/epaper_spi/epaper_spi_ssd1683.cpp index 6fb7e1ac1a..9b6acf412a 100644 --- a/esphome/components/epaper_spi/epaper_spi_ssd1683.cpp +++ b/esphome/components/epaper_spi/epaper_spi_ssd1683.cpp @@ -5,7 +5,7 @@ #include "esphome/core/log.h" namespace esphome::epaper_spi { -static constexpr const char *const TAG = "epaper_spi.mono"; +ESPHOME_LOG_TAG(TAG, "epaper_spi.mono"); void EPaperSSD1683::refresh_screen(bool partial) { ESP_LOGV(TAG, "Refresh screen"); diff --git a/esphome/components/epaper_spi/epaper_spi_t133a01.cpp b/esphome/components/epaper_spi/epaper_spi_t133a01.cpp index 95d1fcb484..bd5a4c9b6e 100644 --- a/esphome/components/epaper_spi/epaper_spi_t133a01.cpp +++ b/esphome/components/epaper_spi/epaper_spi_t133a01.cpp @@ -6,7 +6,7 @@ namespace esphome::epaper_spi { -static constexpr const char *const TAG = "epaper_spi.t133a01"; +ESPHOME_LOG_TAG(TAG, "epaper_spi.t133a01"); // Color indices used in the 4bpp buffer (sprite-side) // These MUST match the Arduino GFX TFT_eSPI.h color definitions and diff --git a/esphome/components/epaper_spi/epaper_spi_uc8179.cpp b/esphome/components/epaper_spi/epaper_spi_uc8179.cpp index 2a4ff2969a..328cd83329 100644 --- a/esphome/components/epaper_spi/epaper_spi_uc8179.cpp +++ b/esphome/components/epaper_spi/epaper_spi_uc8179.cpp @@ -6,7 +6,7 @@ namespace esphome::epaper_spi { -static constexpr const char *const TAG = "epaper_spi.uc8179"; +ESPHOME_LOG_TAG(TAG, "epaper_spi.uc8179"); bool EPaperUC8179::initialise(bool partial) { EPaperBase::initialise(partial); // send the model init sequence diff --git a/esphome/components/epaper_spi/epaper_waveshare.cpp b/esphome/components/epaper_spi/epaper_waveshare.cpp index 7a7b4e22d3..d4c7ba5fdb 100644 --- a/esphome/components/epaper_spi/epaper_waveshare.cpp +++ b/esphome/components/epaper_spi/epaper_waveshare.cpp @@ -2,7 +2,7 @@ namespace esphome::epaper_spi { -static const char *const TAG = "epaper_spi.waveshare"; +ESPHOME_LOG_TAG(TAG, "epaper_spi.waveshare"); bool EpaperWaveshare::initialise(bool partial) { EPaperBase::initialise(partial); diff --git a/esphome/components/epaper_spi/epaper_weact_3c.cpp b/esphome/components/epaper_spi/epaper_weact_3c.cpp index ad2021ed64..90cf6af7b2 100644 --- a/esphome/components/epaper_spi/epaper_weact_3c.cpp +++ b/esphome/components/epaper_spi/epaper_weact_3c.cpp @@ -3,7 +3,7 @@ namespace esphome::epaper_spi { -static constexpr const char *const TAG = "epaper_weact_3c"; +ESPHOME_LOG_TAG(TAG, "epaper_weact_3c"); enum class BwrState : uint8_t { BWR_BLACK, diff --git a/esphome/components/es7210/es7210.cpp b/esphome/components/es7210/es7210.cpp index 5afc22aec4..0354f719ef 100644 --- a/esphome/components/es7210/es7210.cpp +++ b/esphome/components/es7210/es7210.cpp @@ -6,7 +6,7 @@ namespace esphome::es7210 { -static const char *const TAG = "es7210"; +ESPHOME_LOG_TAG(TAG, "es7210"); static const size_t MCLK_DIV_FRE = 256; diff --git a/esphome/components/es7243e/es7243e.cpp b/esphome/components/es7243e/es7243e.cpp index fc3cba7ae4..1bfa6933dd 100644 --- a/esphome/components/es7243e/es7243e.cpp +++ b/esphome/components/es7243e/es7243e.cpp @@ -8,7 +8,7 @@ namespace esphome::es7243e { -static const char *const TAG = "es7243e"; +ESPHOME_LOG_TAG(TAG, "es7243e"); // Mark the component as failed; use only in setup #define ES7243E_ERROR_FAILED(func) \ diff --git a/esphome/components/es8156/es8156.cpp b/esphome/components/es8156/es8156.cpp index 03d9713df9..467402e704 100644 --- a/esphome/components/es8156/es8156.cpp +++ b/esphome/components/es8156/es8156.cpp @@ -6,7 +6,7 @@ namespace esphome::es8156 { -static const char *const TAG = "es8156"; +ESPHOME_LOG_TAG(TAG, "es8156"); // Mark the component as failed; use only in setup #define ES8156_ERROR_FAILED(func) \ diff --git a/esphome/components/es8311/es8311.cpp b/esphome/components/es8311/es8311.cpp index 9a4da3744a..96b644ee78 100644 --- a/esphome/components/es8311/es8311.cpp +++ b/esphome/components/es8311/es8311.cpp @@ -6,7 +6,7 @@ namespace esphome::es8311 { -static const char *const TAG = "es8311"; +ESPHOME_LOG_TAG(TAG, "es8311"); // Mark the component as failed; use only in setup #define ES8311_ERROR_FAILED(func) \ diff --git a/esphome/components/es8388/es8388.cpp b/esphome/components/es8388/es8388.cpp index 0b97240230..040fd7fe26 100644 --- a/esphome/components/es8388/es8388.cpp +++ b/esphome/components/es8388/es8388.cpp @@ -6,7 +6,7 @@ namespace esphome::es8388 { -static const char *const TAG = "es8388"; +ESPHOME_LOG_TAG(TAG, "es8388"); // Mark the component as failed; use only in setup #define ES8388_ERROR_FAILED(func) \ diff --git a/esphome/components/esp32/crash_handler.cpp b/esphome/components/esp32/crash_handler.cpp index b72a2777c7..78326249ad 100644 --- a/esphome/components/esp32/crash_handler.cpp +++ b/esphome/components/esp32/crash_handler.cpp @@ -161,7 +161,7 @@ static bool s_crash_data_valid = false; // NOLINT(cppcoreguidelines-avoid-non-c namespace esphome::esp32 { -static const char *const TAG = "esp32.crash"; +ESPHOME_LOG_TAG(TAG, "esp32.crash"); // RAM copy of the build timestamp. The generated constant lives in flash, // which the panic handler must not read (cache may be disabled during diff --git a/esphome/components/esp32/gpio.cpp b/esphome/components/esp32/gpio.cpp index a00c984f76..6e4de6aa51 100644 --- a/esphome/components/esp32/gpio.cpp +++ b/esphome/components/esp32/gpio.cpp @@ -23,7 +23,7 @@ namespace esphome { namespace esp32 { -static const char *const TAG = "esp32"; +ESPHOME_LOG_TAG(TAG, "esp32"); static const gpio_hal_context_t GPIO_HAL = {.dev = GPIO_HAL_GET_HW(GPIO_PORT_0)}; diff --git a/esphome/components/esp32/helpers.cpp b/esphome/components/esp32/helpers.cpp index 91b4241211..88fccea0ca 100644 --- a/esphome/components/esp32/helpers.cpp +++ b/esphome/components/esp32/helpers.cpp @@ -15,7 +15,7 @@ namespace esphome { -static const char *const TAG = "esp32"; +ESPHOME_LOG_TAG(TAG, "esp32"); bool random_bytes(uint8_t *data, size_t len) { esp_fill_random(data, len); diff --git a/esphome/components/esp32/preferences.cpp b/esphome/components/esp32/preferences.cpp index f3d5844cd7..02978ae0f7 100644 --- a/esphome/components/esp32/preferences.cpp +++ b/esphome/components/esp32/preferences.cpp @@ -12,7 +12,7 @@ namespace esphome::esp32 { -static const char *const TAG = "preferences"; +ESPHOME_LOG_TAG(TAG, "preferences"); struct NVSData { uint32_t key; diff --git a/esphome/components/esp32_ble/ble.cpp b/esphome/components/esp32_ble/ble.cpp index a44886b8c8..b5051c63e1 100644 --- a/esphome/components/esp32_ble/ble.cpp +++ b/esphome/components/esp32_ble/ble.cpp @@ -38,7 +38,7 @@ extern "C" bool btInUse() { return true; } // NOLINT(readability-identifier-nam namespace esphome::esp32_ble { -static const char *const TAG = "esp32_ble"; +ESPHOME_LOG_TAG(TAG, "esp32_ble"); #ifdef CONFIG_BT_CONTROLLER_DISABLED // Bringing up the remote BT controller issues synchronous RPCs to the diff --git a/esphome/components/esp32_ble/ble_advertising.cpp b/esphome/components/esp32_ble/ble_advertising.cpp index 68704e49e2..30d21ff9f4 100644 --- a/esphome/components/esp32_ble/ble_advertising.cpp +++ b/esphome/components/esp32_ble/ble_advertising.cpp @@ -11,7 +11,7 @@ namespace esphome::esp32_ble { -static const char *const TAG = "esp32_ble.advertising"; +ESPHOME_LOG_TAG(TAG, "esp32_ble.advertising"); BLEAdvertising::BLEAdvertising(uint32_t advertising_cycle_time) : advertising_cycle_time_(advertising_cycle_time) { this->advertising_data_.set_scan_rsp = false; diff --git a/esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp b/esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp index 47e4b7ebb2..7481d2c612 100644 --- a/esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp +++ b/esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp @@ -18,7 +18,7 @@ namespace esphome::esp32_ble_beacon { -static const char *const TAG = "esp32_ble_beacon"; +ESPHOME_LOG_TAG(TAG, "esp32_ble_beacon"); static const esp_ble_ibeacon_head_t IBEACON_COMMON_HEAD = { .flags = {0x02, 0x01, 0x06}, .length = 0x1A, .type = 0xFF, .company_id = {0x4C, 0x00}, .beacon_type = {0x02, 0x15}}; diff --git a/esphome/components/esp32_ble_client/ble_characteristic.cpp b/esphome/components/esp32_ble_client/ble_characteristic.cpp index e830702f11..fceca5f558 100644 --- a/esphome/components/esp32_ble_client/ble_characteristic.cpp +++ b/esphome/components/esp32_ble_client/ble_characteristic.cpp @@ -9,7 +9,7 @@ namespace esphome::esp32_ble_client { -static const char *const TAG = "esp32_ble_client"; +ESPHOME_LOG_TAG(TAG, "esp32_ble_client"); BLECharacteristic::~BLECharacteristic() { for (auto &desc : this->descriptors) diff --git a/esphome/components/esp32_ble_client/ble_client_base.cpp b/esphome/components/esp32_ble_client/ble_client_base.cpp index 88454f7bdb..68fccac288 100644 --- a/esphome/components/esp32_ble_client/ble_client_base.cpp +++ b/esphome/components/esp32_ble_client/ble_client_base.cpp @@ -11,7 +11,7 @@ namespace esphome::esp32_ble_client { -static const char *const TAG = "esp32_ble_client"; +ESPHOME_LOG_TAG(TAG, "esp32_ble_client"); // Connection parameters are shared with the other GATT client backends // (ble_device_base/ble_client_state.h) so the platforms cannot drift. diff --git a/esphome/components/esp32_ble_client/ble_service.cpp b/esphome/components/esp32_ble_client/ble_service.cpp index 695f468c5b..40e9f81d23 100644 --- a/esphome/components/esp32_ble_client/ble_service.cpp +++ b/esphome/components/esp32_ble_client/ble_service.cpp @@ -8,7 +8,7 @@ namespace esphome::esp32_ble_client { -static const char *const TAG = "esp32_ble_client"; +ESPHOME_LOG_TAG(TAG, "esp32_ble_client"); BLECharacteristic *BLEService::get_characteristic(espbt::ESPBTUUID uuid) { if (!this->parsed) diff --git a/esphome/components/esp32_ble_server/ble_characteristic.cpp b/esphome/components/esp32_ble_server/ble_characteristic.cpp index 4d364b4655..75a3399379 100644 --- a/esphome/components/esp32_ble_server/ble_characteristic.cpp +++ b/esphome/components/esp32_ble_server/ble_characteristic.cpp @@ -9,7 +9,7 @@ namespace esphome::esp32_ble_server { -static const char *const TAG = "esp32_ble_server.characteristic"; +ESPHOME_LOG_TAG(TAG, "esp32_ble_server.characteristic"); BLECharacteristic::~BLECharacteristic() { for (auto *descriptor : this->descriptors_) { diff --git a/esphome/components/esp32_ble_server/ble_descriptor.cpp b/esphome/components/esp32_ble_server/ble_descriptor.cpp index 3dcac3691c..228313e2d8 100644 --- a/esphome/components/esp32_ble_server/ble_descriptor.cpp +++ b/esphome/components/esp32_ble_server/ble_descriptor.cpp @@ -9,7 +9,7 @@ namespace esphome::esp32_ble_server { -static const char *const TAG = "esp32_ble_server.descriptor"; +ESPHOME_LOG_TAG(TAG, "esp32_ble_server.descriptor"); static RAMAllocator descriptor_allocator{}; // NOLINT diff --git a/esphome/components/esp32_ble_server/ble_server.cpp b/esphome/components/esp32_ble_server/ble_server.cpp index e34a57cf37..650a765b6a 100644 --- a/esphome/components/esp32_ble_server/ble_server.cpp +++ b/esphome/components/esp32_ble_server/ble_server.cpp @@ -18,7 +18,7 @@ namespace esphome::esp32_ble_server { -static const char *const TAG = "esp32_ble_server"; +ESPHOME_LOG_TAG(TAG, "esp32_ble_server"); void BLEServer::setup() { if (this->parent_->is_failed()) { diff --git a/esphome/components/esp32_ble_server/ble_service.cpp b/esphome/components/esp32_ble_server/ble_service.cpp index ac8d7fa003..c8f4ecbf33 100644 --- a/esphome/components/esp32_ble_server/ble_service.cpp +++ b/esphome/components/esp32_ble_server/ble_service.cpp @@ -6,7 +6,7 @@ namespace esphome::esp32_ble_server { -static const char *const TAG = "esp32_ble_server.service"; +ESPHOME_LOG_TAG(TAG, "esp32_ble_server.service"); BLEService::BLEService(ESPBTUUID uuid, uint16_t num_handles, uint8_t inst_id, bool advertise) : uuid_(uuid), num_handles_(num_handles), inst_id_(inst_id), advertise_(advertise) {} diff --git a/esphome/components/esp32_ble_tracker/bluedroid_stubs.cpp b/esphome/components/esp32_ble_tracker/bluedroid_stubs.cpp index 5cedc22d06..cffa57a518 100644 --- a/esphome/components/esp32_ble_tracker/bluedroid_stubs.cpp +++ b/esphome/components/esp32_ble_tracker/bluedroid_stubs.cpp @@ -15,7 +15,7 @@ #include "esphome/core/log.h" namespace esphome::esp32_ble_tracker { -static const char *const TAG = "esp32_ble_tracker"; +ESPHOME_LOG_TAG(TAG, "esp32_ble_tracker"); } // namespace esphome::esp32_ble_tracker static_assert(ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(6, 2, 0), diff --git a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp index 9bb90026e3..8d3148c2fc 100644 --- a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +++ b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp @@ -32,7 +32,7 @@ namespace esphome::esp32_ble_tracker { -static const char *const TAG = "esp32_ble_tracker"; +ESPHOME_LOG_TAG(TAG, "esp32_ble_tracker"); ESP32BLETracker *global_esp32_ble_tracker = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/components/esp32_camera/esp32_camera.cpp b/esphome/components/esp32_camera/esp32_camera.cpp index 03fdbc4de7..ef29fc9b25 100644 --- a/esphome/components/esp32_camera/esp32_camera.cpp +++ b/esphome/components/esp32_camera/esp32_camera.cpp @@ -9,7 +9,7 @@ namespace esphome::esp32_camera { -static const char *const TAG = "esp32_camera"; +ESPHOME_LOG_TAG(TAG, "esp32_camera"); static constexpr size_t FRAMEBUFFER_TASK_STACK_SIZE = 1792; #if ESPHOME_LOG_LEVEL < ESPHOME_LOG_LEVEL_VERBOSE static constexpr uint32_t FRAME_LOG_INTERVAL_MS = 60000; diff --git a/esphome/components/esp32_camera_web_server/camera_web_server.cpp b/esphome/components/esp32_camera_web_server/camera_web_server.cpp index bee231d132..36c1cdfa45 100644 --- a/esphome/components/esp32_camera_web_server/camera_web_server.cpp +++ b/esphome/components/esp32_camera_web_server/camera_web_server.cpp @@ -16,7 +16,7 @@ namespace esphome::esp32_camera_web_server { static const uint32_t IMAGE_REQUEST_TIMEOUT = 5000; // How often streaming_handler_ reports its throughput. static const uint32_t STREAM_STATS_INTERVAL = 5000; -static const char *const TAG = "esp32_camera_web_server"; +ESPHOME_LOG_TAG(TAG, "esp32_camera_web_server"); #define PART_BOUNDARY "123456789000000000000987654321" #define CONTENT_TYPE "image/jpeg" diff --git a/esphome/components/esp32_can/esp32_can.cpp b/esphome/components/esp32_can/esp32_can.cpp index e04405c63c..083c97f8cf 100644 --- a/esphome/components/esp32_can/esp32_can.cpp +++ b/esphome/components/esp32_can/esp32_can.cpp @@ -11,7 +11,7 @@ namespace esphome::esp32_can { -static const char *const TAG = "esp32_can"; +ESPHOME_LOG_TAG(TAG, "esp32_can"); static bool get_bitrate(canbus::CanSpeed bitrate, twai_timing_config_t *t_config) { switch (bitrate) { diff --git a/esphome/components/esp32_dac/esp32_dac.cpp b/esphome/components/esp32_dac/esp32_dac.cpp index 54b89c46ad..3517941de1 100644 --- a/esphome/components/esp32_dac/esp32_dac.cpp +++ b/esphome/components/esp32_dac/esp32_dac.cpp @@ -12,7 +12,7 @@ static constexpr uint8_t DAC0_PIN = 17; static constexpr uint8_t DAC0_PIN = 25; #endif -static const char *const TAG = "esp32_dac"; +ESPHOME_LOG_TAG(TAG, "esp32_dac"); void ESP32DAC::setup() { this->pin_->setup(); diff --git a/esphome/components/esp32_hosted/esp_now_hosted.cpp b/esphome/components/esp32_hosted/esp_now_hosted.cpp index ad29b208fe..03b03fd983 100644 --- a/esphome/components/esp32_hosted/esp_now_hosted.cpp +++ b/esphome/components/esp32_hosted/esp_now_hosted.cpp @@ -45,7 +45,7 @@ extern "C" { namespace { -const char *const TAG = "esp_now_hosted"; +ESPHOME_LOG_TAG(TAG, "esp_now_hosted"); // One outstanding request at a time. ESPHome drives esp_now_* from the main // loop; the matching response and the async RECV/SEND events all arrive on the diff --git a/esphome/components/esp32_hosted/update/esp32_hosted_update.cpp b/esphome/components/esp32_hosted/update/esp32_hosted_update.cpp index c35301a685..7b9056bc80 100644 --- a/esphome/components/esp32_hosted/update/esp32_hosted_update.cpp +++ b/esphome/components/esp32_hosted/update/esp32_hosted_update.cpp @@ -22,7 +22,7 @@ extern "C" { namespace esphome::esp32_hosted { -static const char *const TAG = "esp32_hosted.update"; +ESPHOME_LOG_TAG(TAG, "esp32_hosted.update"); // Older coprocessor firmware versions have a 1500-byte limit per RPC call constexpr size_t CHUNK_SIZE = 1500; diff --git a/esphome/components/esp32_rmt_led_strip/led_strip.cpp b/esphome/components/esp32_rmt_led_strip/led_strip.cpp index 7cac1dfb41..420ff64ddc 100644 --- a/esphome/components/esp32_rmt_led_strip/led_strip.cpp +++ b/esphome/components/esp32_rmt_led_strip/led_strip.cpp @@ -11,7 +11,7 @@ namespace esphome::esp32_rmt_led_strip { -static const char *const TAG = "esp32_rmt_led_strip"; +ESPHOME_LOG_TAG(TAG, "esp32_rmt_led_strip"); static const size_t RMT_SYMBOLS_PER_BYTE = 8; diff --git a/esphome/components/esp32_touch/esp32_touch.cpp b/esphome/components/esp32_touch/esp32_touch.cpp index 54bbbe52ed..ed7d0bd7cb 100644 --- a/esphome/components/esp32_touch/esp32_touch.cpp +++ b/esphome/components/esp32_touch/esp32_touch.cpp @@ -13,7 +13,7 @@ template static const char *lookup_str(const char *const (&table)[N], return (index < N) ? table[index] : "UNKNOWN"; } -static const char *const TAG = "esp32_touch"; +ESPHOME_LOG_TAG(TAG, "esp32_touch"); static constexpr uint32_t SETUP_MODE_LOG_INTERVAL_MS = 250; static constexpr uint32_t INITIAL_STATE_DELAY_MS = 1500; diff --git a/esphome/components/esp8266/crash_handler.cpp b/esphome/components/esp8266/crash_handler.cpp index dc79043f21..1ba96eaebb 100644 --- a/esphome/components/esp8266/crash_handler.cpp +++ b/esphome/components/esp8266/crash_handler.cpp @@ -82,7 +82,7 @@ static_assert(sizeof(RtcCrashData) == 72, "RtcCrashData must fit in 18 RTC block namespace esphome::esp8266 { -static const char *const TAG = "esp8266"; +ESPHOME_LOG_TAG(TAG, "esp8266"); static inline bool is_crash_reason(uint32_t reason) { return reason == REASON_WDT_RST || reason == REASON_EXCEPTION_RST || reason == REASON_SOFT_WDT_RST; diff --git a/esphome/components/esp8266/gpio.cpp b/esphome/components/esp8266/gpio.cpp index 66ac122f00..ae09bdb91c 100644 --- a/esphome/components/esp8266/gpio.cpp +++ b/esphome/components/esp8266/gpio.cpp @@ -5,7 +5,7 @@ namespace esphome::esp8266 { -static const char *const TAG = "esp8266"; +ESPHOME_LOG_TAG(TAG, "esp8266"); static int flags_to_mode(gpio::Flags flags, uint8_t pin) { flags = diff --git a/esphome/components/esp8266/preferences.cpp b/esphome/components/esp8266/preferences.cpp index d954ae4a0f..b731187f9c 100644 --- a/esphome/components/esp8266/preferences.cpp +++ b/esphome/components/esp8266/preferences.cpp @@ -14,7 +14,7 @@ extern "C" { namespace esphome::esp8266 { -static const char *const TAG = "preferences"; +ESPHOME_LOG_TAG(TAG, "preferences"); static constexpr uint32_t ESP_RTC_USER_MEM_START = 0x60001200; static constexpr uint32_t ESP_RTC_USER_MEM_SIZE_WORDS = 128; diff --git a/esphome/components/esp8266_pwm/esp8266_pwm.cpp b/esphome/components/esp8266_pwm/esp8266_pwm.cpp index b5b3d5073a..c01a69ce10 100644 --- a/esphome/components/esp8266_pwm/esp8266_pwm.cpp +++ b/esphome/components/esp8266_pwm/esp8266_pwm.cpp @@ -10,7 +10,7 @@ namespace esphome::esp8266_pwm { -static const char *const TAG = "esp8266_pwm"; +ESPHOME_LOG_TAG(TAG, "esp8266_pwm"); void ESP8266PWM::setup() { this->pin_->setup(); diff --git a/esphome/components/esp_ldo/esp_ldo.cpp b/esphome/components/esp_ldo/esp_ldo.cpp index b3c9a59865..e978dd12b0 100644 --- a/esphome/components/esp_ldo/esp_ldo.cpp +++ b/esphome/components/esp_ldo/esp_ldo.cpp @@ -5,7 +5,7 @@ namespace esphome::esp_ldo { -static const char *const TAG = "esp_ldo"; +ESPHOME_LOG_TAG(TAG, "esp_ldo"); void EspLdo::setup() { esp_ldo_channel_config_t config{}; config.chan_id = this->channel_; diff --git a/esphome/components/espectre/espectre.cpp b/esphome/components/espectre/espectre.cpp index 0cce6a3b94..c758a3b246 100644 --- a/esphome/components/espectre/espectre.cpp +++ b/esphome/components/espectre/espectre.cpp @@ -13,7 +13,7 @@ namespace esphome::espectre { -static const char *const TAG = "espectre"; +ESPHOME_LOG_TAG(TAG, "espectre"); struct TrafficModeOption { const char *name; diff --git a/esphome/components/espectre/sensor/espectre_diagnostics.cpp b/esphome/components/espectre/sensor/espectre_diagnostics.cpp index 0edc3c0728..bb6024a233 100644 --- a/esphome/components/espectre/sensor/espectre_diagnostics.cpp +++ b/esphome/components/espectre/sensor/espectre_diagnostics.cpp @@ -7,7 +7,7 @@ namespace esphome::espectre { -static const char *const TAG = "espectre.sensor"; +ESPHOME_LOG_TAG(TAG, "espectre.sensor"); static void publish_diagnostic(sensor::Sensor *sensor, const ::espectre::RuntimeDiagnosticsSample *sample, float ::espectre::RuntimeDiagnosticsSample::*field, float scale = 1.0f) { diff --git a/esphome/components/esphome/ota/ota_esphome.cpp b/esphome/components/esphome/ota/ota_esphome.cpp index c399c0901c..318e1e5282 100644 --- a/esphome/components/esphome/ota/ota_esphome.cpp +++ b/esphome/components/esphome/ota/ota_esphome.cpp @@ -30,7 +30,7 @@ namespace esphome { -static const char *const TAG = "esphome.ota"; +ESPHOME_LOG_TAG(TAG, "esphome.ota"); #ifdef USE_OTA_ENCRYPTION const noise::NoiseContext &ESPHomeOTAComponent::noise_context_() const { diff --git a/esphome/components/esphome/ota/ota_esphome_inflate_session.cpp b/esphome/components/esphome/ota/ota_esphome_inflate_session.cpp index f3005cac48..38b58b0b03 100644 --- a/esphome/components/esphome/ota/ota_esphome_inflate_session.cpp +++ b/esphome/components/esphome/ota/ota_esphome_inflate_session.cpp @@ -7,7 +7,7 @@ namespace esphome { -static const char *const TAG = "esphome.ota"; +ESPHOME_LOG_TAG(TAG, "esphome.ota"); // The window doubles as the output buffer; flushed bytes stay as back // reference history for the next windowful. diff --git a/esphome/components/esphome/ota/ota_esphome_noise.cpp b/esphome/components/esphome/ota/ota_esphome_noise.cpp index b3d8501f10..a271ef9d39 100644 --- a/esphome/components/esphome/ota/ota_esphome_noise.cpp +++ b/esphome/components/esphome/ota/ota_esphome_noise.cpp @@ -14,7 +14,7 @@ namespace esphome { -static const char *const TAG = "esphome.ota"; +ESPHOME_LOG_TAG(TAG, "esphome.ota"); #ifdef USE_ESP8266 static constexpr char OTA_NOISE_PROLOGUE_INIT[] PROGMEM = "NoiseOTAInit"; diff --git a/esphome/components/espnow/espnow_component.cpp b/esphome/components/espnow/espnow_component.cpp index ecf0f79e4a..3fd468764a 100644 --- a/esphome/components/espnow/espnow_component.cpp +++ b/esphome/components/espnow/espnow_component.cpp @@ -26,7 +26,7 @@ namespace esphome::espnow { -static constexpr const char *TAG = "espnow"; +ESPHOME_LOG_TAG(TAG, "espnow"); ESPNowComponent *global_esp_now = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/components/espnow/packet_transport/espnow_transport.cpp b/esphome/components/espnow/packet_transport/espnow_transport.cpp index b7686f23d6..7053229db4 100644 --- a/esphome/components/espnow/packet_transport/espnow_transport.cpp +++ b/esphome/components/espnow/packet_transport/espnow_transport.cpp @@ -7,7 +7,7 @@ namespace esphome::espnow { -static const char *const TAG = "espnow.transport"; +ESPHOME_LOG_TAG(TAG, "espnow.transport"); bool ESPNowTransport::should_send() { return this->parent_ != nullptr && !this->parent_->is_failed(); } diff --git a/esphome/components/ethernet/ethernet_component_esp32.cpp b/esphome/components/ethernet/ethernet_component_esp32.cpp index e9281453c9..1568d37b11 100644 --- a/esphome/components/ethernet/ethernet_component_esp32.cpp +++ b/esphome/components/ethernet/ethernet_component_esp32.cpp @@ -77,7 +77,7 @@ namespace esphome::ethernet { -static const char *const TAG = "ethernet"; +ESPHOME_LOG_TAG(TAG, "ethernet"); // PHY register size for hex logging static constexpr size_t PHY_REG_SIZE = 2; diff --git a/esphome/components/ethernet/ethernet_component_rp2.cpp b/esphome/components/ethernet/ethernet_component_rp2.cpp index 94d84cc891..ecb238419e 100644 --- a/esphome/components/ethernet/ethernet_component_rp2.cpp +++ b/esphome/components/ethernet/ethernet_component_rp2.cpp @@ -14,7 +14,7 @@ namespace esphome::ethernet { -static const char *const TAG = "ethernet"; +ESPHOME_LOG_TAG(TAG, "ethernet"); void EthernetComponent::setup() { // Configure SPI pins diff --git a/esphome/components/ethernet_info/ethernet_info_text_sensor.cpp b/esphome/components/ethernet_info/ethernet_info_text_sensor.cpp index 15ef6a1f20..e75d3eb9ae 100644 --- a/esphome/components/ethernet_info/ethernet_info_text_sensor.cpp +++ b/esphome/components/ethernet_info/ethernet_info_text_sensor.cpp @@ -5,7 +5,7 @@ namespace esphome::ethernet_info { -static const char *const TAG = "ethernet_info"; +ESPHOME_LOG_TAG(TAG, "ethernet_info"); #ifdef USE_ETHERNET_IP_STATE_LISTENERS void IPAddressEthernetInfo::setup() { ethernet::global_eth_component->add_ip_state_listener(this); } diff --git a/esphome/components/event/event.cpp b/esphome/components/event/event.cpp index 00bb9497f9..3170c7a8dd 100644 --- a/esphome/components/event/event.cpp +++ b/esphome/components/event/event.cpp @@ -5,7 +5,7 @@ namespace esphome::event { -static const char *const TAG = "event"; +ESPHOME_LOG_TAG(TAG, "event"); void Event::trigger(const char *event_type) { // Linear search with strcmp - faster than std::set for small datasets (1-5 items typical) diff --git a/esphome/components/exponential_moving_average/exponential_moving_average_sensor.cpp b/esphome/components/exponential_moving_average/exponential_moving_average_sensor.cpp index 243e2cf31e..ff4eded9cf 100644 --- a/esphome/components/exponential_moving_average/exponential_moving_average_sensor.cpp +++ b/esphome/components/exponential_moving_average/exponential_moving_average_sensor.cpp @@ -6,7 +6,7 @@ namespace esphome::exponential_moving_average { -static const char *const TAG = "exponential_moving_average"; +ESPHOME_LOG_TAG(TAG, "exponential_moving_average"); const LogString *time_weighting_to_string(TimeWeighting weighting) { switch (weighting) { diff --git a/esphome/components/exposure_notifications/exposure_notifications.cpp b/esphome/components/exposure_notifications/exposure_notifications.cpp index 4f4b93b59c..063d7ba678 100644 --- a/esphome/components/exposure_notifications/exposure_notifications.cpp +++ b/esphome/components/exposure_notifications/exposure_notifications.cpp @@ -6,7 +6,7 @@ namespace esphome::exposure_notifications { using namespace ble_device_base; -static const char *const TAG = "exposure_notifications"; +ESPHOME_LOG_TAG(TAG, "exposure_notifications"); bool ExposureNotificationTrigger::parse_device(const ESPBTDevice &device) { // See also https://blog.google/documents/70/Exposure_Notification_-_Bluetooth_Specification_v1.2.2.pdf diff --git a/esphome/components/ezo_pmp/ezo_pmp.cpp b/esphome/components/ezo_pmp/ezo_pmp.cpp index 21307fcd7a..8db57670ae 100644 --- a/esphome/components/ezo_pmp/ezo_pmp.cpp +++ b/esphome/components/ezo_pmp/ezo_pmp.cpp @@ -4,7 +4,7 @@ namespace esphome::ezo_pmp { -static const char *const TAG = "ezo-pmp"; +ESPHOME_LOG_TAG(TAG, "ezo-pmp"); static const uint16_t EZO_PMP_COMMAND_NONE = 0; static const uint16_t EZO_PMP_COMMAND_TYPE_READ = 1; diff --git a/esphome/components/factory_reset/button/factory_reset_button.cpp b/esphome/components/factory_reset/button/factory_reset_button.cpp index efce998d9d..8ef7dc67eb 100644 --- a/esphome/components/factory_reset/button/factory_reset_button.cpp +++ b/esphome/components/factory_reset/button/factory_reset_button.cpp @@ -11,7 +11,7 @@ namespace esphome::factory_reset { -static const char *const TAG = "factory_reset.button"; +ESPHOME_LOG_TAG(TAG, "factory_reset.button"); void FactoryResetButton::dump_config() { LOG_BUTTON("", "Factory Reset Button", this); } void FactoryResetButton::press_action() { diff --git a/esphome/components/factory_reset/factory_reset.cpp b/esphome/components/factory_reset/factory_reset.cpp index bceaf6e40f..1de2e3f532 100644 --- a/esphome/components/factory_reset/factory_reset.cpp +++ b/esphome/components/factory_reset/factory_reset.cpp @@ -11,7 +11,7 @@ namespace esphome::factory_reset { -static const char *const TAG = "factory_reset"; +ESPHOME_LOG_TAG(TAG, "factory_reset"); static const uint32_t POWER_CYCLES_KEY = 0xFA5C0DE; static bool was_power_cycled() { diff --git a/esphome/components/factory_reset/switch/factory_reset_switch.cpp b/esphome/components/factory_reset/switch/factory_reset_switch.cpp index 65404a35d5..5f38a44654 100644 --- a/esphome/components/factory_reset/switch/factory_reset_switch.cpp +++ b/esphome/components/factory_reset/switch/factory_reset_switch.cpp @@ -11,7 +11,7 @@ namespace esphome::factory_reset { -static const char *const TAG = "factory_reset.switch"; +ESPHOME_LOG_TAG(TAG, "factory_reset.switch"); void FactoryResetSwitch::dump_config() { LOG_SWITCH("", "Factory Reset Switch", this); } void FactoryResetSwitch::write_state(bool state) { diff --git a/esphome/components/fan/fan.cpp b/esphome/components/fan/fan.cpp index 65521e63d5..866f5eb0cd 100644 --- a/esphome/components/fan/fan.cpp +++ b/esphome/components/fan/fan.cpp @@ -6,7 +6,7 @@ namespace esphome::fan { -static const char *const TAG = "fan"; +ESPHOME_LOG_TAG(TAG, "fan"); // Compat: shared empty vector for getter when no preset modes are set. // Remove in 2026.11.0 when deprecated FanTraits setters are removed diff --git a/esphome/components/fastled_base/fastled_light.cpp b/esphome/components/fastled_base/fastled_light.cpp index da4dbf2ed7..38c594a7c7 100644 --- a/esphome/components/fastled_base/fastled_light.cpp +++ b/esphome/components/fastled_base/fastled_light.cpp @@ -5,7 +5,7 @@ namespace esphome::fastled_base { -static const char *const TAG = "fastled"; +ESPHOME_LOG_TAG(TAG, "fastled"); void FastLEDLightOutput::setup() { this->controller_->init(); diff --git a/esphome/components/feedback/feedback_cover.cpp b/esphome/components/feedback/feedback_cover.cpp index 4baffc74f8..fb6c3929b0 100644 --- a/esphome/components/feedback/feedback_cover.cpp +++ b/esphome/components/feedback/feedback_cover.cpp @@ -5,7 +5,7 @@ namespace esphome::feedback { -static const char *const TAG = "feedback.cover"; +ESPHOME_LOG_TAG(TAG, "feedback.cover"); static constexpr uint32_t DIRECTION_CHANGE_TIMEOUT_ID = 1; diff --git a/esphome/components/fingerprint_grow/fingerprint_grow.cpp b/esphome/components/fingerprint_grow/fingerprint_grow.cpp index 07630f121a..99e88af5b7 100644 --- a/esphome/components/fingerprint_grow/fingerprint_grow.cpp +++ b/esphome/components/fingerprint_grow/fingerprint_grow.cpp @@ -5,7 +5,7 @@ namespace esphome::fingerprint_grow { -static const char *const TAG = "fingerprint_grow"; +ESPHOME_LOG_TAG(TAG, "fingerprint_grow"); // Based on Adafruit's library: https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library diff --git a/esphome/components/font/font.cpp b/esphome/components/font/font.cpp index 2592370b6a..8f7ad6e71f 100644 --- a/esphome/components/font/font.cpp +++ b/esphome/components/font/font.cpp @@ -6,7 +6,7 @@ #include "esphome/components/unicode/unicode.h" namespace esphome::font { -static const char *const TAG = "font"; +ESPHOME_LOG_TAG(TAG, "font"); #ifdef USE_LVGL_FONT static const uint8_t OPA4_TABLE[16] = {0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255}; diff --git a/esphome/components/fs3000/fs3000.cpp b/esphome/components/fs3000/fs3000.cpp index a89b166182..81d6647642 100644 --- a/esphome/components/fs3000/fs3000.cpp +++ b/esphome/components/fs3000/fs3000.cpp @@ -3,7 +3,7 @@ namespace esphome::fs3000 { -static const char *const TAG = "fs3000"; +ESPHOME_LOG_TAG(TAG, "fs3000"); void FS3000Component::setup() { if (model_ == FIVE) { diff --git a/esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.cpp b/esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.cpp index 24d3529fb4..ac5f4d8933 100644 --- a/esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.cpp +++ b/esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.cpp @@ -5,7 +5,7 @@ namespace esphome::ft5x06 { -static const char *const TAG = "ft5x06.touchscreen"; +ESPHOME_LOG_TAG(TAG, "ft5x06.touchscreen"); void FT5x06Touchscreen::setup() { if (this->interrupt_pin_ != nullptr) { diff --git a/esphome/components/ft63x6/ft63x6.cpp b/esphome/components/ft63x6/ft63x6.cpp index dd8f5ba629..85729c17f6 100644 --- a/esphome/components/ft63x6/ft63x6.cpp +++ b/esphome/components/ft63x6/ft63x6.cpp @@ -25,7 +25,7 @@ static const uint8_t FT6X36_ADDR_THRESHHOLD = 0x80; static const uint8_t FT6X36_ADDR_TOUCHRATE_ACTIVE = 0x88; static const uint8_t FT63X6_ADDR_CHIP_ID = 0xA3; -static const char *const TAG = "FT63X6"; +ESPHOME_LOG_TAG(TAG, "FT63X6"); void FT63X6Touchscreen::setup() { if (this->interrupt_pin_ != nullptr) { diff --git a/esphome/components/fujitsu_general/fujitsu_general.cpp b/esphome/components/fujitsu_general/fujitsu_general.cpp index 9995a3abbd..9a928dac01 100644 --- a/esphome/components/fujitsu_general/fujitsu_general.cpp +++ b/esphome/components/fujitsu_general/fujitsu_general.cpp @@ -2,7 +2,7 @@ namespace esphome::fujitsu_general { -static const char *const TAG = "fujitsu_general.climate"; +ESPHOME_LOG_TAG(TAG, "fujitsu_general.climate"); // Common header constexpr uint8_t FUJITSU_GENERAL_COMMON_LENGTH = 6; diff --git a/esphome/components/gcja5/gcja5.cpp b/esphome/components/gcja5/gcja5.cpp index e84c51bde8..fcb9e832ea 100644 --- a/esphome/components/gcja5/gcja5.cpp +++ b/esphome/components/gcja5/gcja5.cpp @@ -11,7 +11,7 @@ namespace esphome::gcja5 { -static const char *const TAG = "gcja5"; +ESPHOME_LOG_TAG(TAG, "gcja5"); void GCJA5Component::loop() { const uint32_t now = App.get_loop_component_start_time(); diff --git a/esphome/components/gdk101/gdk101.cpp b/esphome/components/gdk101/gdk101.cpp index bc0ef70578..3c7e8d2161 100644 --- a/esphome/components/gdk101/gdk101.cpp +++ b/esphome/components/gdk101/gdk101.cpp @@ -4,7 +4,7 @@ namespace esphome::gdk101 { -static const char *const TAG = "gdk101"; +ESPHOME_LOG_TAG(TAG, "gdk101"); static constexpr uint8_t NUMBER_OF_READ_RETRIES = 5; static constexpr uint8_t NUMBER_OF_RESET_RETRIES = 30; static constexpr uint32_t RESET_INTERVAL_ID = 0; diff --git a/esphome/components/gl_r01_i2c/gl_r01_i2c.cpp b/esphome/components/gl_r01_i2c/gl_r01_i2c.cpp index 75f0c69a7b..6e2844eb9e 100644 --- a/esphome/components/gl_r01_i2c/gl_r01_i2c.cpp +++ b/esphome/components/gl_r01_i2c/gl_r01_i2c.cpp @@ -4,7 +4,7 @@ namespace esphome::gl_r01_i2c { -static const char *const TAG = "gl_r01_i2c"; +ESPHOME_LOG_TAG(TAG, "gl_r01_i2c"); // Register definitions from datasheet static const uint8_t REG_VERSION = 0x00; diff --git a/esphome/components/gp2y1010au0f/gp2y1010au0f.cpp b/esphome/components/gp2y1010au0f/gp2y1010au0f.cpp index 0dd4a13a21..552261155f 100644 --- a/esphome/components/gp2y1010au0f/gp2y1010au0f.cpp +++ b/esphome/components/gp2y1010au0f/gp2y1010au0f.cpp @@ -6,7 +6,7 @@ namespace esphome::gp2y1010au0f { -static const char *const TAG = "gp2y1010au0f"; +ESPHOME_LOG_TAG(TAG, "gp2y1010au0f"); static const float MIN_VOLTAGE = 0.0f; static const float MAX_VOLTAGE = 4.0f; diff --git a/esphome/components/gp8403/gp8403.cpp b/esphome/components/gp8403/gp8403.cpp index 7e93bb6295..b82c32c053 100644 --- a/esphome/components/gp8403/gp8403.cpp +++ b/esphome/components/gp8403/gp8403.cpp @@ -4,7 +4,7 @@ namespace esphome::gp8403 { -static const char *const TAG = "gp8403"; +ESPHOME_LOG_TAG(TAG, "gp8403"); static const uint8_t RANGE_REGISTER = 0x01; static const uint8_t OUTPUT_REGISTER = 0x02; diff --git a/esphome/components/gp8403/output/gp8403_output.cpp b/esphome/components/gp8403/output/gp8403_output.cpp index 7a22a280ac..92872f72f2 100644 --- a/esphome/components/gp8403/output/gp8403_output.cpp +++ b/esphome/components/gp8403/output/gp8403_output.cpp @@ -4,7 +4,7 @@ namespace esphome::gp8403 { -static const char *const TAG = "gp8403.output"; +ESPHOME_LOG_TAG(TAG, "gp8403.output"); void GP8403Output::dump_config() { ESP_LOGCONFIG(TAG, diff --git a/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp b/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp index 9d044dca2d..87985f189c 100644 --- a/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp +++ b/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::gpio { -static const char *const TAG = "gpio.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "gpio.binary_sensor"); #if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_DEBUG #ifdef USE_GPIO_BINARY_SENSOR_INTERRUPT diff --git a/esphome/components/gpio/one_wire/gpio_one_wire.cpp b/esphome/components/gpio/one_wire/gpio_one_wire.cpp index f445efeca3..62b197d13c 100644 --- a/esphome/components/gpio/one_wire/gpio_one_wire.cpp +++ b/esphome/components/gpio/one_wire/gpio_one_wire.cpp @@ -4,7 +4,7 @@ namespace esphome::gpio { -static const char *const TAG = "gpio.one_wire"; +ESPHOME_LOG_TAG(TAG, "gpio.one_wire"); void GPIOOneWireBus::setup() { this->t_pin_->setup(); diff --git a/esphome/components/gpio/output/gpio_binary_output.cpp b/esphome/components/gpio/output/gpio_binary_output.cpp index 402ad03c49..b407ea3f4b 100644 --- a/esphome/components/gpio/output/gpio_binary_output.cpp +++ b/esphome/components/gpio/output/gpio_binary_output.cpp @@ -3,7 +3,7 @@ namespace esphome::gpio { -static const char *const TAG = "gpio.output"; +ESPHOME_LOG_TAG(TAG, "gpio.output"); void GPIOBinaryOutput::dump_config() { ESP_LOGCONFIG(TAG, "Binary Output:"); diff --git a/esphome/components/gpio/switch/gpio_switch.cpp b/esphome/components/gpio/switch/gpio_switch.cpp index d231b3d77a..4daea8d877 100644 --- a/esphome/components/gpio/switch/gpio_switch.cpp +++ b/esphome/components/gpio/switch/gpio_switch.cpp @@ -3,7 +3,7 @@ namespace esphome::gpio { -static const char *const TAG = "switch.gpio"; +ESPHOME_LOG_TAG(TAG, "switch.gpio"); #ifdef USE_GPIO_SWITCH_INTERLOCK static constexpr uint32_t INTERLOCK_TIMEOUT_ID = 0; #endif diff --git a/esphome/components/gps/gps.cpp b/esphome/components/gps/gps.cpp index 4b8abd219b..ec54ac9748 100644 --- a/esphome/components/gps/gps.cpp +++ b/esphome/components/gps/gps.cpp @@ -3,7 +3,7 @@ namespace esphome::gps { -static const char *const TAG = "gps"; +ESPHOME_LOG_TAG(TAG, "gps"); TinyGPSPlus &GPSListener::get_tiny_gps() { return this->parent_->get_tiny_gps(); } diff --git a/esphome/components/gps/time/gps_time.cpp b/esphome/components/gps/time/gps_time.cpp index 3859983ceb..958d0645d9 100644 --- a/esphome/components/gps/time/gps_time.cpp +++ b/esphome/components/gps/time/gps_time.cpp @@ -3,7 +3,7 @@ namespace esphome::gps { -static const char *const TAG = "gps.time"; +ESPHOME_LOG_TAG(TAG, "gps.time"); void GPSTime::from_tiny_gps_(TinyGPSPlus &tiny_gps) { if (!tiny_gps.time.isValid() || !tiny_gps.date.isValid() || !tiny_gps.time.isUpdated() || diff --git a/esphome/components/graph/graph.cpp b/esphome/components/graph/graph.cpp index 9ceb2f2ba0..e09eb385e3 100644 --- a/esphome/components/graph/graph.cpp +++ b/esphome/components/graph/graph.cpp @@ -9,8 +9,8 @@ namespace esphome::graph { using namespace display; -static const char *const TAG = "graph"; -static const char *const TAGL = "graphlegend"; +ESPHOME_LOG_TAG(TAG, "graph"); +ESPHOME_LOG_TAG(TAGL, "graphlegend"); void HistoryData::init(int length) { this->length_ = length; diff --git a/esphome/components/graphical_display_menu/graphical_display_menu.cpp b/esphome/components/graphical_display_menu/graphical_display_menu.cpp index d261c48855..8761e5fb4c 100644 --- a/esphome/components/graphical_display_menu/graphical_display_menu.cpp +++ b/esphome/components/graphical_display_menu/graphical_display_menu.cpp @@ -7,7 +7,7 @@ namespace esphome::graphical_display_menu { -static const char *const TAG = "graphical_display_menu"; +ESPHOME_LOG_TAG(TAG, "graphical_display_menu"); void GraphicalDisplayMenu::setup() { if (this->display_ != nullptr) { diff --git a/esphome/components/gree/gree.cpp b/esphome/components/gree/gree.cpp index e59f186521..f47be4aea0 100644 --- a/esphome/components/gree/gree.cpp +++ b/esphome/components/gree/gree.cpp @@ -3,7 +3,7 @@ namespace esphome::gree { -static const char *const TAG = "gree.climate"; +ESPHOME_LOG_TAG(TAG, "gree.climate"); void GreeClimate::set_model(Model model) { if (model == GREE_YAN) { diff --git a/esphome/components/gree/switch/gree_switch.cpp b/esphome/components/gree/switch/gree_switch.cpp index 2f649733af..0d8f769580 100644 --- a/esphome/components/gree/switch/gree_switch.cpp +++ b/esphome/components/gree/switch/gree_switch.cpp @@ -3,7 +3,7 @@ namespace esphome::gree { -static const char *const TAG = "gree.switch"; +ESPHOME_LOG_TAG(TAG, "gree.switch"); void GreeModeBitSwitch::setup() { auto initial = this->get_initial_state_with_restore_mode(); diff --git a/esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp b/esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp index 0de0b02182..b01dd119e6 100644 --- a/esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp +++ b/esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp @@ -4,7 +4,7 @@ namespace esphome::grove_gas_mc_v2 { -static const char *const TAG = "grove_gas_mc_v2"; +ESPHOME_LOG_TAG(TAG, "grove_gas_mc_v2"); // I2C Commands for Grove Gas Multichannel V2 Sensor // Taken from: diff --git a/esphome/components/grove_tb6612fng/grove_tb6612fng.cpp b/esphome/components/grove_tb6612fng/grove_tb6612fng.cpp index 2c68eef623..80de3451d7 100644 --- a/esphome/components/grove_tb6612fng/grove_tb6612fng.cpp +++ b/esphome/components/grove_tb6612fng/grove_tb6612fng.cpp @@ -4,7 +4,7 @@ namespace esphome::grove_tb6612fng { -static const char *const TAG = "GroveMotorDriveTB6612FNG"; +ESPHOME_LOG_TAG(TAG, "GroveMotorDriveTB6612FNG"); static const uint8_t GROVE_MOTOR_DRIVER_I2C_CMD_BRAKE = 0x00; static const uint8_t GROVE_MOTOR_DRIVER_I2C_CMD_STOP = 0x01; diff --git a/esphome/components/growatt_solar/growatt_solar.cpp b/esphome/components/growatt_solar/growatt_solar.cpp index 08c3966ed9..5c079b42d9 100644 --- a/esphome/components/growatt_solar/growatt_solar.cpp +++ b/esphome/components/growatt_solar/growatt_solar.cpp @@ -5,7 +5,7 @@ namespace esphome::growatt_solar { namespace helpers = modbus::helpers; -static const char *const TAG = "growatt_solar"; +ESPHOME_LOG_TAG(TAG, "growatt_solar"); static const uint8_t MODBUS_REGISTER_COUNT[] = {33, 95}; // indexed with enum GrowattProtocolVersion diff --git a/esphome/components/gsl3670/gsl3670_touchscreen.cpp b/esphome/components/gsl3670/gsl3670_touchscreen.cpp index 9115130f4a..e518368071 100644 --- a/esphome/components/gsl3670/gsl3670_touchscreen.cpp +++ b/esphome/components/gsl3670/gsl3670_touchscreen.cpp @@ -4,7 +4,7 @@ namespace esphome::gsl3670 { -static const char *const TAG = "gsl3670.touchscreen"; +ESPHOME_LOG_TAG(TAG, "gsl3670.touchscreen"); static const size_t MAX_TOUCHES = 3; // --------------------------------------------------------------------------- // setup() – mirrors esp_lcd_touch_gsl3670_init() in the Seeed BSP: diff --git a/esphome/components/gt911/binary_sensor/gt911_button.cpp b/esphome/components/gt911/binary_sensor/gt911_button.cpp index 7b356f3946..2a3fc631d6 100644 --- a/esphome/components/gt911/binary_sensor/gt911_button.cpp +++ b/esphome/components/gt911/binary_sensor/gt911_button.cpp @@ -3,7 +3,7 @@ namespace esphome::gt911 { -static const char *const TAG = "GT911.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "GT911.binary_sensor"); void GT911Button::setup() { this->parent_->register_button_listener(this); diff --git a/esphome/components/gt911/touchscreen/gt911_touchscreen.cpp b/esphome/components/gt911/touchscreen/gt911_touchscreen.cpp index 8ced267947..07dd325a2c 100644 --- a/esphome/components/gt911/touchscreen/gt911_touchscreen.cpp +++ b/esphome/components/gt911/touchscreen/gt911_touchscreen.cpp @@ -6,7 +6,7 @@ namespace esphome::gt911 { -static const char *const TAG = "gt911.touchscreen"; +ESPHOME_LOG_TAG(TAG, "gt911.touchscreen"); static const uint8_t PRIMARY_ADDRESS = 0x5D; // default I2C address for GT911 static const uint8_t SECONDARY_ADDRESS = 0x14; // secondary I2C address for GT911 diff --git a/esphome/components/haier/haier_base.cpp b/esphome/components/haier/haier_base.cpp index 87f9331d55..65a3ed2616 100644 --- a/esphome/components/haier/haier_base.cpp +++ b/esphome/components/haier/haier_base.cpp @@ -12,7 +12,7 @@ using namespace esphome::uart; namespace esphome::haier { -static const char *const TAG = "haier.climate"; +ESPHOME_LOG_TAG(TAG, "haier.climate"); constexpr size_t COMMUNICATION_TIMEOUT_MS = 60000; constexpr size_t STATUS_REQUEST_INTERVAL_MS = 5000; constexpr size_t PROTOCOL_INITIALIZATION_INTERVAL = 10000; diff --git a/esphome/components/haier/hon_climate.cpp b/esphome/components/haier/hon_climate.cpp index 0ce4142fd4..5e672c3e65 100644 --- a/esphome/components/haier/hon_climate.cpp +++ b/esphome/components/haier/hon_climate.cpp @@ -11,7 +11,7 @@ using namespace esphome::uart; namespace esphome::haier { -static const char *const TAG = "haier.climate"; +ESPHOME_LOG_TAG(TAG, "haier.climate"); constexpr size_t SIGNAL_LEVEL_UPDATE_INTERVAL_MS = 10000; constexpr int PROTOCOL_OUTDOOR_TEMPERATURE_OFFSET = -64; constexpr uint8_t CONTROL_MESSAGE_RETRIES = 5; diff --git a/esphome/components/haier/smartair2_climate.cpp b/esphome/components/haier/smartair2_climate.cpp index fdb3b779e2..01e1cbaeed 100644 --- a/esphome/components/haier/smartair2_climate.cpp +++ b/esphome/components/haier/smartair2_climate.cpp @@ -9,7 +9,7 @@ using namespace esphome::uart; namespace esphome::haier { -static const char *const TAG = "haier.climate"; +ESPHOME_LOG_TAG(TAG, "haier.climate"); constexpr size_t SIGNAL_LEVEL_UPDATE_INTERVAL_MS = 10000; constexpr uint8_t CONTROL_MESSAGE_RETRIES = 5; constexpr std::chrono::milliseconds CONTROL_MESSAGE_RETRIES_INTERVAL = std::chrono::milliseconds(500); diff --git a/esphome/components/havells_solar/havells_solar.cpp b/esphome/components/havells_solar/havells_solar.cpp index d43dfbb89a..6abca8c2dd 100644 --- a/esphome/components/havells_solar/havells_solar.cpp +++ b/esphome/components/havells_solar/havells_solar.cpp @@ -6,7 +6,7 @@ namespace esphome::havells_solar { namespace helpers = modbus::helpers; -static const char *const TAG = "havells_solar"; +ESPHOME_LOG_TAG(TAG, "havells_solar"); static const uint8_t MODBUS_REGISTER_COUNT = 48; // 48 x 16-bit registers diff --git a/esphome/components/hbridge/fan/hbridge_fan.cpp b/esphome/components/hbridge/fan/hbridge_fan.cpp index fc2a738e8d..311f82b850 100644 --- a/esphome/components/hbridge/fan/hbridge_fan.cpp +++ b/esphome/components/hbridge/fan/hbridge_fan.cpp @@ -3,7 +3,7 @@ namespace esphome::hbridge { -static const char *const TAG = "fan.hbridge"; +ESPHOME_LOG_TAG(TAG, "fan.hbridge"); void HBridgeFan::set_hbridge_levels_(float a_level, float b_level) { this->pin_a_->set_level(a_level); diff --git a/esphome/components/hbridge/switch/hbridge_switch.cpp b/esphome/components/hbridge/switch/hbridge_switch.cpp index c8e472d7aa..837c355f46 100644 --- a/esphome/components/hbridge/switch/hbridge_switch.cpp +++ b/esphome/components/hbridge/switch/hbridge_switch.cpp @@ -5,7 +5,7 @@ namespace esphome::hbridge { -static const char *const TAG = "switch.hbridge"; +ESPHOME_LOG_TAG(TAG, "switch.hbridge"); float HBridgeSwitch::get_setup_priority() const { return setup_priority::HARDWARE; } void HBridgeSwitch::setup() { diff --git a/esphome/components/hc8/hc8.cpp b/esphome/components/hc8/hc8.cpp index 6a19f977a6..4fbfbc84d7 100644 --- a/esphome/components/hc8/hc8.cpp +++ b/esphome/components/hc8/hc8.cpp @@ -7,7 +7,7 @@ namespace esphome::hc8 { -static const char *const TAG = "hc8"; +ESPHOME_LOG_TAG(TAG, "hc8"); static const std::array HC8_COMMAND_GET_PPM{0x64, 0x69, 0x03, 0x5E, 0x4E}; static const std::array HC8_COMMAND_CALIBRATE_PREAMBLE{0x11, 0x03, 0x03}; diff --git a/esphome/components/hdc1080/hdc1080.cpp b/esphome/components/hdc1080/hdc1080.cpp index 6692345e62..be0de1bae6 100644 --- a/esphome/components/hdc1080/hdc1080.cpp +++ b/esphome/components/hdc1080/hdc1080.cpp @@ -4,7 +4,7 @@ namespace esphome::hdc1080 { -static const char *const TAG = "hdc1080"; +ESPHOME_LOG_TAG(TAG, "hdc1080"); static const uint8_t HDC1080_CMD_CONFIGURATION = 0x02; static const uint8_t HDC1080_CMD_TEMPERATURE = 0x00; diff --git a/esphome/components/hdc2010/hdc2010.cpp b/esphome/components/hdc2010/hdc2010.cpp index 946cf4898f..825d7d3da9 100644 --- a/esphome/components/hdc2010/hdc2010.cpp +++ b/esphome/components/hdc2010/hdc2010.cpp @@ -5,7 +5,7 @@ namespace esphome::hdc2010 { -static const char *const TAG = "hdc2010"; +ESPHOME_LOG_TAG(TAG, "hdc2010"); // Register addresses static constexpr uint8_t REG_TEMPERATURE_LOW = 0x00; diff --git a/esphome/components/hdc2080/hdc2080.cpp b/esphome/components/hdc2080/hdc2080.cpp index bf3a4bc79f..8210733b4c 100644 --- a/esphome/components/hdc2080/hdc2080.cpp +++ b/esphome/components/hdc2080/hdc2080.cpp @@ -4,7 +4,7 @@ namespace esphome::hdc2080 { -static const char *const TAG = "hdc2080"; +ESPHOME_LOG_TAG(TAG, "hdc2080"); // Register map (Table 8-6) static constexpr uint8_t REG_TEMPERATURE_LOW = 0x00; // Temperature [7:0] diff --git a/esphome/components/hdc302x/hdc302x.cpp b/esphome/components/hdc302x/hdc302x.cpp index 53d4c7f016..b45b3b612f 100644 --- a/esphome/components/hdc302x/hdc302x.cpp +++ b/esphome/components/hdc302x/hdc302x.cpp @@ -6,7 +6,7 @@ namespace esphome::hdc302x { -static const char *const TAG = "hdc302x.sensor"; +ESPHOME_LOG_TAG(TAG, "hdc302x.sensor"); // Commands (per datasheet Table 7-4) static const uint8_t HDC302X_CMD_SOFT_RESET[2] = {0x30, 0xa2}; diff --git a/esphome/components/he60r/he60r.cpp b/esphome/components/he60r/he60r.cpp index 008505e2bb..7c67c5ffd3 100644 --- a/esphome/components/he60r/he60r.cpp +++ b/esphome/components/he60r/he60r.cpp @@ -6,7 +6,7 @@ namespace esphome::he60r { -static const char *const TAG = "he60r.cover"; +ESPHOME_LOG_TAG(TAG, "he60r.cover"); static const uint8_t QUERY_BYTE = 0x38; static const uint8_t TOGGLE_BYTE = 0x30; diff --git a/esphome/components/heatpumpir/heatpumpir.cpp b/esphome/components/heatpumpir/heatpumpir.cpp index 502f83cd5d..eb23eb8ed5 100644 --- a/esphome/components/heatpumpir/heatpumpir.cpp +++ b/esphome/components/heatpumpir/heatpumpir.cpp @@ -41,7 +41,7 @@ class IRSenderESPHome : public IRSender { remote_base::RemoteTransmitterBase::TransmitCall transmit_; }; -static const char *const TAG = "heatpumpir.climate"; +ESPHOME_LOG_TAG(TAG, "heatpumpir.climate"); const std::map> PROTOCOL_CONSTRUCTOR_MAP = { {PROTOCOL_AUX, []() { return new AUXHeatpumpIR(); }}, // NOLINT diff --git a/esphome/components/hitachi_ac344/hitachi_ac344.cpp b/esphome/components/hitachi_ac344/hitachi_ac344.cpp index ea211a7a59..c712500a53 100644 --- a/esphome/components/hitachi_ac344/hitachi_ac344.cpp +++ b/esphome/components/hitachi_ac344/hitachi_ac344.cpp @@ -2,7 +2,7 @@ namespace esphome::hitachi_ac344 { -static const char *const TAG = "climate.hitachi_ac344"; +ESPHOME_LOG_TAG(TAG, "climate.hitachi_ac344"); void set_bits(uint8_t *const dst, const uint8_t offset, const uint8_t nbits, const uint8_t data) { if (offset >= 8 || !nbits) diff --git a/esphome/components/hitachi_ac424/hitachi_ac424.cpp b/esphome/components/hitachi_ac424/hitachi_ac424.cpp index cdf8dda22c..d8f7f66179 100644 --- a/esphome/components/hitachi_ac424/hitachi_ac424.cpp +++ b/esphome/components/hitachi_ac424/hitachi_ac424.cpp @@ -2,7 +2,7 @@ namespace esphome::hitachi_ac424 { -static const char *const TAG = "climate.hitachi_ac424"; +ESPHOME_LOG_TAG(TAG, "climate.hitachi_ac424"); void set_bits(uint8_t *const dst, const uint8_t offset, const uint8_t nbits, const uint8_t data) { if (offset >= 8 || !nbits) diff --git a/esphome/components/hlk_fm22x/hlk_fm22x.cpp b/esphome/components/hlk_fm22x/hlk_fm22x.cpp index a924259802..e4845daa57 100644 --- a/esphome/components/hlk_fm22x/hlk_fm22x.cpp +++ b/esphome/components/hlk_fm22x/hlk_fm22x.cpp @@ -5,7 +5,7 @@ namespace esphome::hlk_fm22x { -static const char *const TAG = "hlk_fm22x"; +ESPHOME_LOG_TAG(TAG, "hlk_fm22x"); static constexpr uint32_t PAYLOAD_TIMEOUT_MS = 20; void HlkFm22xComponent::setup() { diff --git a/esphome/components/hlw8012/hlw8012.cpp b/esphome/components/hlw8012/hlw8012.cpp index 9ef81f075d..a14a9aaf48 100644 --- a/esphome/components/hlw8012/hlw8012.cpp +++ b/esphome/components/hlw8012/hlw8012.cpp @@ -3,7 +3,7 @@ namespace esphome::hlw8012 { -static const char *const TAG = "hlw8012"; +ESPHOME_LOG_TAG(TAG, "hlw8012"); // valid for HLW8012 and CSE7759 static const uint32_t HLW8012_CLOCK_FREQUENCY = 3579000; diff --git a/esphome/components/hlw8032/hlw8032.cpp b/esphome/components/hlw8032/hlw8032.cpp index 55e6664a8b..cbb6b6c628 100644 --- a/esphome/components/hlw8032/hlw8032.cpp +++ b/esphome/components/hlw8032/hlw8032.cpp @@ -4,7 +4,7 @@ namespace esphome::hlw8032 { -static const char *const TAG = "hlw8032"; +ESPHOME_LOG_TAG(TAG, "hlw8032"); static constexpr uint8_t STATE_REG_OFFSET = 0; static constexpr uint8_t VOLTAGE_PARAM_OFFSET = 2; diff --git a/esphome/components/hm3301/hm3301.cpp b/esphome/components/hm3301/hm3301.cpp index 02c6e75146..bfed99b21b 100644 --- a/esphome/components/hm3301/hm3301.cpp +++ b/esphome/components/hm3301/hm3301.cpp @@ -3,7 +3,7 @@ namespace esphome::hm3301 { -static const char *const TAG = "hm3301.sensor"; +ESPHOME_LOG_TAG(TAG, "hm3301.sensor"); static const uint8_t PM_1_0_VALUE_INDEX = 5; static const uint8_t PM_2_5_VALUE_INDEX = 6; diff --git a/esphome/components/hmc5883l/hmc5883l.cpp b/esphome/components/hmc5883l/hmc5883l.cpp index c6b7da6610..c747e7968e 100644 --- a/esphome/components/hmc5883l/hmc5883l.cpp +++ b/esphome/components/hmc5883l/hmc5883l.cpp @@ -6,7 +6,7 @@ namespace esphome::hmc5883l { -static const char *const TAG = "hmc5883l"; +ESPHOME_LOG_TAG(TAG, "hmc5883l"); static const uint8_t HMC5883L_ADDRESS = 0x1E; static const uint8_t HMC5883L_REGISTER_CONFIG_A = 0x00; static const uint8_t HMC5883L_REGISTER_CONFIG_B = 0x01; diff --git a/esphome/components/hoermann_hcp/binary_sensor/hoermann_hcp_binary_sensor.cpp b/esphome/components/hoermann_hcp/binary_sensor/hoermann_hcp_binary_sensor.cpp index edce6ce4c2..db32eb2952 100644 --- a/esphome/components/hoermann_hcp/binary_sensor/hoermann_hcp_binary_sensor.cpp +++ b/esphome/components/hoermann_hcp/binary_sensor/hoermann_hcp_binary_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::hoermann_hcp { -static const char *const TAG = "hoermann_hcp.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "hoermann_hcp.binary_sensor"); void HoermannHcpConnectedBinarySensor::setup() { // Publishing unconditionally is deliberate: the base class dedupes, and filters need every input to drive diff --git a/esphome/components/hoermann_hcp/cover/hoermann_hcp_cover.cpp b/esphome/components/hoermann_hcp/cover/hoermann_hcp_cover.cpp index 66a141758e..ab2afc74d9 100644 --- a/esphome/components/hoermann_hcp/cover/hoermann_hcp_cover.cpp +++ b/esphome/components/hoermann_hcp/cover/hoermann_hcp_cover.cpp @@ -4,7 +4,7 @@ namespace esphome::hoermann_hcp { -static const char *const TAG = "hoermann_hcp.cover"; +ESPHOME_LOG_TAG(TAG, "hoermann_hcp.cover"); cover::CoverTraits HoermannHcpCover::get_traits() { cover::CoverTraits traits; diff --git a/esphome/components/hoermann_hcp/hoermann_hcp.cpp b/esphome/components/hoermann_hcp/hoermann_hcp.cpp index 22f0c12c8c..bbf1380d17 100644 --- a/esphome/components/hoermann_hcp/hoermann_hcp.cpp +++ b/esphome/components/hoermann_hcp/hoermann_hcp.cpp @@ -9,7 +9,7 @@ namespace esphome::hoermann_hcp { -static const char *const TAG = "hoermann_hcp"; +ESPHOME_LOG_TAG(TAG, "hoermann_hcp"); // Hoermann HCP holding-register blocks. static constexpr uint16_t COMMAND_REG = 0x9C41; // Commands written by the bus controller diff --git a/esphome/components/hoermann_hcp/light/hoermann_hcp_light.cpp b/esphome/components/hoermann_hcp/light/hoermann_hcp_light.cpp index f7e40b8921..6195c5d63d 100644 --- a/esphome/components/hoermann_hcp/light/hoermann_hcp_light.cpp +++ b/esphome/components/hoermann_hcp/light/hoermann_hcp_light.cpp @@ -4,7 +4,7 @@ namespace esphome::hoermann_hcp { -static const char *const TAG = "hoermann_hcp.light"; +ESPHOME_LOG_TAG(TAG, "hoermann_hcp.light"); light::LightTraits HoermannHcpLight::get_traits() { auto traits = light::LightTraits(); diff --git a/esphome/components/hoermann_hcp/text_sensor/hoermann_hcp_text_sensor.cpp b/esphome/components/hoermann_hcp/text_sensor/hoermann_hcp_text_sensor.cpp index 765a80ae6f..cc8d15d723 100644 --- a/esphome/components/hoermann_hcp/text_sensor/hoermann_hcp_text_sensor.cpp +++ b/esphome/components/hoermann_hcp/text_sensor/hoermann_hcp_text_sensor.cpp @@ -7,7 +7,7 @@ namespace esphome::hoermann_hcp { -static const char *const TAG = "hoermann_hcp.text_sensor"; +ESPHOME_LOG_TAG(TAG, "hoermann_hcp.text_sensor"); // Indexed by DoorState. Each fits the 15 characters std::string keeps inline, so publishing never allocates. PROGMEM_STRING_TABLE(DoorStateStrings, "Open", "Opening", "Closed", "Closing", "Half open", "Moving to vent", diff --git a/esphome/components/homeassistant/binary_sensor/homeassistant_binary_sensor.cpp b/esphome/components/homeassistant/binary_sensor/homeassistant_binary_sensor.cpp index 735fb9f5da..d14158399c 100644 --- a/esphome/components/homeassistant/binary_sensor/homeassistant_binary_sensor.cpp +++ b/esphome/components/homeassistant/binary_sensor/homeassistant_binary_sensor.cpp @@ -5,7 +5,7 @@ namespace esphome::homeassistant { -static const char *const TAG = "homeassistant.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "homeassistant.binary_sensor"); void HomeassistantBinarySensor::setup() { api::global_api_server->subscribe_home_assistant_state(this->entity_id_, this->attribute_, [this](StringRef state) { diff --git a/esphome/components/homeassistant/button/homeassistant_button.cpp b/esphome/components/homeassistant/button/homeassistant_button.cpp index 87280c2b5b..6cf1c87eaa 100644 --- a/esphome/components/homeassistant/button/homeassistant_button.cpp +++ b/esphome/components/homeassistant/button/homeassistant_button.cpp @@ -9,7 +9,7 @@ namespace esphome::homeassistant { -static const char *const TAG = "homeassistant.button"; +ESPHOME_LOG_TAG(TAG, "homeassistant.button"); void HomeassistantButton::dump_config() { LOG_BUTTON("", "Homeassistant Button", this); diff --git a/esphome/components/homeassistant/number/homeassistant_number.cpp b/esphome/components/homeassistant/number/homeassistant_number.cpp index e8a679e91c..df92aad38e 100644 --- a/esphome/components/homeassistant/number/homeassistant_number.cpp +++ b/esphome/components/homeassistant/number/homeassistant_number.cpp @@ -9,7 +9,7 @@ namespace esphome::homeassistant { -static const char *const TAG = "homeassistant.number"; +ESPHOME_LOG_TAG(TAG, "homeassistant.number"); void HomeassistantNumber::state_changed_(StringRef state) { auto number_value = parse_number(state.c_str()); diff --git a/esphome/components/homeassistant/select/homeassistant_select.cpp b/esphome/components/homeassistant/select/homeassistant_select.cpp index d3401de7f0..189a6b1f37 100644 --- a/esphome/components/homeassistant/select/homeassistant_select.cpp +++ b/esphome/components/homeassistant/select/homeassistant_select.cpp @@ -10,7 +10,7 @@ namespace esphome::homeassistant { -static const char *const TAG = "homeassistant.select"; +ESPHOME_LOG_TAG(TAG, "homeassistant.select"); namespace { diff --git a/esphome/components/homeassistant/sensor/homeassistant_sensor.cpp b/esphome/components/homeassistant/sensor/homeassistant_sensor.cpp index b79a56953a..8256dad484 100644 --- a/esphome/components/homeassistant/sensor/homeassistant_sensor.cpp +++ b/esphome/components/homeassistant/sensor/homeassistant_sensor.cpp @@ -5,7 +5,7 @@ namespace esphome::homeassistant { -static const char *const TAG = "homeassistant.sensor"; +ESPHOME_LOG_TAG(TAG, "homeassistant.sensor"); void HomeassistantSensor::setup() { api::global_api_server->subscribe_home_assistant_state(this->entity_id_, this->attribute_, [this](StringRef state) { diff --git a/esphome/components/homeassistant/switch/homeassistant_switch.cpp b/esphome/components/homeassistant/switch/homeassistant_switch.cpp index 79d75c9133..841f16df20 100644 --- a/esphome/components/homeassistant/switch/homeassistant_switch.cpp +++ b/esphome/components/homeassistant/switch/homeassistant_switch.cpp @@ -5,7 +5,7 @@ namespace esphome::homeassistant { -static const char *const TAG = "homeassistant.switch"; +ESPHOME_LOG_TAG(TAG, "homeassistant.switch"); using namespace esphome::switch_; diff --git a/esphome/components/homeassistant/text/homeassistant_text.cpp b/esphome/components/homeassistant/text/homeassistant_text.cpp index 31e4919700..7155f6ee18 100644 --- a/esphome/components/homeassistant/text/homeassistant_text.cpp +++ b/esphome/components/homeassistant/text/homeassistant_text.cpp @@ -10,7 +10,7 @@ namespace esphome::homeassistant { -static const char *const TAG = "homeassistant.text"; +ESPHOME_LOG_TAG(TAG, "homeassistant.text"); void HomeassistantText::state_changed_(StringRef state) { if (state == this->state) { diff --git a/esphome/components/homeassistant/text_sensor/homeassistant_text_sensor.cpp b/esphome/components/homeassistant/text_sensor/homeassistant_text_sensor.cpp index 40d7455ece..853b0d9b38 100644 --- a/esphome/components/homeassistant/text_sensor/homeassistant_text_sensor.cpp +++ b/esphome/components/homeassistant/text_sensor/homeassistant_text_sensor.cpp @@ -5,7 +5,7 @@ namespace esphome::homeassistant { -static const char *const TAG = "homeassistant.text_sensor"; +ESPHOME_LOG_TAG(TAG, "homeassistant.text_sensor"); void HomeassistantTextSensor::setup() { api::global_api_server->subscribe_home_assistant_state(this->entity_id_, this->attribute_, [this](StringRef state) { diff --git a/esphome/components/homeassistant/time/homeassistant_time.cpp b/esphome/components/homeassistant/time/homeassistant_time.cpp index c08bd73d62..a668d66800 100644 --- a/esphome/components/homeassistant/time/homeassistant_time.cpp +++ b/esphome/components/homeassistant/time/homeassistant_time.cpp @@ -3,7 +3,7 @@ namespace esphome::homeassistant { -static const char *const TAG = "homeassistant.time"; +ESPHOME_LOG_TAG(TAG, "homeassistant.time"); void HomeassistantTime::dump_config() { ESP_LOGCONFIG(TAG, "Home Assistant Time"); diff --git a/esphome/components/honeywell_hih_i2c/honeywell_hih.cpp b/esphome/components/honeywell_hih_i2c/honeywell_hih.cpp index 7f075847fd..a237f3bd60 100644 --- a/esphome/components/honeywell_hih_i2c/honeywell_hih.cpp +++ b/esphome/components/honeywell_hih_i2c/honeywell_hih.cpp @@ -7,7 +7,7 @@ namespace esphome::honeywell_hih_i2c { -static const char *const TAG = "honeywell_hih.i2c"; +ESPHOME_LOG_TAG(TAG, "honeywell_hih.i2c"); static const uint8_t REQUEST_CMD[1] = {0x00}; // Measurement Request Format static const uint16_t MAX_COUNT = 0x3FFE; // 2^14 - 2 diff --git a/esphome/components/honeywellabp/honeywellabp.cpp b/esphome/components/honeywellabp/honeywellabp.cpp index dd86b95c78..27f3635a73 100644 --- a/esphome/components/honeywellabp/honeywellabp.cpp +++ b/esphome/components/honeywellabp/honeywellabp.cpp @@ -3,7 +3,7 @@ namespace esphome::honeywellabp { -static const char *const TAG = "honeywellabp"; +ESPHOME_LOG_TAG(TAG, "honeywellabp"); const float MIN_COUNT = 1638.4; // 1638 counts (10% of 2^14 counts or 0x0666) const float MAX_COUNT = 14745.6; // 14745 counts (90% of 2^14 counts or 0x3999) diff --git a/esphome/components/honeywellabp2_i2c/honeywellabp2.cpp b/esphome/components/honeywellabp2_i2c/honeywellabp2.cpp index bfab045838..891eb4447d 100644 --- a/esphome/components/honeywellabp2_i2c/honeywellabp2.cpp +++ b/esphome/components/honeywellabp2_i2c/honeywellabp2.cpp @@ -9,7 +9,7 @@ static const uint8_t STATUS_BIT_BUSY = 5; static const uint8_t STATUS_BIT_ERROR = 2; static const uint8_t STATUS_MATH_SAT = 0; -static const char *const TAG = "honeywellabp2"; +ESPHOME_LOG_TAG(TAG, "honeywellabp2"); void HONEYWELLABP2Sensor::read_sensor_data() { if (this->read(raw_data_, 7) != i2c::ERROR_OK) { diff --git a/esphome/components/host/gpio.cpp b/esphome/components/host/gpio.cpp index f99b82bcc2..c1fd56e945 100644 --- a/esphome/components/host/gpio.cpp +++ b/esphome/components/host/gpio.cpp @@ -6,7 +6,7 @@ namespace esphome { namespace host { -static const char *const TAG = "host"; +ESPHOME_LOG_TAG(TAG, "host"); struct ISRPinArg { uint8_t pin; diff --git a/esphome/components/host/helpers.cpp b/esphome/components/host/helpers.cpp index 7274d9de57..9e203efcb9 100644 --- a/esphome/components/host/helpers.cpp +++ b/esphome/components/host/helpers.cpp @@ -14,7 +14,7 @@ namespace esphome { -static const char *const TAG = "helpers.host"; +ESPHOME_LOG_TAG(TAG, "helpers.host"); bool random_bytes(uint8_t *data, size_t len) { FILE *fp = fopen("/dev/urandom", "r"); diff --git a/esphome/components/host/preferences.cpp b/esphome/components/host/preferences.cpp index 497b9d11e5..9a8208e96e 100644 --- a/esphome/components/host/preferences.cpp +++ b/esphome/components/host/preferences.cpp @@ -9,7 +9,7 @@ namespace esphome::host { namespace fs = std::filesystem; -static const char *const TAG = "preferences"; +ESPHOME_LOG_TAG(TAG, "preferences"); void HostPreferences::setup_() { if (this->setup_complete_) diff --git a/esphome/components/hrxl_maxsonar_wr/hrxl_maxsonar_wr.cpp b/esphome/components/hrxl_maxsonar_wr/hrxl_maxsonar_wr.cpp index b323dd0436..1d58a4317a 100644 --- a/esphome/components/hrxl_maxsonar_wr/hrxl_maxsonar_wr.cpp +++ b/esphome/components/hrxl_maxsonar_wr/hrxl_maxsonar_wr.cpp @@ -11,7 +11,7 @@ namespace esphome::hrxl_maxsonar_wr { -static const char *const TAG = "hrxl.maxsonar.wr.sensor"; +ESPHOME_LOG_TAG(TAG, "hrxl.maxsonar.wr.sensor"); static const uint8_t ASCII_CR = 0x0D; static const uint8_t ASCII_NBSP = 0xFF; static const int MAX_DATA_LENGTH_BYTES = 6; diff --git a/esphome/components/hte501/hte501.cpp b/esphome/components/hte501/hte501.cpp index 67bfb1917e..e955531b57 100644 --- a/esphome/components/hte501/hte501.cpp +++ b/esphome/components/hte501/hte501.cpp @@ -4,7 +4,7 @@ namespace esphome::hte501 { -static const char *const TAG = "hte501"; +ESPHOME_LOG_TAG(TAG, "hte501"); static constexpr size_t HTE501_SERIAL_NUMBER_SIZE = 7; diff --git a/esphome/components/http_request/http_request.cpp b/esphome/components/http_request/http_request.cpp index 37e0de5d6a..e689c82d2f 100644 --- a/esphome/components/http_request/http_request.cpp +++ b/esphome/components/http_request/http_request.cpp @@ -6,7 +6,7 @@ namespace esphome::http_request { -static const char *const TAG = "http_request"; +ESPHOME_LOG_TAG(TAG, "http_request"); void HttpRequestComponent::dump_config() { ESP_LOGCONFIG(TAG, diff --git a/esphome/components/http_request/http_request_arduino.cpp b/esphome/components/http_request/http_request_arduino.cpp index 0d968222e9..b7565e676d 100644 --- a/esphome/components/http_request/http_request_arduino.cpp +++ b/esphome/components/http_request/http_request_arduino.cpp @@ -18,7 +18,7 @@ namespace esphome::http_request { -static const char *const TAG = "http_request"; +ESPHOME_LOG_TAG(TAG, "http_request"); #ifdef USE_ESP8266 // ESP8266 Arduino core (WiFiClientSecureBearSSL.cpp) returns -1000 on OOM static constexpr int ESP8266_SSL_ERR_OOM = -1000; diff --git a/esphome/components/http_request/http_request_host.cpp b/esphome/components/http_request/http_request_host.cpp index a788970202..c32881dc1f 100644 --- a/esphome/components/http_request/http_request_host.cpp +++ b/esphome/components/http_request/http_request_host.cpp @@ -16,7 +16,7 @@ namespace esphome::http_request { -static const char *const TAG = "http_request"; +ESPHOME_LOG_TAG(TAG, "http_request"); std::shared_ptr HttpRequestHost::perform(const char *url, const char *method, const std::string &body, const std::vector
&request_headers, diff --git a/esphome/components/http_request/http_request_idf.cpp b/esphome/components/http_request/http_request_idf.cpp index 4e5a2c42b5..1413b843b7 100644 --- a/esphome/components/http_request/http_request_idf.cpp +++ b/esphome/components/http_request/http_request_idf.cpp @@ -18,7 +18,7 @@ namespace esphome::http_request { -static const char *const TAG = "http_request"; +ESPHOME_LOG_TAG(TAG, "http_request"); static constexpr uint32_t ERROR_DURATION_MS = 1000; void HttpRequestIDF::dump_config() { diff --git a/esphome/components/http_request/ota/ota_http_request.cpp b/esphome/components/http_request/ota/ota_http_request.cpp index 7e7594c3c3..a26c366fa6 100644 --- a/esphome/components/http_request/ota/ota_http_request.cpp +++ b/esphome/components/http_request/ota/ota_http_request.cpp @@ -11,7 +11,7 @@ namespace esphome::http_request { -static const char *const TAG = "http_request.ota"; +ESPHOME_LOG_TAG(TAG, "http_request.ota"); void OtaHttpRequestComponent::dump_config() { ESP_LOGCONFIG(TAG, "Over-The-Air updates via HTTP request"); }; diff --git a/esphome/components/http_request/update/http_request_update.cpp b/esphome/components/http_request/update/http_request_update.cpp index 6a74c00e8e..bedb0e98e7 100644 --- a/esphome/components/http_request/update/http_request_update.cpp +++ b/esphome/components/http_request/update/http_request_update.cpp @@ -22,7 +22,7 @@ namespace esphome::http_request { #define UPDATE_RETURN return #endif -static const char *const TAG = "http_request.update"; +ESPHOME_LOG_TAG(TAG, "http_request.update"); // Wraps UpdateInfo + error for the task→main-loop handoff. struct TaskResult { diff --git a/esphome/components/htu21d/htu21d.cpp b/esphome/components/htu21d/htu21d.cpp index 8a3b2cb5d5..468a7f8e6a 100644 --- a/esphome/components/htu21d/htu21d.cpp +++ b/esphome/components/htu21d/htu21d.cpp @@ -4,7 +4,7 @@ namespace esphome::htu21d { -static const char *const TAG = "htu21d"; +ESPHOME_LOG_TAG(TAG, "htu21d"); static const uint8_t HTU21D_ADDRESS = 0x40; static const uint8_t HTU21D_REGISTER_RESET = 0xFE; diff --git a/esphome/components/htu31d/htu31d.cpp b/esphome/components/htu31d/htu31d.cpp index 6821b8b69e..86c9876b2b 100644 --- a/esphome/components/htu31d/htu31d.cpp +++ b/esphome/components/htu31d/htu31d.cpp @@ -17,7 +17,7 @@ namespace esphome::htu31d { /** Logging prefix */ -static const char *const TAG = "htu31d"; +ESPHOME_LOG_TAG(TAG, "htu31d"); /** Default I2C address for the HTU31D. */ static const uint8_t HTU31D_DEFAULT_I2CADDR = 0x40; diff --git a/esphome/components/hub75/hub75.cpp b/esphome/components/hub75/hub75.cpp index d36928a83a..674e23cb34 100644 --- a/esphome/components/hub75/hub75.cpp +++ b/esphome/components/hub75/hub75.cpp @@ -6,7 +6,7 @@ namespace esphome::hub75 { -static const char *const TAG = "hub75"; +ESPHOME_LOG_TAG(TAG, "hub75"); // ======================================== // Constructor diff --git a/esphome/components/hx711/hx711.cpp b/esphome/components/hx711/hx711.cpp index fe2fb4c350..48afc0192d 100644 --- a/esphome/components/hx711/hx711.cpp +++ b/esphome/components/hx711/hx711.cpp @@ -4,7 +4,7 @@ namespace esphome::hx711 { -static const char *const TAG = "hx711"; +ESPHOME_LOG_TAG(TAG, "hx711"); void HX711Sensor::setup() { this->sck_pin_->setup(); diff --git a/esphome/components/hydreon_rgxx/hydreon_rgxx.cpp b/esphome/components/hydreon_rgxx/hydreon_rgxx.cpp index 05557111fc..0afeb94bf3 100644 --- a/esphome/components/hydreon_rgxx/hydreon_rgxx.cpp +++ b/esphome/components/hydreon_rgxx/hydreon_rgxx.cpp @@ -3,7 +3,7 @@ namespace esphome::hydreon_rgxx { -static const char *const TAG = "hydreon_rgxx.sensor"; +ESPHOME_LOG_TAG(TAG, "hydreon_rgxx.sensor"); static const int MAX_DATA_LENGTH_BYTES = 80; static const uint8_t ASCII_LF = 0x0A; #define HYDREON_RGXX_COMMA , diff --git a/esphome/components/hyt271/hyt271.cpp b/esphome/components/hyt271/hyt271.cpp index 7b2c960a5f..72d3940f30 100644 --- a/esphome/components/hyt271/hyt271.cpp +++ b/esphome/components/hyt271/hyt271.cpp @@ -4,7 +4,7 @@ namespace esphome::hyt271 { -static const char *const TAG = "hyt271"; +ESPHOME_LOG_TAG(TAG, "hyt271"); static const uint8_t HYT271_ADDRESS = 0x28; diff --git a/esphome/components/i2c/i2c.cpp b/esphome/components/i2c/i2c.cpp index 76b3ec3b4d..8fc0a50327 100644 --- a/esphome/components/i2c/i2c.cpp +++ b/esphome/components/i2c/i2c.cpp @@ -7,7 +7,7 @@ namespace esphome::i2c { -static const char *const TAG = "i2c"; +ESPHOME_LOG_TAG(TAG, "i2c"); void I2CBus::i2c_scan_() { for (uint8_t address = 8; address != 120; address++) { diff --git a/esphome/components/i2c/i2c_bus_arduino.cpp b/esphome/components/i2c/i2c_bus_arduino.cpp index 39a6aec774..95aee2bddb 100644 --- a/esphome/components/i2c/i2c_bus_arduino.cpp +++ b/esphome/components/i2c/i2c_bus_arduino.cpp @@ -9,7 +9,7 @@ namespace esphome::i2c { -static const char *const TAG = "i2c"; +ESPHOME_LOG_TAG(TAG, "i2c"); // Maximum bytes to log in hex format (truncates larger transfers) static constexpr size_t I2C_MAX_LOG_BYTES = 32; diff --git a/esphome/components/i2c/i2c_bus_esp_idf.cpp b/esphome/components/i2c/i2c_bus_esp_idf.cpp index 7ca9537e2d..b13b525abb 100644 --- a/esphome/components/i2c/i2c_bus_esp_idf.cpp +++ b/esphome/components/i2c/i2c_bus_esp_idf.cpp @@ -12,7 +12,7 @@ namespace esphome::i2c { -static const char *const TAG = "i2c"; +ESPHOME_LOG_TAG(TAG, "i2c"); // Maximum bytes to log in hex format (truncates larger transfers) static constexpr size_t I2C_MAX_LOG_BYTES = 32; diff --git a/esphome/components/i2c/i2c_bus_host.cpp b/esphome/components/i2c/i2c_bus_host.cpp index 303944636b..672bc9cc5d 100644 --- a/esphome/components/i2c/i2c_bus_host.cpp +++ b/esphome/components/i2c/i2c_bus_host.cpp @@ -16,7 +16,7 @@ namespace esphome::i2c { -static const char *const TAG = "i2c"; +ESPHOME_LOG_TAG(TAG, "i2c"); HostI2CBus::~HostI2CBus() { if (this->file_descriptor_ != -1) { diff --git a/esphome/components/i2c/i2c_bus_zephyr.cpp b/esphome/components/i2c/i2c_bus_zephyr.cpp index ffdd2ba8bb..4145cd5859 100644 --- a/esphome/components/i2c/i2c_bus_zephyr.cpp +++ b/esphome/components/i2c/i2c_bus_zephyr.cpp @@ -6,7 +6,7 @@ namespace esphome::i2c { -static const char *const TAG = "i2c"; +ESPHOME_LOG_TAG(TAG, "i2c"); static const char *get_speed(uint32_t dev_config) { switch (I2C_SPEED_GET(dev_config)) { diff --git a/esphome/components/i2c_device/i2c_device.cpp b/esphome/components/i2c_device/i2c_device.cpp index 2f68a9e96a..379a25574e 100644 --- a/esphome/components/i2c_device/i2c_device.cpp +++ b/esphome/components/i2c_device/i2c_device.cpp @@ -5,7 +5,7 @@ namespace esphome::i2c_device { -static const char *const TAG = "i2c_device"; +ESPHOME_LOG_TAG(TAG, "i2c_device"); void I2CDeviceComponent::dump_config() { ESP_LOGCONFIG(TAG, "I2CDevice"); diff --git a/esphome/components/i2s_audio/microphone/i2s_audio_microphone.cpp b/esphome/components/i2s_audio/microphone/i2s_audio_microphone.cpp index c577ed092e..79367d67e0 100644 --- a/esphome/components/i2s_audio/microphone/i2s_audio_microphone.cpp +++ b/esphome/components/i2s_audio/microphone/i2s_audio_microphone.cpp @@ -19,7 +19,7 @@ static const uint32_t READ_DURATION_MS = 16; static const size_t TASK_STACK_SIZE = 4096; static const ssize_t TASK_PRIORITY = 23; -static const char *const TAG = "i2s_audio.microphone"; +ESPHOME_LOG_TAG(TAG, "i2s_audio.microphone"); enum MicrophoneEventGroupBits : uint32_t { COMMAND_STOP = (1 << 0), // stops the microphone task, set and cleared by ``loop`` diff --git a/esphome/components/i2s_audio/speaker/i2s_audio_spdif.cpp b/esphome/components/i2s_audio/speaker/i2s_audio_spdif.cpp index ec4e459be7..5054478ceb 100644 --- a/esphome/components/i2s_audio/speaker/i2s_audio_spdif.cpp +++ b/esphome/components/i2s_audio/speaker/i2s_audio_spdif.cpp @@ -14,7 +14,7 @@ namespace esphome::i2s_audio { -static const char *const TAG = "i2s_audio.spdif"; +ESPHOME_LOG_TAG(TAG, "i2s_audio.spdif"); // SPDIF mode adds overhead as each sample is encapsulated in a subframe; // each DMA buffer can hold only 192 samples (~4ms each vs. ~15ms for standard I2S). diff --git a/esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp b/esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp index 4b74b2e29d..a57ef7f55c 100644 --- a/esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +++ b/esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp @@ -18,7 +18,7 @@ namespace esphome::i2s_audio { -static const char *const TAG = "i2s_audio.speaker"; +ESPHOME_LOG_TAG(TAG, "i2s_audio.speaker"); // Software volume control maps the user-facing (0.0, 1.0) range linearly to a dB reduction in // [-49.0, 0.0] dB; 0.0 is silence. diff --git a/esphome/components/i2s_audio/speaker/i2s_audio_speaker_standard.cpp b/esphome/components/i2s_audio/speaker/i2s_audio_speaker_standard.cpp index b4b6173458..fbc1edbde9 100644 --- a/esphome/components/i2s_audio/speaker/i2s_audio_speaker_standard.cpp +++ b/esphome/components/i2s_audio/speaker/i2s_audio_speaker_standard.cpp @@ -18,7 +18,7 @@ namespace esphome::i2s_audio { -static const char *const TAG = "i2s_audio.speaker.std"; +ESPHOME_LOG_TAG(TAG, "i2s_audio.speaker.std"); static constexpr uint32_t DMA_BUFFER_DURATION_MS = 10; static constexpr size_t DMA_BUFFERS_COUNT = 5; diff --git a/esphome/components/i2s_audio/speaker/spdif_encoder.cpp b/esphome/components/i2s_audio/speaker/spdif_encoder.cpp index 30146e0a70..c98cbcb20a 100644 --- a/esphome/components/i2s_audio/speaker/spdif_encoder.cpp +++ b/esphome/components/i2s_audio/speaker/spdif_encoder.cpp @@ -6,7 +6,7 @@ namespace esphome::i2s_audio { -static const char *const TAG = "i2s_audio.spdif_encoder"; +ESPHOME_LOG_TAG(TAG, "i2s_audio.spdif_encoder"); // S/PDIF preamble patterns (8 BMC bits each) // These are the BMC-encoded sync patterns that violate normal BMC rules for easy detection. diff --git a/esphome/components/iaqcore/iaqcore.cpp b/esphome/components/iaqcore/iaqcore.cpp index 7397d0975c..48935c2468 100644 --- a/esphome/components/iaqcore/iaqcore.cpp +++ b/esphome/components/iaqcore/iaqcore.cpp @@ -5,7 +5,7 @@ namespace esphome::iaqcore { -static const char *const TAG = "iaqcore"; +ESPHOME_LOG_TAG(TAG, "iaqcore"); enum IAQCoreErrorCode : uint8_t { ERROR_OK = 0, ERROR_RUNIN = 0x10, ERROR_BUSY = 0x01, ERROR_ERROR = 0x80 }; diff --git a/esphome/components/icnt86/icnt86.cpp b/esphome/components/icnt86/icnt86.cpp index 62a4586ebc..42585269f8 100644 --- a/esphome/components/icnt86/icnt86.cpp +++ b/esphome/components/icnt86/icnt86.cpp @@ -3,7 +3,7 @@ namespace esphome::icnt86 { -static const char *const TAG = "icnt86"; +ESPHOME_LOG_TAG(TAG, "icnt86"); static constexpr uint16_t REG_TOUCH_NUM = 0x1001; static constexpr uint16_t REG_POINT1 = 0x1002; static constexpr uint8_t MAX_TOUCHES = 5; diff --git a/esphome/components/improv_base/improv_base.cpp b/esphome/components/improv_base/improv_base.cpp index 6745f8064b..e25980545c 100644 --- a/esphome/components/improv_base/improv_base.cpp +++ b/esphome/components/improv_base/improv_base.cpp @@ -9,7 +9,7 @@ namespace esphome::improv_base { #ifdef USE_IMPROV_NEXT_URL -static const char *const TAG = "improv_base"; +ESPHOME_LOG_TAG(TAG, "improv_base"); static constexpr const char DEVICE_NAME_PLACEHOLDER[] = "{{device_name}}"; static constexpr size_t DEVICE_NAME_PLACEHOLDER_LEN = sizeof(DEVICE_NAME_PLACEHOLDER) - 1; diff --git a/esphome/components/improv_ble/improv_ble_component.cpp b/esphome/components/improv_ble/improv_ble_component.cpp index 0a20beb33c..15adc49776 100644 --- a/esphome/components/improv_ble/improv_ble_component.cpp +++ b/esphome/components/improv_ble/improv_ble_component.cpp @@ -20,7 +20,7 @@ namespace esphome::improv_ble { using namespace bytebuffer; -static const char *const TAG = "improv_ble.component"; +ESPHOME_LOG_TAG(TAG, "improv_ble.component"); static constexpr size_t IMPROV_MAX_LOG_BYTES = 128; static constexpr char ESPHOME_MY_LINK[] = "https://my.home-assistant.io/redirect/config_flow_start?domain=esphome"; // command + data length + trailing byte diff --git a/esphome/components/improv_serial/improv_serial_component.cpp b/esphome/components/improv_serial/improv_serial_component.cpp index 3827fb6ed4..ecb7bc98fb 100644 --- a/esphome/components/improv_serial/improv_serial_component.cpp +++ b/esphome/components/improv_serial/improv_serial_component.cpp @@ -16,7 +16,7 @@ namespace esphome::improv_serial { -static const char *const TAG = "improv_serial"; +ESPHOME_LOG_TAG(TAG, "improv_serial"); void ImprovSerialComponent::setup() { global_improv_serial_component = this; diff --git a/esphome/components/ina219/ina219.cpp b/esphome/components/ina219/ina219.cpp index 833d1989c8..a675099b4d 100644 --- a/esphome/components/ina219/ina219.cpp +++ b/esphome/components/ina219/ina219.cpp @@ -4,7 +4,7 @@ namespace esphome::ina219 { -static const char *const TAG = "ina219"; +ESPHOME_LOG_TAG(TAG, "ina219"); // | A0 | A1 | Address | // | GND | GND | 0x40 | diff --git a/esphome/components/ina226/ina226.cpp b/esphome/components/ina226/ina226.cpp index c22237d144..97b3caf949 100644 --- a/esphome/components/ina226/ina226.cpp +++ b/esphome/components/ina226/ina226.cpp @@ -5,7 +5,7 @@ namespace esphome::ina226 { -static const char *const TAG = "ina226"; +ESPHOME_LOG_TAG(TAG, "ina226"); // | A0 | A1 | Address | // | GND | GND | 0x40 | diff --git a/esphome/components/ina260/ina260.cpp b/esphome/components/ina260/ina260.cpp index 05039f0e33..82a4e4fba1 100644 --- a/esphome/components/ina260/ina260.cpp +++ b/esphome/components/ina260/ina260.cpp @@ -4,7 +4,7 @@ namespace esphome::ina260 { -static const char *const TAG = "ina260"; +ESPHOME_LOG_TAG(TAG, "ina260"); // | A0 | A1 | Address | // | GND | GND | 0x40 | diff --git a/esphome/components/ina2xx_base/ina2xx_base.cpp b/esphome/components/ina2xx_base/ina2xx_base.cpp index fec5cd2f13..58e0598b06 100644 --- a/esphome/components/ina2xx_base/ina2xx_base.cpp +++ b/esphome/components/ina2xx_base/ina2xx_base.cpp @@ -7,7 +7,7 @@ namespace esphome::ina2xx_base { -static const char *const TAG = "ina2xx"; +ESPHOME_LOG_TAG(TAG, "ina2xx"); #define OKFAILED(b) ((b) ? "OK" : "FAILED") diff --git a/esphome/components/ina2xx_i2c/ina2xx_i2c.cpp b/esphome/components/ina2xx_i2c/ina2xx_i2c.cpp index 4fc3b00a21..61c7744cca 100644 --- a/esphome/components/ina2xx_i2c/ina2xx_i2c.cpp +++ b/esphome/components/ina2xx_i2c/ina2xx_i2c.cpp @@ -3,7 +3,7 @@ namespace esphome::ina2xx_i2c { -static const char *const TAG = "ina2xx_i2c"; +ESPHOME_LOG_TAG(TAG, "ina2xx_i2c"); void INA2XXI2C::setup() { auto err = this->write(nullptr, 0); diff --git a/esphome/components/ina2xx_spi/ina2xx_spi.cpp b/esphome/components/ina2xx_spi/ina2xx_spi.cpp index 43eb676236..b9b7a6c774 100644 --- a/esphome/components/ina2xx_spi/ina2xx_spi.cpp +++ b/esphome/components/ina2xx_spi/ina2xx_spi.cpp @@ -3,7 +3,7 @@ namespace esphome::ina2xx_spi { -static const char *const TAG = "ina2xx_spi"; +ESPHOME_LOG_TAG(TAG, "ina2xx_spi"); void INA2XXSPI::setup() { this->spi_setup(); diff --git a/esphome/components/ina3221/ina3221.cpp b/esphome/components/ina3221/ina3221.cpp index b88480fc00..f3647c4d1c 100644 --- a/esphome/components/ina3221/ina3221.cpp +++ b/esphome/components/ina3221/ina3221.cpp @@ -4,7 +4,7 @@ namespace esphome::ina3221 { -static const char *const TAG = "ina3221"; +ESPHOME_LOG_TAG(TAG, "ina3221"); static const uint8_t INA3221_REGISTER_CONFIG = 0x00; static const uint8_t INA3221_REGISTER_CHANNEL1_SHUNT_VOLTAGE = 0x01; diff --git a/esphome/components/infrared/infrared.cpp b/esphome/components/infrared/infrared.cpp index 67a40fa349..9b766a8996 100644 --- a/esphome/components/infrared/infrared.cpp +++ b/esphome/components/infrared/infrared.cpp @@ -4,7 +4,7 @@ namespace esphome::infrared { -static const char *const TAG = "infrared"; +ESPHOME_LOG_TAG(TAG, "infrared"); void Infrared::dump_config() { ESP_LOGCONFIG(TAG, diff --git a/esphome/components/inkbird_ibsth1_mini/inkbird_ibsth1_mini.cpp b/esphome/components/inkbird_ibsth1_mini/inkbird_ibsth1_mini.cpp index d360142bcb..ef6600b4eb 100644 --- a/esphome/components/inkbird_ibsth1_mini/inkbird_ibsth1_mini.cpp +++ b/esphome/components/inkbird_ibsth1_mini/inkbird_ibsth1_mini.cpp @@ -3,7 +3,7 @@ namespace esphome::inkbird_ibsth1_mini { -static const char *const TAG = "inkbird_ibsth1_mini"; +ESPHOME_LOG_TAG(TAG, "inkbird_ibsth1_mini"); void InkbirdIbstH1Mini::dump_config() { ESP_LOGCONFIG(TAG, "Inkbird IBS TH1 MINI"); diff --git a/esphome/components/inkplate/inkplate.cpp b/esphome/components/inkplate/inkplate.cpp index 2e837fb614..b1e8535d20 100644 --- a/esphome/components/inkplate/inkplate.cpp +++ b/esphome/components/inkplate/inkplate.cpp @@ -9,7 +9,7 @@ namespace esphome::inkplate { -static const char *const TAG = "inkplate"; +ESPHOME_LOG_TAG(TAG, "inkplate"); void Inkplate::setup() { for (uint32_t i = 0; i < 256; i++) { diff --git a/esphome/components/integration/integration_sensor.cpp b/esphome/components/integration/integration_sensor.cpp index bc26fb0f19..c7b6173e39 100644 --- a/esphome/components/integration/integration_sensor.cpp +++ b/esphome/components/integration/integration_sensor.cpp @@ -5,7 +5,7 @@ namespace esphome::integration { -static const char *const TAG = "integration"; +ESPHOME_LOG_TAG(TAG, "integration"); void IntegrationSensor::setup() { if (this->restore_) { diff --git a/esphome/components/internal_temperature/internal_temperature_bk72xx.cpp b/esphome/components/internal_temperature/internal_temperature_bk72xx.cpp index 91f47d831f..00f3b97ec0 100644 --- a/esphome/components/internal_temperature/internal_temperature_bk72xx.cpp +++ b/esphome/components/internal_temperature/internal_temperature_bk72xx.cpp @@ -9,7 +9,7 @@ uint32_t temp_single_get_current_temperature(uint32_t *temp_value); namespace esphome::internal_temperature { -static const char *const TAG = "internal_temperature"; +ESPHOME_LOG_TAG(TAG, "internal_temperature"); void InternalTemperatureSensor::update() { float temperature = NAN; diff --git a/esphome/components/internal_temperature/internal_temperature_common.cpp b/esphome/components/internal_temperature/internal_temperature_common.cpp index 89a7d34333..51c55d4adb 100644 --- a/esphome/components/internal_temperature/internal_temperature_common.cpp +++ b/esphome/components/internal_temperature/internal_temperature_common.cpp @@ -3,7 +3,7 @@ namespace esphome::internal_temperature { -static const char *const TAG = "internal_temperature"; +ESPHOME_LOG_TAG(TAG, "internal_temperature"); void InternalTemperatureSensor::dump_config() { LOG_SENSOR("", "Internal Temperature Sensor", this); } diff --git a/esphome/components/internal_temperature/internal_temperature_esp32.cpp b/esphome/components/internal_temperature/internal_temperature_esp32.cpp index 2c6fda2af4..4da062ac05 100644 --- a/esphome/components/internal_temperature/internal_temperature_esp32.cpp +++ b/esphome/components/internal_temperature/internal_temperature_esp32.cpp @@ -16,7 +16,7 @@ uint8_t temprature_sens_read(); namespace esphome::internal_temperature { -static const char *const TAG = "internal_temperature"; +ESPHOME_LOG_TAG(TAG, "internal_temperature"); void InternalTemperatureSensor::update() { float temperature = NAN; diff --git a/esphome/components/internal_temperature/internal_temperature_rp2.cpp b/esphome/components/internal_temperature/internal_temperature_rp2.cpp index c4ab33b0a5..b0ccf99145 100644 --- a/esphome/components/internal_temperature/internal_temperature_rp2.cpp +++ b/esphome/components/internal_temperature/internal_temperature_rp2.cpp @@ -16,7 +16,7 @@ namespace esphome::internal_temperature { -static const char *const TAG = "internal_temperature"; +ESPHOME_LOG_TAG(TAG, "internal_temperature"); // The on-die temperature sensor sits on the last ADC channel: input 4 on RP2040 // and RP2350A, but input 8 on RP2350B, which has eight external channels rather diff --git a/esphome/components/internal_temperature/internal_temperature_zephyr.cpp b/esphome/components/internal_temperature/internal_temperature_zephyr.cpp index 50c597f6f1..5c3e81d10f 100644 --- a/esphome/components/internal_temperature/internal_temperature_zephyr.cpp +++ b/esphome/components/internal_temperature/internal_temperature_zephyr.cpp @@ -8,7 +8,7 @@ namespace esphome::internal_temperature { -static const char *const TAG = "internal_temperature"; +ESPHOME_LOG_TAG(TAG, "internal_temperature"); static const struct device *const DIE_TEMPERATURE_SENSOR = DEVICE_DT_GET_ONE(nordic_nrf_temp); diff --git a/esphome/components/ir_rf_base/ir_rf_base.cpp b/esphome/components/ir_rf_base/ir_rf_base.cpp index 9aa845f269..91db4252c0 100644 --- a/esphome/components/ir_rf_base/ir_rf_base.cpp +++ b/esphome/components/ir_rf_base/ir_rf_base.cpp @@ -13,7 +13,7 @@ namespace esphome::ir_rf_base { -static const char *const TAG = "ir_rf"; +ESPHOME_LOG_TAG(TAG, "ir_rf"); #if defined(USE_API) && defined(USE_IR_RF) // A missing completion is answered as failed this long after the frame should have left the diff --git a/esphome/components/ir_rf_proxy/ir_rf_proxy.cpp b/esphome/components/ir_rf_proxy/ir_rf_proxy.cpp index 88b1560608..0eae11d1a5 100644 --- a/esphome/components/ir_rf_proxy/ir_rf_proxy.cpp +++ b/esphome/components/ir_rf_proxy/ir_rf_proxy.cpp @@ -6,7 +6,7 @@ namespace esphome::ir_rf_proxy { -static const char *const TAG = "ir_rf_proxy"; +ESPHOME_LOG_TAG(TAG, "ir_rf_proxy"); // ========== IrRfProxy (Infrared platform) ========== diff --git a/esphome/components/it8951/it8951.cpp b/esphome/components/it8951/it8951.cpp index a6511b63c4..2cfcf111ea 100644 --- a/esphome/components/it8951/it8951.cpp +++ b/esphome/components/it8951/it8951.cpp @@ -10,7 +10,7 @@ namespace esphome::it8951 { -static const char *const TAG = "it8951"; +ESPHOME_LOG_TAG(TAG, "it8951"); // Soft cap for time spent in a single XFER_ROWS Op so we yield back to the // loop within one tick budget. diff --git a/esphome/components/jsn_sr04t/jsn_sr04t.cpp b/esphome/components/jsn_sr04t/jsn_sr04t.cpp index c67771a0b6..0c7dd27738 100644 --- a/esphome/components/jsn_sr04t/jsn_sr04t.cpp +++ b/esphome/components/jsn_sr04t/jsn_sr04t.cpp @@ -6,7 +6,7 @@ namespace esphome::jsn_sr04t { -static const char *const TAG = "jsn_sr04t.sensor"; +ESPHOME_LOG_TAG(TAG, "jsn_sr04t.sensor"); void Jsnsr04tComponent::update() { this->write_byte((this->model_ == AJ_SR04M) ? 0x01 : 0x55); diff --git a/esphome/components/json/json_util.cpp b/esphome/components/json/json_util.cpp index 3ecfce8b69..28ba34d6ca 100644 --- a/esphome/components/json/json_util.cpp +++ b/esphome/components/json/json_util.cpp @@ -7,7 +7,7 @@ namespace esphome::json { -static const char *const TAG = "json"; +ESPHOME_LOG_TAG(TAG, "json"); #ifdef USE_PSRAM // Global allocator that outlives all JsonDocuments returned by parse_json() diff --git a/esphome/components/kamstrup_kmp/kamstrup_kmp.cpp b/esphome/components/kamstrup_kmp/kamstrup_kmp.cpp index 24e5d25921..9713c72b61 100644 --- a/esphome/components/kamstrup_kmp/kamstrup_kmp.cpp +++ b/esphome/components/kamstrup_kmp/kamstrup_kmp.cpp @@ -5,7 +5,7 @@ namespace esphome::kamstrup_kmp { -static const char *const TAG = "kamstrup_kmp"; +ESPHOME_LOG_TAG(TAG, "kamstrup_kmp"); void KamstrupKMPComponent::dump_config() { ESP_LOGCONFIG(TAG, "kamstrup_kmp:"); diff --git a/esphome/components/key_collector/key_collector.cpp b/esphome/components/key_collector/key_collector.cpp index 42f02d39d4..bc201a1514 100644 --- a/esphome/components/key_collector/key_collector.cpp +++ b/esphome/components/key_collector/key_collector.cpp @@ -4,7 +4,7 @@ namespace esphome::key_collector { -static const char *const TAG = "key_collector"; +ESPHOME_LOG_TAG(TAG, "key_collector"); void KeyCollector::loop() { if ((this->timeout_ == 0) || this->result_.empty() || (millis() - this->last_key_time_ < this->timeout_)) diff --git a/esphome/components/kmeteriso/kmeteriso.cpp b/esphome/components/kmeteriso/kmeteriso.cpp index d6934a97ac..8bd8b47e21 100644 --- a/esphome/components/kmeteriso/kmeteriso.cpp +++ b/esphome/components/kmeteriso/kmeteriso.cpp @@ -5,7 +5,7 @@ namespace esphome::kmeteriso { -static const char *const TAG = "kmeteriso.sensor"; +ESPHOME_LOG_TAG(TAG, "kmeteriso.sensor"); static const uint8_t KMETER_ERROR_STATUS_REG = 0x20; static const uint8_t KMETER_TEMP_VAL_REG = 0x00; diff --git a/esphome/components/kuntze/kuntze.cpp b/esphome/components/kuntze/kuntze.cpp index cb04afe437..647227524e 100644 --- a/esphome/components/kuntze/kuntze.cpp +++ b/esphome/components/kuntze/kuntze.cpp @@ -3,7 +3,7 @@ namespace esphome::kuntze { -static const char *const TAG = "kuntze"; +ESPHOME_LOG_TAG(TAG, "kuntze"); static constexpr uint16_t REGISTER_PH = 4136; static constexpr uint16_t REGISTER_TEMPERATURE = 4160; diff --git a/esphome/components/lc709203f/lc709203f.cpp b/esphome/components/lc709203f/lc709203f.cpp index 36e5bce8e3..a97f5217a8 100644 --- a/esphome/components/lc709203f/lc709203f.cpp +++ b/esphome/components/lc709203f/lc709203f.cpp @@ -4,7 +4,7 @@ namespace esphome::lc709203f { -static const char *const TAG = "lc709203f.sensor"; +ESPHOME_LOG_TAG(TAG, "lc709203f.sensor"); // Device I2C address. This address is fixed. static const uint8_t LC709203F_I2C_ADDR_DEFAULT = 0x0B; diff --git a/esphome/components/lcd_base/lcd_display.cpp b/esphome/components/lcd_base/lcd_display.cpp index 0890da85c1..101e858bef 100644 --- a/esphome/components/lcd_base/lcd_display.cpp +++ b/esphome/components/lcd_base/lcd_display.cpp @@ -5,7 +5,7 @@ namespace esphome::lcd_base { -static const char *const TAG = "lcd"; +ESPHOME_LOG_TAG(TAG, "lcd"); // First set bit determines command, bits after that are the data. static const uint8_t LCD_DISPLAY_COMMAND_CLEAR_DISPLAY = 0x01; diff --git a/esphome/components/lcd_gpio/gpio_lcd_display.cpp b/esphome/components/lcd_gpio/gpio_lcd_display.cpp index 213fc8637e..92ae37eab8 100644 --- a/esphome/components/lcd_gpio/gpio_lcd_display.cpp +++ b/esphome/components/lcd_gpio/gpio_lcd_display.cpp @@ -3,7 +3,7 @@ namespace esphome::lcd_gpio { -static const char *const TAG = "lcd_gpio"; +ESPHOME_LOG_TAG(TAG, "lcd_gpio"); void GPIOLCDDisplay::setup() { this->rs_pin_->setup(); // OUTPUT diff --git a/esphome/components/lcd_menu/lcd_menu.cpp b/esphome/components/lcd_menu/lcd_menu.cpp index f731817bdb..7ced6e67ce 100644 --- a/esphome/components/lcd_menu/lcd_menu.cpp +++ b/esphome/components/lcd_menu/lcd_menu.cpp @@ -4,7 +4,7 @@ namespace esphome::lcd_menu { -static const char *const TAG = "lcd_menu"; +ESPHOME_LOG_TAG(TAG, "lcd_menu"); void LCDCharacterMenuComponent::setup() { if (this->display_->is_failed()) { diff --git a/esphome/components/lcd_pcf8574/pcf8574_display.cpp b/esphome/components/lcd_pcf8574/pcf8574_display.cpp index d5fc683598..fc7f5ff2f5 100644 --- a/esphome/components/lcd_pcf8574/pcf8574_display.cpp +++ b/esphome/components/lcd_pcf8574/pcf8574_display.cpp @@ -4,7 +4,7 @@ namespace esphome::lcd_pcf8574 { -static const char *const TAG = "lcd_pcf8574"; +ESPHOME_LOG_TAG(TAG, "lcd_pcf8574"); static const uint8_t LCD_DISPLAY_BACKLIGHT_ON = 0x08; static const uint8_t LCD_DISPLAY_BACKLIGHT_OFF = 0x00; diff --git a/esphome/components/ld2410/ld2410.cpp b/esphome/components/ld2410/ld2410.cpp index 914de8e145..22bd20d1e5 100644 --- a/esphome/components/ld2410/ld2410.cpp +++ b/esphome/components/ld2410/ld2410.cpp @@ -12,7 +12,7 @@ namespace esphome::ld2410 { -static const char *const TAG = "ld2410"; +ESPHOME_LOG_TAG(TAG, "ld2410"); enum BaudRate : uint8_t { BAUD_RATE_9600 = 1, diff --git a/esphome/components/ld2412/ld2412.cpp b/esphome/components/ld2412/ld2412.cpp index 7041b7539f..bd43d06cc2 100644 --- a/esphome/components/ld2412/ld2412.cpp +++ b/esphome/components/ld2412/ld2412.cpp @@ -12,7 +12,7 @@ namespace esphome::ld2412 { -static const char *const TAG = "ld2412"; +ESPHOME_LOG_TAG(TAG, "ld2412"); enum BaudRate : uint8_t { BAUD_RATE_9600 = 1, diff --git a/esphome/components/ld2420/binary_sensor/ld2420_binary_sensor.cpp b/esphome/components/ld2420/binary_sensor/ld2420_binary_sensor.cpp index 6297cba2e7..87375ccbd9 100644 --- a/esphome/components/ld2420/binary_sensor/ld2420_binary_sensor.cpp +++ b/esphome/components/ld2420/binary_sensor/ld2420_binary_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::ld2420 { -static const char *const TAG = "ld2420.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "ld2420.binary_sensor"); void LD2420BinarySensor::dump_config() { ESP_LOGCONFIG(TAG, "Binary Sensor:"); diff --git a/esphome/components/ld2420/button/reconfig_buttons.cpp b/esphome/components/ld2420/button/reconfig_buttons.cpp index 1e748e59b8..85e3411f49 100644 --- a/esphome/components/ld2420/button/reconfig_buttons.cpp +++ b/esphome/components/ld2420/button/reconfig_buttons.cpp @@ -2,7 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -static const char *const TAG = "ld2420.button"; +ESPHOME_LOG_TAG(TAG, "ld2420.button"); namespace esphome::ld2420 { diff --git a/esphome/components/ld2420/ld2420.cpp b/esphome/components/ld2420/ld2420.cpp index e342ead414..dec7e42de4 100644 --- a/esphome/components/ld2420/ld2420.cpp +++ b/esphome/components/ld2420/ld2420.cpp @@ -60,7 +60,7 @@ Gate 0 low thresh = 20 00 uint16_t 0x0020, Threshold value = 60 EA 00 00 uint32_ namespace esphome::ld2420 { -static const char *const TAG = "ld2420"; +ESPHOME_LOG_TAG(TAG, "ld2420"); // Local const's static constexpr uint16_t REFRESH_RATE_MS = 1000; diff --git a/esphome/components/ld2420/number/gate_config_number.cpp b/esphome/components/ld2420/number/gate_config_number.cpp index 998eed2188..491cd85734 100644 --- a/esphome/components/ld2420/number/gate_config_number.cpp +++ b/esphome/components/ld2420/number/gate_config_number.cpp @@ -2,7 +2,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -static const char *const TAG = "ld2420.number"; +ESPHOME_LOG_TAG(TAG, "ld2420.number"); namespace esphome::ld2420 { diff --git a/esphome/components/ld2420/select/operating_mode_select.cpp b/esphome/components/ld2420/select/operating_mode_select.cpp index 82939e18d3..6d9bb24cbc 100644 --- a/esphome/components/ld2420/select/operating_mode_select.cpp +++ b/esphome/components/ld2420/select/operating_mode_select.cpp @@ -4,7 +4,7 @@ namespace esphome::ld2420 { -static const char *const TAG = "ld2420.select"; +ESPHOME_LOG_TAG(TAG, "ld2420.select"); void LD2420Select::control(size_t index) { this->publish_state(index); diff --git a/esphome/components/ld2420/sensor/ld2420_sensor.cpp b/esphome/components/ld2420/sensor/ld2420_sensor.cpp index 02b5826f98..d8690a6898 100644 --- a/esphome/components/ld2420/sensor/ld2420_sensor.cpp +++ b/esphome/components/ld2420/sensor/ld2420_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::ld2420 { -static const char *const TAG = "ld2420.sensor"; +ESPHOME_LOG_TAG(TAG, "ld2420.sensor"); void LD2420Sensor::dump_config() { ESP_LOGCONFIG(TAG, "Sensor:"); diff --git a/esphome/components/ld2420/text_sensor/ld2420_text_sensor.cpp b/esphome/components/ld2420/text_sensor/ld2420_text_sensor.cpp index f7b016c9d9..a8360b1ccb 100644 --- a/esphome/components/ld2420/text_sensor/ld2420_text_sensor.cpp +++ b/esphome/components/ld2420/text_sensor/ld2420_text_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::ld2420 { -static const char *const TAG = "ld2420.text_sensor"; +ESPHOME_LOG_TAG(TAG, "ld2420.text_sensor"); void LD2420TextSensor::dump_config() { ESP_LOGCONFIG(TAG, "Text Sensor:"); diff --git a/esphome/components/ld2450/ld2450.cpp b/esphome/components/ld2450/ld2450.cpp index 4b41d63a88..b43493c26e 100644 --- a/esphome/components/ld2450/ld2450.cpp +++ b/esphome/components/ld2450/ld2450.cpp @@ -16,7 +16,7 @@ namespace esphome::ld2450 { -static const char *const TAG = "ld2450"; +ESPHOME_LOG_TAG(TAG, "ld2450"); enum BaudRate : uint8_t { BAUD_RATE_9600 = 1, diff --git a/esphome/components/ld6002b/ld6002b.cpp b/esphome/components/ld6002b/ld6002b.cpp index aa34ad9d39..fdf1b15d06 100644 --- a/esphome/components/ld6002b/ld6002b.cpp +++ b/esphome/components/ld6002b/ld6002b.cpp @@ -8,7 +8,7 @@ namespace esphome::ld6002b { -static const char *const TAG = "ld6002b"; +ESPHOME_LOG_TAG(TAG, "ld6002b"); static constexpr uint8_t TF_SOF = 0x01; static constexpr uint32_t SETUP_DELAY_MS = 100; diff --git a/esphome/components/ledc/ledc_output.cpp b/esphome/components/ledc/ledc_output.cpp index 62833a7649..18ce19a183 100644 --- a/esphome/components/ledc/ledc_output.cpp +++ b/esphome/components/ledc/ledc_output.cpp @@ -22,7 +22,7 @@ static const uint8_t SETUP_ATTEMPT_COUNT_MAX = 5; namespace esphome::ledc { -static const char *const TAG = "ledc.output"; +ESPHOME_LOG_TAG(TAG, "ledc.output"); static bool ledc_peripheral_reset_done = false; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) static const int MAX_RES_BITS = LEDC_TIMER_BIT_MAX - 1; diff --git a/esphome/components/libretiny/gpio_arduino.cpp b/esphome/components/libretiny/gpio_arduino.cpp index ca88835f69..ff333aacef 100644 --- a/esphome/components/libretiny/gpio_arduino.cpp +++ b/esphome/components/libretiny/gpio_arduino.cpp @@ -5,7 +5,7 @@ namespace esphome::libretiny { -static const char *const TAG = "libretiny.gpio"; +ESPHOME_LOG_TAG(TAG, "libretiny.gpio"); static int IRAM_ATTR flags_to_mode(gpio::Flags flags) { flags = diff --git a/esphome/components/libretiny/lt_component.cpp b/esphome/components/libretiny/lt_component.cpp index d7d93249c5..9cc7b5ff68 100644 --- a/esphome/components/libretiny/lt_component.cpp +++ b/esphome/components/libretiny/lt_component.cpp @@ -9,7 +9,7 @@ namespace esphome::libretiny { -static const char *const TAG = "libretiny"; +ESPHOME_LOG_TAG(TAG, "libretiny"); void LTComponent::dump_config() { ESP_LOGCONFIG(TAG, diff --git a/esphome/components/libretiny/preferences.cpp b/esphome/components/libretiny/preferences.cpp index d0bd3bf26b..a868e5042e 100644 --- a/esphome/components/libretiny/preferences.cpp +++ b/esphome/components/libretiny/preferences.cpp @@ -8,7 +8,7 @@ namespace esphome::libretiny { -static const char *const TAG = "preferences"; +ESPHOME_LOG_TAG(TAG, "preferences"); struct NVSData { uint32_t key; diff --git a/esphome/components/libretiny_pwm/libretiny_pwm.cpp b/esphome/components/libretiny_pwm/libretiny_pwm.cpp index eea593a39d..ee6fd5bb0e 100644 --- a/esphome/components/libretiny_pwm/libretiny_pwm.cpp +++ b/esphome/components/libretiny_pwm/libretiny_pwm.cpp @@ -5,7 +5,7 @@ namespace esphome::libretiny_pwm { -static const char *const TAG = "libretiny.pwm"; +ESPHOME_LOG_TAG(TAG, "libretiny.pwm"); void LibreTinyPWM::write_state(float state) { if (!this->initialized_) { diff --git a/esphome/components/light/addressable_light.cpp b/esphome/components/light/addressable_light.cpp index d2f5913f4b..a6440700fa 100644 --- a/esphome/components/light/addressable_light.cpp +++ b/esphome/components/light/addressable_light.cpp @@ -3,7 +3,7 @@ namespace esphome::light { -static const char *const TAG = "light.addressable"; +ESPHOME_LOG_TAG(TAG, "light.addressable"); void AddressableLight::call_setup() { this->setup(); diff --git a/esphome/components/light/automation.cpp b/esphome/components/light/automation.cpp index ddac2f9341..35aa035b26 100644 --- a/esphome/components/light/automation.cpp +++ b/esphome/components/light/automation.cpp @@ -3,7 +3,7 @@ namespace esphome::light { -static const char *const TAG = "light.automation"; +ESPHOME_LOG_TAG(TAG, "light.automation"); void addressableset_warn_about_scale(const char *field) { ESP_LOGW(TAG, "Lambda for parameter %s of light.addressable_set should return values in range 0-1 instead of 0-255.", diff --git a/esphome/components/light/light_call.cpp b/esphome/components/light/light_call.cpp index 7e54fccebc..5ad9215eed 100644 --- a/esphome/components/light/light_call.cpp +++ b/esphome/components/light/light_call.cpp @@ -8,7 +8,7 @@ namespace esphome::light { -static const char *const TAG = "light"; +ESPHOME_LOG_TAG(TAG, "light"); // Cold-path logger; caller handles the clamp so the in-range hot path avoids // the spill/reload around the call. diff --git a/esphome/components/light/light_state.cpp b/esphome/components/light/light_state.cpp index 1b9a7f94c1..9fe483a291 100644 --- a/esphome/components/light/light_state.cpp +++ b/esphome/components/light/light_state.cpp @@ -13,7 +13,7 @@ namespace esphome::light { -static const char *const TAG = "light"; +ESPHOME_LOG_TAG(TAG, "light"); // Colour modes are bitmasks of capabilities. A mode the light doesn't support may be a bare set of // required capabilities (see restore_state.py's colour mode inference): use the first supported diff --git a/esphome/components/lightwaverf/lightwaverf.cpp b/esphome/components/lightwaverf/lightwaverf.cpp index b8b6a9697e..58c4ab0784 100644 --- a/esphome/components/lightwaverf/lightwaverf.cpp +++ b/esphome/components/lightwaverf/lightwaverf.cpp @@ -7,7 +7,7 @@ namespace esphome::lightwaverf { -static const char *const TAG = "lightwaverf.sensor"; +ESPHOME_LOG_TAG(TAG, "lightwaverf.sensor"); static const uint8_t DEFAULT_REPEAT = 10; static const bool DEFAULT_INVERT = false; diff --git a/esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp b/esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp index 87319235e9..d76f4dfb39 100644 --- a/esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp +++ b/esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp @@ -5,7 +5,7 @@ namespace esphome::lilygo_t5_47 { -static const char *const TAG = "lilygo_t5_47.touchscreen"; +ESPHOME_LOG_TAG(TAG, "lilygo_t5_47.touchscreen"); static const uint8_t POWER_REGISTER = 0xD6; static const uint8_t TOUCH_REGISTER = 0xD0; diff --git a/esphome/components/lm75b/lm75b.cpp b/esphome/components/lm75b/lm75b.cpp index 2e8b9d3cfe..56e69faa62 100644 --- a/esphome/components/lm75b/lm75b.cpp +++ b/esphome/components/lm75b/lm75b.cpp @@ -4,7 +4,7 @@ namespace esphome::lm75b { -static const char *const TAG = "lm75b"; +ESPHOME_LOG_TAG(TAG, "lm75b"); void LM75BComponent::dump_config() { ESP_LOGCONFIG(TAG, "LM75B:"); diff --git a/esphome/components/ln882h_ble/ln882h_ble.cpp b/esphome/components/ln882h_ble/ln882h_ble.cpp index 0b15bf434c..8f569086de 100644 --- a/esphome/components/ln882h_ble/ln882h_ble.cpp +++ b/esphome/components/ln882h_ble/ln882h_ble.cpp @@ -178,7 +178,7 @@ __sprintf( // NOLINT(bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp,r namespace esphome::ln882h_ble { -static const char *const TAG = "ln882h_ble"; +ESPHOME_LOG_TAG(TAG, "ln882h_ble"); // The SDK event callback is a plain C function pointer with no user argument, // so it reaches the (single) component instance through a file-static pointer. diff --git a/esphome/components/ln882h_ble_tracker/ln882h_ble_tracker.cpp b/esphome/components/ln882h_ble_tracker/ln882h_ble_tracker.cpp index e1083e5fbe..34981560d2 100644 --- a/esphome/components/ln882h_ble_tracker/ln882h_ble_tracker.cpp +++ b/esphome/components/ln882h_ble_tracker/ln882h_ble_tracker.cpp @@ -9,7 +9,7 @@ namespace esphome::ln882h_ble_tracker { -static const char *const TAG = "ln882h_ble_tracker"; +ESPHOME_LOG_TAG(TAG, "ln882h_ble_tracker"); static constexpr float BLE_SCAN_UNIT_MS = 0.625f; diff --git a/esphome/components/lock/lock.cpp b/esphome/components/lock/lock.cpp index 66eb692bd5..aca3a3b024 100644 --- a/esphome/components/lock/lock.cpp +++ b/esphome/components/lock/lock.cpp @@ -6,7 +6,7 @@ namespace esphome::lock { -static const char *const TAG = "lock"; +ESPHOME_LOG_TAG(TAG, "lock"); // Lock state strings indexed by LockState enum. // Index 0 is UNKNOWN (for LOCK_STATE_NONE), also used as fallback for out-of-range diff --git a/esphome/components/logger/logger.cpp b/esphome/components/logger/logger.cpp index 2a0a1c9c0a..24a6586ae2 100644 --- a/esphome/components/logger/logger.cpp +++ b/esphome/components/logger/logger.cpp @@ -8,7 +8,7 @@ namespace esphome::logger { -static const char *const TAG = "logger"; +ESPHOME_LOG_TAG(TAG, "logger"); #if defined(USE_ESP32) || defined(USE_HOST) || defined(USE_LIBRETINY) || defined(USE_ZEPHYR) // Implementation for multi-threaded platforms (ESP32 with FreeRTOS, Host with pthreads, LibreTiny with FreeRTOS, diff --git a/esphome/components/logger/logger_esp32.cpp b/esphome/components/logger/logger_esp32.cpp index 8579708559..62d1a7468a 100644 --- a/esphome/components/logger/logger_esp32.cpp +++ b/esphome/components/logger/logger_esp32.cpp @@ -31,7 +31,7 @@ namespace esphome::logger { -static const char *const TAG = "logger"; +ESPHOME_LOG_TAG(TAG, "logger"); #ifdef USE_LOGGER_UART_SELECTION_USB_SERIAL_JTAG static void init_usb_serial_jtag() { diff --git a/esphome/components/logger/logger_esp8266.cpp b/esphome/components/logger/logger_esp8266.cpp index ac71ba8e3b..6822e8f590 100644 --- a/esphome/components/logger/logger_esp8266.cpp +++ b/esphome/components/logger/logger_esp8266.cpp @@ -8,7 +8,7 @@ namespace esphome::logger { -static const char *const TAG = "logger"; +ESPHOME_LOG_TAG(TAG, "logger"); void Logger::pre_setup() { #if defined(USE_ESP8266_LOGGER_SERIAL) diff --git a/esphome/components/logger/logger_libretiny.cpp b/esphome/components/logger/logger_libretiny.cpp index 9a322f751d..9abb2837fe 100644 --- a/esphome/components/logger/logger_libretiny.cpp +++ b/esphome/components/logger/logger_libretiny.cpp @@ -5,7 +5,7 @@ namespace esphome::logger { -static const char *const TAG = "logger"; +ESPHOME_LOG_TAG(TAG, "logger"); void Logger::pre_setup() { if (this->baud_rate_ > 0) { diff --git a/esphome/components/logger/logger_rp2.cpp b/esphome/components/logger/logger_rp2.cpp index b949d7ee16..518a1d7b1d 100644 --- a/esphome/components/logger/logger_rp2.cpp +++ b/esphome/components/logger/logger_rp2.cpp @@ -8,7 +8,7 @@ namespace esphome::logger { -static const char *const TAG = "logger"; +ESPHOME_LOG_TAG(TAG, "logger"); void Logger::pre_setup() { if (this->baud_rate_ > 0) { diff --git a/esphome/components/logger/logger_zephyr.cpp b/esphome/components/logger/logger_zephyr.cpp index 396728ceaf..95cc5d4a14 100644 --- a/esphome/components/logger/logger_zephyr.cpp +++ b/esphome/components/logger/logger_zephyr.cpp @@ -37,7 +37,7 @@ __attribute__((section(".noinit"))) struct { #endif } crash_buf; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) -static const char *const TAG = "logger"; +ESPHOME_LOG_TAG(TAG, "logger"); #ifdef USE_LOGGER_UART_SELECTION_USB_CDC void Logger::cdc_loop_() { diff --git a/esphome/components/lps22/lps22.cpp b/esphome/components/lps22/lps22.cpp index 020add695c..57f801c332 100644 --- a/esphome/components/lps22/lps22.cpp +++ b/esphome/components/lps22/lps22.cpp @@ -2,7 +2,7 @@ namespace esphome::lps22 { -static constexpr const char *const TAG = "lps22"; +ESPHOME_LOG_TAG(TAG, "lps22"); static constexpr uint8_t WHO_AM_I = 0x0F; static constexpr uint8_t LPS22HB_ID = 0xB1; diff --git a/esphome/components/lsm6ds/lsm6ds.cpp b/esphome/components/lsm6ds/lsm6ds.cpp index efdd241578..b02a610c0a 100644 --- a/esphome/components/lsm6ds/lsm6ds.cpp +++ b/esphome/components/lsm6ds/lsm6ds.cpp @@ -4,7 +4,7 @@ namespace esphome::lsm6ds { -static const char *const TAG = "lsm6ds"; +ESPHOME_LOG_TAG(TAG, "lsm6ds"); static const struct { uint8_t who_am_i; diff --git a/esphome/components/ltr390/ltr390.cpp b/esphome/components/ltr390/ltr390.cpp index dd78b20f2c..d9699afe5a 100644 --- a/esphome/components/ltr390/ltr390.cpp +++ b/esphome/components/ltr390/ltr390.cpp @@ -5,7 +5,7 @@ namespace esphome::ltr390 { -static const char *const TAG = "ltr390"; +ESPHOME_LOG_TAG(TAG, "ltr390"); static const uint8_t LTR390_WAKEUP_TIME = 10; static const uint8_t LTR390_SETTLE_TIME = 5; diff --git a/esphome/components/ltr501/ltr501.cpp b/esphome/components/ltr501/ltr501.cpp index afdc271167..91fca7fa9b 100644 --- a/esphome/components/ltr501/ltr501.cpp +++ b/esphome/components/ltr501/ltr501.cpp @@ -8,7 +8,7 @@ using esphome::i2c::ErrorCode; namespace esphome::ltr501 { -static const char *const TAG = "ltr501"; +ESPHOME_LOG_TAG(TAG, "ltr501"); static const uint8_t MAX_TRIES = 5; static const uint8_t MAX_SENSITIVITY_ADJUSTMENTS = 10; diff --git a/esphome/components/ltr_als_ps/ltr_als_ps.cpp b/esphome/components/ltr_als_ps/ltr_als_ps.cpp index 0d43aac20e..2d3b3755ad 100644 --- a/esphome/components/ltr_als_ps/ltr_als_ps.cpp +++ b/esphome/components/ltr_als_ps/ltr_als_ps.cpp @@ -8,7 +8,7 @@ using esphome::i2c::ErrorCode; namespace esphome::ltr_als_ps { -static const char *const TAG = "ltr_als_ps"; +ESPHOME_LOG_TAG(TAG, "ltr_als_ps"); static const uint8_t MAX_TRIES = 5; diff --git a/esphome/components/lvgl/lvgl_esphome.cpp b/esphome/components/lvgl/lvgl_esphome.cpp index 466d400023..e35cc0c48b 100644 --- a/esphome/components/lvgl/lvgl_esphome.cpp +++ b/esphome/components/lvgl/lvgl_esphome.cpp @@ -13,7 +13,7 @@ static void *lv_alloc_draw_buf(size_t size, bool internal); static void *draw_buf_alloc_cb(size_t size, lv_color_format_t color_format) { return lv_alloc_draw_buf(size, false); }; namespace esphome::lvgl { -static const char *const TAG = "lvgl"; +ESPHOME_LOG_TAG(TAG, "lvgl"); static const size_t MIN_BUFFER_FRAC = 8; // buffer must be at least 1/8 of the display size static const size_t MIN_BUFFER_SIZE = 2048; // Sensible minimum buffer size diff --git a/esphome/components/m5stack_8angle/light/m5stack_8angle_light.cpp b/esphome/components/m5stack_8angle/light/m5stack_8angle_light.cpp index e132c54daa..65b5816e46 100644 --- a/esphome/components/m5stack_8angle/light/m5stack_8angle_light.cpp +++ b/esphome/components/m5stack_8angle/light/m5stack_8angle_light.cpp @@ -4,7 +4,7 @@ namespace esphome::m5stack_8angle { -static const char *const TAG = "m5stack_8angle.light"; +ESPHOME_LOG_TAG(TAG, "m5stack_8angle.light"); void M5Stack8AngleLightOutput::setup() { RAMAllocator allocator; diff --git a/esphome/components/m5stack_8angle/m5stack_8angle.cpp b/esphome/components/m5stack_8angle/m5stack_8angle.cpp index f466fba77e..06f9b90af9 100644 --- a/esphome/components/m5stack_8angle/m5stack_8angle.cpp +++ b/esphome/components/m5stack_8angle/m5stack_8angle.cpp @@ -4,7 +4,7 @@ namespace esphome::m5stack_8angle { -static const char *const TAG = "m5stack_8angle"; +ESPHOME_LOG_TAG(TAG, "m5stack_8angle"); void M5Stack8AngleComponent::setup() { i2c::ErrorCode err; diff --git a/esphome/components/matrix_keypad/matrix_keypad.cpp b/esphome/components/matrix_keypad/matrix_keypad.cpp index 97641ac2d3..e0f19ca165 100644 --- a/esphome/components/matrix_keypad/matrix_keypad.cpp +++ b/esphome/components/matrix_keypad/matrix_keypad.cpp @@ -4,7 +4,7 @@ namespace esphome::matrix_keypad { -static const char *const TAG = "matrix_keypad"; +ESPHOME_LOG_TAG(TAG, "matrix_keypad"); void MatrixKeypad::setup() { for (auto *pin : this->rows_) { diff --git a/esphome/components/max17043/max17043.cpp b/esphome/components/max17043/max17043.cpp index 8776bb5558..a15658512b 100644 --- a/esphome/components/max17043/max17043.cpp +++ b/esphome/components/max17043/max17043.cpp @@ -6,7 +6,7 @@ namespace esphome::max17043 { // MAX174043 is a 1-Cell Fuel Gauge with ModelGauge and Low-Battery Alert // Consult the datasheet at https://www.analog.com/en/products/max17043.html -static const char *const TAG = "max17043"; +ESPHOME_LOG_TAG(TAG, "max17043"); static const uint8_t MAX17043_VCELL = 0x02; static const uint8_t MAX17043_SOC = 0x04; diff --git a/esphome/components/max31855/max31855.cpp b/esphome/components/max31855/max31855.cpp index ac6b3cecb4..3d681e4923 100644 --- a/esphome/components/max31855/max31855.cpp +++ b/esphome/components/max31855/max31855.cpp @@ -5,7 +5,7 @@ namespace esphome::max31855 { -static const char *const TAG = "max31855"; +ESPHOME_LOG_TAG(TAG, "max31855"); void MAX31855Sensor::update() { this->enable(); diff --git a/esphome/components/max31856/max31856.cpp b/esphome/components/max31856/max31856.cpp index b5bad8ef74..5612a4cbf7 100644 --- a/esphome/components/max31856/max31856.cpp +++ b/esphome/components/max31856/max31856.cpp @@ -5,7 +5,7 @@ namespace esphome::max31856 { -static const char *const TAG = "max31856"; +ESPHOME_LOG_TAG(TAG, "max31856"); // Based on Adafruit's library: https://github.com/adafruit/Adafruit_MAX31856 diff --git a/esphome/components/max31865/max31865.cpp b/esphome/components/max31865/max31865.cpp index e5a6fca8fb..b637d6dbfc 100644 --- a/esphome/components/max31865/max31865.cpp +++ b/esphome/components/max31865/max31865.cpp @@ -6,7 +6,7 @@ namespace esphome::max31865 { -static const char *const TAG = "max31865"; +ESPHOME_LOG_TAG(TAG, "max31865"); void MAX31865Sensor::update() { // Check new faults since last measurement diff --git a/esphome/components/max44009/max44009.cpp b/esphome/components/max44009/max44009.cpp index 731f584056..b616b9032e 100644 --- a/esphome/components/max44009/max44009.cpp +++ b/esphome/components/max44009/max44009.cpp @@ -4,7 +4,7 @@ namespace esphome::max44009 { -static const char *const TAG = "max44009.sensor"; +ESPHOME_LOG_TAG(TAG, "max44009.sensor"); // REGISTERS static constexpr uint8_t MAX44009_REGISTER_CONFIGURATION = 0x02; diff --git a/esphome/components/max6675/max6675.cpp b/esphome/components/max6675/max6675.cpp index 8734405508..ad0c470e33 100644 --- a/esphome/components/max6675/max6675.cpp +++ b/esphome/components/max6675/max6675.cpp @@ -3,7 +3,7 @@ namespace esphome::max6675 { -static const char *const TAG = "max6675"; +ESPHOME_LOG_TAG(TAG, "max6675"); void MAX6675Sensor::update() { this->enable(); diff --git a/esphome/components/max6956/max6956.cpp b/esphome/components/max6956/max6956.cpp index ccb14496aa..7060a8c76b 100644 --- a/esphome/components/max6956/max6956.cpp +++ b/esphome/components/max6956/max6956.cpp @@ -3,7 +3,7 @@ namespace esphome::max6956 { -static const char *const TAG = "max6956"; +ESPHOME_LOG_TAG(TAG, "max6956"); /// Masks for MAX6956 Configuration register const uint32_t MASK_TRANSITION_DETECTION = 0x80; diff --git a/esphome/components/max6956/output/max6956_led_output.cpp b/esphome/components/max6956/output/max6956_led_output.cpp index c53a429d20..e3c9c1e827 100644 --- a/esphome/components/max6956/output/max6956_led_output.cpp +++ b/esphome/components/max6956/output/max6956_led_output.cpp @@ -4,7 +4,7 @@ namespace esphome::max6956 { -static const char *const TAG = "max6956_led_channel"; +ESPHOME_LOG_TAG(TAG, "max6956_led_channel"); void MAX6956LedChannel::write_state(float state) { this->parent_->set_pin_brightness(this->pin_, state); } diff --git a/esphome/components/max7219/max7219.cpp b/esphome/components/max7219/max7219.cpp index bec62ea005..d755dd1a22 100644 --- a/esphome/components/max7219/max7219.cpp +++ b/esphome/components/max7219/max7219.cpp @@ -5,7 +5,7 @@ namespace esphome::max7219 { -static const char *const TAG = "max7219"; +ESPHOME_LOG_TAG(TAG, "max7219"); static const uint8_t MAX7219_REGISTER_NOOP = 0x00; static const uint8_t MAX7219_REGISTER_DECODE_MODE = 0x09; diff --git a/esphome/components/max7219digit/max7219digit.cpp b/esphome/components/max7219digit/max7219digit.cpp index 26c65aa5d3..178a6fa23a 100644 --- a/esphome/components/max7219digit/max7219digit.cpp +++ b/esphome/components/max7219digit/max7219digit.cpp @@ -10,7 +10,7 @@ namespace esphome::max7219digit { -static const char *const TAG = "max7219DIGIT"; +ESPHOME_LOG_TAG(TAG, "max7219DIGIT"); static const uint8_t MAX7219_REGISTER_NOOP = 0x00; static const uint8_t MAX7219_REGISTER_DECODE_MODE = 0x09; diff --git a/esphome/components/max9611/max9611.cpp b/esphome/components/max9611/max9611.cpp index 68ef7c3135..420eb7da7c 100644 --- a/esphome/components/max9611/max9611.cpp +++ b/esphome/components/max9611/max9611.cpp @@ -24,7 +24,7 @@ float gain_to_lsb(MAX9611Multiplexer gain) { } return lsb; } -static const char *const TAG = "max9611"; +ESPHOME_LOG_TAG(TAG, "max9611"); static const uint8_t SETUP_DELAY = 4; // Wait 2 integration periods. static const float VOUT_LSB = 14.0 / 1000.0; // 14mV/LSB static const float TEMP_LSB = 0.48; // 0.48C/LSB diff --git a/esphome/components/mcp23008/mcp23008.cpp b/esphome/components/mcp23008/mcp23008.cpp index 6be5f4c951..3d2eb618d6 100644 --- a/esphome/components/mcp23008/mcp23008.cpp +++ b/esphome/components/mcp23008/mcp23008.cpp @@ -3,7 +3,7 @@ namespace esphome::mcp23008 { -static const char *const TAG = "mcp23008"; +ESPHOME_LOG_TAG(TAG, "mcp23008"); static constexpr uint8_t IOCON_ODR = 0x04; // Open-drain output for INT pin diff --git a/esphome/components/mcp23016/mcp23016.cpp b/esphome/components/mcp23016/mcp23016.cpp index 126ece3e7b..13d930fd47 100644 --- a/esphome/components/mcp23016/mcp23016.cpp +++ b/esphome/components/mcp23016/mcp23016.cpp @@ -4,7 +4,7 @@ namespace esphome::mcp23016 { -static const char *const TAG = "mcp23016"; +ESPHOME_LOG_TAG(TAG, "mcp23016"); void MCP23016::setup() { uint16_t iocon; diff --git a/esphome/components/mcp23017/mcp23017.cpp b/esphome/components/mcp23017/mcp23017.cpp index 173d117457..9cad032447 100644 --- a/esphome/components/mcp23017/mcp23017.cpp +++ b/esphome/components/mcp23017/mcp23017.cpp @@ -3,7 +3,7 @@ namespace esphome::mcp23017 { -static const char *const TAG = "mcp23017"; +ESPHOME_LOG_TAG(TAG, "mcp23017"); static constexpr uint8_t IOCON_MIRROR = 0x40; // Mirror INTA/INTB pins static constexpr uint8_t IOCON_ODR = 0x04; // Open-drain output for INT pin diff --git a/esphome/components/mcp23s08/mcp23s08.cpp b/esphome/components/mcp23s08/mcp23s08.cpp index e7f582f787..341951f119 100644 --- a/esphome/components/mcp23s08/mcp23s08.cpp +++ b/esphome/components/mcp23s08/mcp23s08.cpp @@ -3,7 +3,7 @@ namespace esphome::mcp23s08 { -static const char *const TAG = "mcp23s08"; +ESPHOME_LOG_TAG(TAG, "mcp23s08"); // IOCON register bits static constexpr uint8_t IOCON_SEQOP = 0x20; // Sequential operation mode diff --git a/esphome/components/mcp23s17/mcp23s17.cpp b/esphome/components/mcp23s17/mcp23s17.cpp index 652931e9a9..534327f401 100644 --- a/esphome/components/mcp23s17/mcp23s17.cpp +++ b/esphome/components/mcp23s17/mcp23s17.cpp @@ -3,7 +3,7 @@ namespace esphome::mcp23s17 { -static const char *const TAG = "mcp23s17"; +ESPHOME_LOG_TAG(TAG, "mcp23s17"); // IOCON register bits static constexpr uint8_t IOCON_SEQOP = 0x20; // Sequential operation mode diff --git a/esphome/components/mcp23x08_base/mcp23x08_base.cpp b/esphome/components/mcp23x08_base/mcp23x08_base.cpp index 98fd2f6249..0cda5dac4a 100644 --- a/esphome/components/mcp23x08_base/mcp23x08_base.cpp +++ b/esphome/components/mcp23x08_base/mcp23x08_base.cpp @@ -3,7 +3,7 @@ namespace esphome::mcp23x08_base { -static const char *const TAG = "mcp23x08_base"; +ESPHOME_LOG_TAG(TAG, "mcp23x08_base"); bool MCP23X08Base::digital_read_hw(uint8_t pin) { if (!this->read_reg(mcp23x08_base::MCP23X08_GPIO, &this->input_mask_)) { diff --git a/esphome/components/mcp23x17_base/mcp23x17_base.cpp b/esphome/components/mcp23x17_base/mcp23x17_base.cpp index 870c6c165f..7ae17b1c13 100644 --- a/esphome/components/mcp23x17_base/mcp23x17_base.cpp +++ b/esphome/components/mcp23x17_base/mcp23x17_base.cpp @@ -4,7 +4,7 @@ namespace esphome::mcp23x17_base { -static const char *const TAG = "mcp23x17_base"; +ESPHOME_LOG_TAG(TAG, "mcp23x17_base"); bool MCP23X17Base::digital_read_hw(uint8_t pin) { uint8_t data; diff --git a/esphome/components/mcp2515/mcp2515.cpp b/esphome/components/mcp2515/mcp2515.cpp index f8c5e9f068..8a1973d022 100644 --- a/esphome/components/mcp2515/mcp2515.cpp +++ b/esphome/components/mcp2515/mcp2515.cpp @@ -3,7 +3,7 @@ namespace esphome::mcp2515 { -static const char *const TAG = "mcp2515"; +ESPHOME_LOG_TAG(TAG, "mcp2515"); const struct MCP2515::TxBnRegs MCP2515::TXB[N_TXBUFFERS] = {{MCP_TXB0CTRL, MCP_TXB0SIDH, MCP_TXB0DATA}, {MCP_TXB1CTRL, MCP_TXB1SIDH, MCP_TXB1DATA}, diff --git a/esphome/components/mcp3008/mcp3008.cpp b/esphome/components/mcp3008/mcp3008.cpp index e65e249f52..2ee6ce5b9b 100644 --- a/esphome/components/mcp3008/mcp3008.cpp +++ b/esphome/components/mcp3008/mcp3008.cpp @@ -5,7 +5,7 @@ namespace esphome::mcp3008 { -static const char *const TAG = "mcp3008"; +ESPHOME_LOG_TAG(TAG, "mcp3008"); float MCP3008::get_setup_priority() const { return setup_priority::HARDWARE; } diff --git a/esphome/components/mcp3008/sensor/mcp3008_sensor.cpp b/esphome/components/mcp3008/sensor/mcp3008_sensor.cpp index 2647ed199e..3a119f7d2a 100644 --- a/esphome/components/mcp3008/sensor/mcp3008_sensor.cpp +++ b/esphome/components/mcp3008/sensor/mcp3008_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::mcp3008 { -static const char *const TAG = "mcp3008.sensor"; +ESPHOME_LOG_TAG(TAG, "mcp3008.sensor"); void MCP3008Sensor::dump_config() { ESP_LOGCONFIG(TAG, diff --git a/esphome/components/mcp3204/mcp3204.cpp b/esphome/components/mcp3204/mcp3204.cpp index ef8b568453..dddc043f0e 100644 --- a/esphome/components/mcp3204/mcp3204.cpp +++ b/esphome/components/mcp3204/mcp3204.cpp @@ -3,7 +3,7 @@ namespace esphome::mcp3204 { -static const char *const TAG = "mcp3204"; +ESPHOME_LOG_TAG(TAG, "mcp3204"); float MCP3204::get_setup_priority() const { return setup_priority::HARDWARE; } diff --git a/esphome/components/mcp3204/sensor/mcp3204_sensor.cpp b/esphome/components/mcp3204/sensor/mcp3204_sensor.cpp index 153c37d160..188d7a1dfc 100644 --- a/esphome/components/mcp3204/sensor/mcp3204_sensor.cpp +++ b/esphome/components/mcp3204/sensor/mcp3204_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::mcp3204 { -static const char *const TAG = "mcp3204.sensor"; +ESPHOME_LOG_TAG(TAG, "mcp3204.sensor"); void MCP3204Sensor::dump_config() { LOG_SENSOR("", "MCP3204 Sensor", this); diff --git a/esphome/components/mcp3221/mcp3221_sensor.cpp b/esphome/components/mcp3221/mcp3221_sensor.cpp index 1b794ba966..d38883c342 100644 --- a/esphome/components/mcp3221/mcp3221_sensor.cpp +++ b/esphome/components/mcp3221/mcp3221_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::mcp3221 { -static const char *const TAG = "mcp3221"; +ESPHOME_LOG_TAG(TAG, "mcp3221"); float MCP3221Sensor::sample() { uint8_t data[2]; diff --git a/esphome/components/mcp4461/mcp4461.cpp b/esphome/components/mcp4461/mcp4461.cpp index cc53f9de7f..b6e8c24702 100644 --- a/esphome/components/mcp4461/mcp4461.cpp +++ b/esphome/components/mcp4461/mcp4461.cpp @@ -5,7 +5,7 @@ namespace esphome::mcp4461 { -static const char *const TAG = "mcp4461"; +ESPHOME_LOG_TAG(TAG, "mcp4461"); constexpr uint8_t EEPROM_WRITE_TIMEOUT_MS = 10; void Mcp4461Component::setup() { diff --git a/esphome/components/mcp4461/output/mcp4461_output.cpp b/esphome/components/mcp4461/output/mcp4461_output.cpp index d38eed4d09..6c1ab99e29 100644 --- a/esphome/components/mcp4461/output/mcp4461_output.cpp +++ b/esphome/components/mcp4461/output/mcp4461_output.cpp @@ -6,7 +6,7 @@ namespace esphome::mcp4461 { -static const char *const TAG = "mcp4461.output"; +ESPHOME_LOG_TAG(TAG, "mcp4461.output"); // public set_level function void Mcp4461Wiper::set_level(float state) { diff --git a/esphome/components/mcp4725/mcp4725.cpp b/esphome/components/mcp4725/mcp4725.cpp index 8e94623de3..faa377b8de 100644 --- a/esphome/components/mcp4725/mcp4725.cpp +++ b/esphome/components/mcp4725/mcp4725.cpp @@ -3,7 +3,7 @@ namespace esphome::mcp4725 { -static const char *const TAG = "mcp4725"; +ESPHOME_LOG_TAG(TAG, "mcp4725"); void MCP4725::setup() { auto err = this->write(nullptr, 0); diff --git a/esphome/components/mcp4728/mcp4728.cpp b/esphome/components/mcp4728/mcp4728.cpp index 1b15ca0510..7259a0a89e 100644 --- a/esphome/components/mcp4728/mcp4728.cpp +++ b/esphome/components/mcp4728/mcp4728.cpp @@ -5,7 +5,7 @@ namespace esphome::mcp4728 { -static const char *const TAG = "mcp4728"; +ESPHOME_LOG_TAG(TAG, "mcp4728"); void MCP4728Component::setup() { auto err = this->write(nullptr, 0); diff --git a/esphome/components/mcp47a1/mcp47a1.cpp b/esphome/components/mcp47a1/mcp47a1.cpp index e2b0fa5575..8bbde59006 100644 --- a/esphome/components/mcp47a1/mcp47a1.cpp +++ b/esphome/components/mcp47a1/mcp47a1.cpp @@ -4,7 +4,7 @@ namespace esphome::mcp47a1 { -static const char *const TAG = "mcp47a1"; +ESPHOME_LOG_TAG(TAG, "mcp47a1"); void MCP47A1::dump_config() { ESP_LOGCONFIG(TAG, "MCP47A1 Output:"); diff --git a/esphome/components/mcp9600/mcp9600.cpp b/esphome/components/mcp9600/mcp9600.cpp index 0e9b472be2..70e7cb176d 100644 --- a/esphome/components/mcp9600/mcp9600.cpp +++ b/esphome/components/mcp9600/mcp9600.cpp @@ -3,7 +3,7 @@ namespace esphome::mcp9600 { -static const char *const TAG = "mcp9600"; +ESPHOME_LOG_TAG(TAG, "mcp9600"); static const uint8_t MCP9600_REGISTER_HOT_JUNCTION = 0x00; // static const uint8_t MCP9600_REGISTER_JUNCTION_DELTA = 0x01; // Unused, but kept for future reference diff --git a/esphome/components/mcp9808/mcp9808.cpp b/esphome/components/mcp9808/mcp9808.cpp index 10e26ed709..47df37f456 100644 --- a/esphome/components/mcp9808/mcp9808.cpp +++ b/esphome/components/mcp9808/mcp9808.cpp @@ -14,7 +14,7 @@ static const uint8_t MCP9808_AMBIENT_CLEAR_FLAGS = 0x1F; static const uint8_t MCP9808_AMBIENT_CLEAR_SIGN = 0x0F; static const uint8_t MCP9808_AMBIENT_TEMP_NEGATIVE = 0x10; -static const char *const TAG = "mcp9808"; +ESPHOME_LOG_TAG(TAG, "mcp9808"); void MCP9808Sensor::setup() { uint16_t manu = 0; diff --git a/esphome/components/mdns/mdns_component.cpp b/esphome/components/mdns/mdns_component.cpp index 4f236153c2..4397c101fc 100644 --- a/esphome/components/mdns/mdns_component.cpp +++ b/esphome/components/mdns/mdns_component.cpp @@ -23,7 +23,7 @@ namespace esphome::mdns { -static const char *const TAG = "mdns"; +ESPHOME_LOG_TAG(TAG, "mdns"); #ifndef USE_WEBSERVER_PORT #define USE_WEBSERVER_PORT 80 // NOLINT diff --git a/esphome/components/mdns/mdns_esp32.cpp b/esphome/components/mdns/mdns_esp32.cpp index 48df61326e..1df5b9217e 100644 --- a/esphome/components/mdns/mdns_esp32.cpp +++ b/esphome/components/mdns/mdns_esp32.cpp @@ -10,7 +10,7 @@ namespace esphome::mdns { -static const char *const TAG = "mdns"; +ESPHOME_LOG_TAG(TAG, "mdns"); #ifndef USE_OPENTHREAD static esp_err_t add_service(const MDNSService &service) { diff --git a/esphome/components/media_player/media_player.cpp b/esphome/components/media_player/media_player.cpp index 6c3eef912e..423832dd2f 100644 --- a/esphome/components/media_player/media_player.cpp +++ b/esphome/components/media_player/media_player.cpp @@ -6,7 +6,7 @@ namespace esphome::media_player { -static const char *const TAG = "media_player"; +ESPHOME_LOG_TAG(TAG, "media_player"); const char *media_player_state_to_string(MediaPlayerState state) { switch (state) { diff --git a/esphome/components/mhz19/mhz19.cpp b/esphome/components/mhz19/mhz19.cpp index 707d952f83..5be6da88ef 100644 --- a/esphome/components/mhz19/mhz19.cpp +++ b/esphome/components/mhz19/mhz19.cpp @@ -5,7 +5,7 @@ namespace esphome::mhz19 { -static const char *const TAG = "mhz19"; +ESPHOME_LOG_TAG(TAG, "mhz19"); static const uint8_t MHZ19_REQUEST_LENGTH = 8; static const uint8_t MHZ19_RESPONSE_LENGTH = 9; static const uint8_t MHZ19_COMMAND_GET_PPM[] = {0xFF, 0x01, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00}; diff --git a/esphome/components/micro_wake_word/micro_wake_word.cpp b/esphome/components/micro_wake_word/micro_wake_word.cpp index cf239be696..9ad19f66d5 100644 --- a/esphome/components/micro_wake_word/micro_wake_word.cpp +++ b/esphome/components/micro_wake_word/micro_wake_word.cpp @@ -17,7 +17,7 @@ namespace esphome::micro_wake_word { -static const char *const TAG = "micro_wake_word"; +ESPHOME_LOG_TAG(TAG, "micro_wake_word"); static const ssize_t DETECTION_QUEUE_LENGTH = 5; diff --git a/esphome/components/micro_wake_word/model_data.cpp b/esphome/components/micro_wake_word/model_data.cpp index c235e290ec..ace0d9770a 100644 --- a/esphome/components/micro_wake_word/model_data.cpp +++ b/esphome/components/micro_wake_word/model_data.cpp @@ -10,7 +10,7 @@ namespace esphome::micro_wake_word { -static const char *const TAG = "micro_wake_word"; +ESPHOME_LOG_TAG(TAG, "micro_wake_word"); ModelData::~ModelData() { this->deallocate_(); } diff --git a/esphome/components/micro_wake_word/streaming_model.cpp b/esphome/components/micro_wake_word/streaming_model.cpp index 72984f04fb..7cbd11711a 100644 --- a/esphome/components/micro_wake_word/streaming_model.cpp +++ b/esphome/components/micro_wake_word/streaming_model.cpp @@ -5,7 +5,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -static const char *const TAG = "micro_wake_word"; +ESPHOME_LOG_TAG(TAG, "micro_wake_word"); namespace esphome::micro_wake_word { diff --git a/esphome/components/micronova/button/micronova_button.cpp b/esphome/components/micronova/button/micronova_button.cpp index 13c0e1f117..159dee2d20 100644 --- a/esphome/components/micronova/button/micronova_button.cpp +++ b/esphome/components/micronova/button/micronova_button.cpp @@ -2,7 +2,7 @@ namespace esphome::micronova { -static const char *const TAG = "micronova.button"; +ESPHOME_LOG_TAG(TAG, "micronova.button"); void MicroNovaButton::dump_config() { LOG_BUTTON("", "Micronova button", this); diff --git a/esphome/components/micronova/micronova.cpp b/esphome/components/micronova/micronova.cpp index c2e3ef8640..86b340d5e4 100644 --- a/esphome/components/micronova/micronova.cpp +++ b/esphome/components/micronova/micronova.cpp @@ -3,7 +3,7 @@ namespace esphome::micronova { -static const char *const TAG = "micronova"; +ESPHOME_LOG_TAG(TAG, "micronova"); static constexpr uint8_t STOVE_REPLY_SIZE = 2; static constexpr uint32_t STOVE_REPLY_TIMEOUT = 200; // ms static constexpr uint8_t WRITE_BIT = 1 << 7; // 0x80 diff --git a/esphome/components/micronova/number/micronova_number.cpp b/esphome/components/micronova/number/micronova_number.cpp index 02a6de1c84..6ce2d51d7f 100644 --- a/esphome/components/micronova/number/micronova_number.cpp +++ b/esphome/components/micronova/number/micronova_number.cpp @@ -2,7 +2,7 @@ namespace esphome::micronova { -static const char *const TAG = "micronova.number"; +ESPHOME_LOG_TAG(TAG, "micronova.number"); void MicroNovaNumber::dump_config() { LOG_NUMBER("", "Micronova number", this); diff --git a/esphome/components/micronova/sensor/micronova_sensor.cpp b/esphome/components/micronova/sensor/micronova_sensor.cpp index 8d528145cd..f53c80fbb8 100644 --- a/esphome/components/micronova/sensor/micronova_sensor.cpp +++ b/esphome/components/micronova/sensor/micronova_sensor.cpp @@ -2,7 +2,7 @@ namespace esphome::micronova { -static const char *const TAG = "micronova.sensor"; +ESPHOME_LOG_TAG(TAG, "micronova.sensor"); void MicroNovaSensor::dump_config() { LOG_SENSOR("", "Micronova sensor", this); diff --git a/esphome/components/micronova/switch/micronova_switch.cpp b/esphome/components/micronova/switch/micronova_switch.cpp index d01cc57254..ba74e68eff 100644 --- a/esphome/components/micronova/switch/micronova_switch.cpp +++ b/esphome/components/micronova/switch/micronova_switch.cpp @@ -2,7 +2,7 @@ namespace esphome::micronova { -static const char *const TAG = "micronova.switch"; +ESPHOME_LOG_TAG(TAG, "micronova.switch"); void MicroNovaSwitch::dump_config() { LOG_SWITCH("", "Micronova switch", this); diff --git a/esphome/components/micronova/text_sensor/micronova_text_sensor.cpp b/esphome/components/micronova/text_sensor/micronova_text_sensor.cpp index 50a0d34b3a..28f755389f 100644 --- a/esphome/components/micronova/text_sensor/micronova_text_sensor.cpp +++ b/esphome/components/micronova/text_sensor/micronova_text_sensor.cpp @@ -2,7 +2,7 @@ namespace esphome::micronova { -static const char *const TAG = "micronova.text_sensor"; +ESPHOME_LOG_TAG(TAG, "micronova.text_sensor"); void MicroNovaTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Micronova text sensor", this); diff --git a/esphome/components/mics_4514/mics_4514.cpp b/esphome/components/mics_4514/mics_4514.cpp index 14a73bc15f..d4794b6682 100644 --- a/esphome/components/mics_4514/mics_4514.cpp +++ b/esphome/components/mics_4514/mics_4514.cpp @@ -5,7 +5,7 @@ namespace esphome::mics_4514 { -static const char *const TAG = "mics_4514"; +ESPHOME_LOG_TAG(TAG, "mics_4514"); static const uint8_t SENSOR_REGISTER = 0x04; static const uint8_t POWER_MODE_REGISTER = 0x0a; diff --git a/esphome/components/midea_ir/midea_ir.cpp b/esphome/components/midea_ir/midea_ir.cpp index de25c4652c..55f84e058f 100644 --- a/esphome/components/midea_ir/midea_ir.cpp +++ b/esphome/components/midea_ir/midea_ir.cpp @@ -6,7 +6,7 @@ namespace esphome::midea_ir { -static const char *const TAG = "midea_ir.climate"; +ESPHOME_LOG_TAG(TAG, "midea_ir.climate"); void ControlData::set_temp(float temp) { uint8_t min; diff --git a/esphome/components/mitsubishi/mitsubishi.cpp b/esphome/components/mitsubishi/mitsubishi.cpp index 9cb355fe9c..dabd62b8f1 100644 --- a/esphome/components/mitsubishi/mitsubishi.cpp +++ b/esphome/components/mitsubishi/mitsubishi.cpp @@ -4,7 +4,7 @@ namespace esphome::mitsubishi { -static const char *const TAG = "mitsubishi.climate"; +ESPHOME_LOG_TAG(TAG, "mitsubishi.climate"); // IR frame size for Mitsubishi climate static constexpr size_t MITSUBISHI_FRAME_SIZE = 18; diff --git a/esphome/components/mitsubishi_cn105/mitsubishi_cn105.cpp b/esphome/components/mitsubishi_cn105/mitsubishi_cn105.cpp index 3d30d1a25f..c6c7b57c5f 100644 --- a/esphome/components/mitsubishi_cn105/mitsubishi_cn105.cpp +++ b/esphome/components/mitsubishi_cn105/mitsubishi_cn105.cpp @@ -8,7 +8,7 @@ namespace esphome::mitsubishi_cn105 { -static const char *const TAG = "mitsubishi_cn105.driver"; +ESPHOME_LOG_TAG(TAG, "mitsubishi_cn105.driver"); static constexpr uint32_t RESPONSE_TIMEOUT_MS = 2000; diff --git a/esphome/components/mitsubishi_cn105/mitsubishi_cn105_climate.cpp b/esphome/components/mitsubishi_cn105/mitsubishi_cn105_climate.cpp index 53b8c21de6..70c5d479a3 100644 --- a/esphome/components/mitsubishi_cn105/mitsubishi_cn105_climate.cpp +++ b/esphome/components/mitsubishi_cn105/mitsubishi_cn105_climate.cpp @@ -4,7 +4,7 @@ namespace esphome::mitsubishi_cn105 { -static const char *const TAG = "mitsubishi_cn105.climate"; +ESPHOME_LOG_TAG(TAG, "mitsubishi_cn105.climate"); static constexpr std::array MODE_MAP{ std::pair{MitsubishiCN105::Mode::AUTO, climate::CLIMATE_MODE_HEAT_COOL}, diff --git a/esphome/components/mitsubishi_cn105/mitsubishi_cn105_component.cpp b/esphome/components/mitsubishi_cn105/mitsubishi_cn105_component.cpp index e2a6ee05af..e3222ecf53 100644 --- a/esphome/components/mitsubishi_cn105/mitsubishi_cn105_component.cpp +++ b/esphome/components/mitsubishi_cn105/mitsubishi_cn105_component.cpp @@ -6,7 +6,7 @@ namespace esphome::mitsubishi_cn105 { -static const char *const TAG = "mitsubishi_cn105"; +ESPHOME_LOG_TAG(TAG, "mitsubishi_cn105"); void MitsubishiCN105Component::dump_config() { ESP_LOGCONFIG(TAG, "Mitsubishi CN105:"); diff --git a/esphome/components/mixer/speaker/mixer_speaker.cpp b/esphome/components/mixer/speaker/mixer_speaker.cpp index 41b7123269..dbe0799163 100644 --- a/esphome/components/mixer/speaker/mixer_speaker.cpp +++ b/esphome/components/mixer/speaker/mixer_speaker.cpp @@ -24,7 +24,7 @@ static const uint32_t MIXER_AUTO_STOP_DEBOUNCE_MS = 200; static const size_t TASK_STACK_SIZE = 4096; -static const char *const TAG = "speaker_mixer"; +ESPHOME_LOG_TAG(TAG, "speaker_mixer"); // Event bits for SourceSpeaker command processing enum SourceSpeakerEventBits : uint32_t { diff --git a/esphome/components/mk2pvrouter/binary_sensor/mk2pvrouter_binary_sensor.cpp b/esphome/components/mk2pvrouter/binary_sensor/mk2pvrouter_binary_sensor.cpp index 9201596af2..61ecb23743 100644 --- a/esphome/components/mk2pvrouter/binary_sensor/mk2pvrouter_binary_sensor.cpp +++ b/esphome/components/mk2pvrouter/binary_sensor/mk2pvrouter_binary_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::mk2pvrouter { -static const char *const TAG = "mk2pvrouter_binary_sensor"; +ESPHOME_LOG_TAG(TAG, "mk2pvrouter_binary_sensor"); Mk2PVRouterBinarySensor::Mk2PVRouterBinarySensor(const char *tag) : Mk2PVRouterListener(tag) {} diff --git a/esphome/components/mk2pvrouter/mk2pvrouter.cpp b/esphome/components/mk2pvrouter/mk2pvrouter.cpp index f8aa1003bc..eecaa1a1d4 100644 --- a/esphome/components/mk2pvrouter/mk2pvrouter.cpp +++ b/esphome/components/mk2pvrouter/mk2pvrouter.cpp @@ -5,7 +5,7 @@ namespace esphome::mk2pvrouter { -static const char *const TAG = "mk2pvrouter"; +ESPHOME_LOG_TAG(TAG, "mk2pvrouter"); constexpr uint8_t START_FRAME = 0x2; constexpr uint8_t END_FRAME = 0x3; diff --git a/esphome/components/mk2pvrouter/sensor/mk2pvrouter_sensor.cpp b/esphome/components/mk2pvrouter/sensor/mk2pvrouter_sensor.cpp index 5ea07307e4..92e2ea715c 100644 --- a/esphome/components/mk2pvrouter/sensor/mk2pvrouter_sensor.cpp +++ b/esphome/components/mk2pvrouter/sensor/mk2pvrouter_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::mk2pvrouter { -static const char *const TAG = "mk2pvrouter_sensor"; +ESPHOME_LOG_TAG(TAG, "mk2pvrouter_sensor"); Mk2PVRouterSensor::Mk2PVRouterSensor(const char *tag, bool scale_centi) : Mk2PVRouterListener(tag), scale_centi_(scale_centi) {} diff --git a/esphome/components/mk2pvrouter/text_sensor/mk2pvrouter_text_sensor.cpp b/esphome/components/mk2pvrouter/text_sensor/mk2pvrouter_text_sensor.cpp index 4aea2ef7fc..66e6ba0a3b 100644 --- a/esphome/components/mk2pvrouter/text_sensor/mk2pvrouter_text_sensor.cpp +++ b/esphome/components/mk2pvrouter/text_sensor/mk2pvrouter_text_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::mk2pvrouter { -static const char *const TAG = "mk2pvrouter_text_sensor"; +ESPHOME_LOG_TAG(TAG, "mk2pvrouter_text_sensor"); Mk2PVRouterTextSensor::Mk2PVRouterTextSensor(const char *tag) : Mk2PVRouterListener(tag) {} diff --git a/esphome/components/mlx90393/sensor_mlx90393.cpp b/esphome/components/mlx90393/sensor_mlx90393.cpp index 2288e8ff84..82d12a5789 100644 --- a/esphome/components/mlx90393/sensor_mlx90393.cpp +++ b/esphome/components/mlx90393/sensor_mlx90393.cpp @@ -5,7 +5,7 @@ namespace esphome::mlx90393 { -static const char *const TAG = "mlx90393"; +ESPHOME_LOG_TAG(TAG, "mlx90393"); const LogString *settings_to_string(MLX90393Setting setting) { switch (setting) { diff --git a/esphome/components/mlx90614/mlx90614.cpp b/esphome/components/mlx90614/mlx90614.cpp index 508b3743d1..a67d770cc3 100644 --- a/esphome/components/mlx90614/mlx90614.cpp +++ b/esphome/components/mlx90614/mlx90614.cpp @@ -24,7 +24,7 @@ static const uint8_t MLX90614_ID2 = 0x3D; static const uint8_t MLX90614_ID3 = 0x3E; static const uint8_t MLX90614_ID4 = 0x3F; -static const char *const TAG = "mlx90614"; +ESPHOME_LOG_TAG(TAG, "mlx90614"); // The EEPROM cell has a limited number of write cycles, so stop retrying after a few failures static constexpr uint8_t EMISSIVITY_WRITE_ATTEMPTS = 3; diff --git a/esphome/components/mmc5603/mmc5603.cpp b/esphome/components/mmc5603/mmc5603.cpp index 15e715e675..b7d16b30ed 100644 --- a/esphome/components/mmc5603/mmc5603.cpp +++ b/esphome/components/mmc5603/mmc5603.cpp @@ -5,7 +5,7 @@ namespace esphome::mmc5603 { -static const char *const TAG = "mmc5603"; +ESPHOME_LOG_TAG(TAG, "mmc5603"); static const uint8_t MMC5603_ADDRESS = 0x30; static const uint8_t MMC56X3_PRODUCT_ID = 0x39; diff --git a/esphome/components/mmc5983/mmc5983.cpp b/esphome/components/mmc5983/mmc5983.cpp index a99df36a70..f7840aafbe 100644 --- a/esphome/components/mmc5983/mmc5983.cpp +++ b/esphome/components/mmc5983/mmc5983.cpp @@ -6,7 +6,7 @@ namespace esphome::mmc5983 { -static const char *const TAG = "mmc5983"; +ESPHOME_LOG_TAG(TAG, "mmc5983"); namespace { constexpr uint8_t IC0_ADDR = 0x09; diff --git a/esphome/components/modbus/modbus.cpp b/esphome/components/modbus/modbus.cpp index 5f237be8dd..7c56d2340f 100644 --- a/esphome/components/modbus/modbus.cpp +++ b/esphome/components/modbus/modbus.cpp @@ -9,7 +9,7 @@ namespace esphome::modbus { -static const char *const TAG = "modbus"; +ESPHOME_LOG_TAG(TAG, "modbus"); static constexpr size_t MODBUS_MAX_LOG_BYTES = 64; diff --git a/esphome/components/modbus/modbus_helpers.cpp b/esphome/components/modbus/modbus_helpers.cpp index d80e6c86ad..19edc98938 100644 --- a/esphome/components/modbus/modbus_helpers.cpp +++ b/esphome/components/modbus/modbus_helpers.cpp @@ -5,7 +5,7 @@ namespace esphome::modbus::helpers { -static const char *const TAG = "modbus_helpers"; +ESPHOME_LOG_TAG(TAG, "modbus_helpers"); // A quantity/address pair is standard when the quantity is non-zero, within the per-table maximum, // and the range [start_address, start_address + quantity) stays inside the 16-bit address space. diff --git a/esphome/components/modbus_controller/binary_sensor/modbus_binarysensor.cpp b/esphome/components/modbus_controller/binary_sensor/modbus_binarysensor.cpp index b0c927cf84..679b8dc714 100644 --- a/esphome/components/modbus_controller/binary_sensor/modbus_binarysensor.cpp +++ b/esphome/components/modbus_controller/binary_sensor/modbus_binarysensor.cpp @@ -3,7 +3,7 @@ namespace esphome::modbus_controller { -static const char *const TAG = "modbus_controller.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "modbus_controller.binary_sensor"); void ModbusBinarySensor::dump_config() { LOG_BINARY_SENSOR("", "Modbus Controller Binary Sensor", this); } diff --git a/esphome/components/modbus_controller/modbus_controller.cpp b/esphome/components/modbus_controller/modbus_controller.cpp index b8d06d3d5a..6c90bfa464 100644 --- a/esphome/components/modbus_controller/modbus_controller.cpp +++ b/esphome/components/modbus_controller/modbus_controller.cpp @@ -7,7 +7,7 @@ namespace esphome::modbus_controller { -static const char *const TAG = "modbus_controller"; +ESPHOME_LOG_TAG(TAG, "modbus_controller"); void ModbusController::setup() { this->create_polling_commands_(); } diff --git a/esphome/components/modbus_controller/number/modbus_number.cpp b/esphome/components/modbus_controller/number/modbus_number.cpp index 223aa12bec..f33fc36b0a 100644 --- a/esphome/components/modbus_controller/number/modbus_number.cpp +++ b/esphome/components/modbus_controller/number/modbus_number.cpp @@ -4,7 +4,7 @@ namespace esphome::modbus_controller { -static const char *const TAG = "modbus.number"; +ESPHOME_LOG_TAG(TAG, "modbus.number"); // Maximum uint16_t registers to log in verbose hex output static constexpr size_t MODBUS_NUMBER_MAX_LOG_REGISTERS = 32; diff --git a/esphome/components/modbus_controller/output/modbus_output.cpp b/esphome/components/modbus_controller/output/modbus_output.cpp index ad29015d32..9fb40f9005 100644 --- a/esphome/components/modbus_controller/output/modbus_output.cpp +++ b/esphome/components/modbus_controller/output/modbus_output.cpp @@ -6,7 +6,7 @@ namespace esphome::modbus_controller { -static const char *const TAG = "modbus_controller.output"; +ESPHOME_LOG_TAG(TAG, "modbus_controller.output"); // Maximum bytes to log in verbose hex output static constexpr size_t MODBUS_OUTPUT_MAX_LOG_BYTES = 64; diff --git a/esphome/components/modbus_controller/select/modbus_select.cpp b/esphome/components/modbus_controller/select/modbus_select.cpp index a2f15d54f6..793aa8e9ea 100644 --- a/esphome/components/modbus_controller/select/modbus_select.cpp +++ b/esphome/components/modbus_controller/select/modbus_select.cpp @@ -3,7 +3,7 @@ namespace esphome::modbus_controller { -static const char *const TAG = "modbus_controller.select"; +ESPHOME_LOG_TAG(TAG, "modbus_controller.select"); void ModbusSelect::dump_config() { LOG_SELECT(TAG, "Modbus Controller Select", this); } diff --git a/esphome/components/modbus_controller/sensor/modbus_sensor.cpp b/esphome/components/modbus_controller/sensor/modbus_sensor.cpp index 2035f2220a..98037c5237 100644 --- a/esphome/components/modbus_controller/sensor/modbus_sensor.cpp +++ b/esphome/components/modbus_controller/sensor/modbus_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::modbus_controller { -static const char *const TAG = "modbus_controller.sensor"; +ESPHOME_LOG_TAG(TAG, "modbus_controller.sensor"); void ModbusSensor::dump_config() { LOG_SENSOR(TAG, "Modbus Controller Sensor", this); } diff --git a/esphome/components/modbus_controller/switch/modbus_switch.cpp b/esphome/components/modbus_controller/switch/modbus_switch.cpp index 855a7b28c3..fe2b276231 100644 --- a/esphome/components/modbus_controller/switch/modbus_switch.cpp +++ b/esphome/components/modbus_controller/switch/modbus_switch.cpp @@ -7,7 +7,7 @@ namespace esphome::modbus_controller { -static const char *const TAG = "modbus_controller.switch"; +ESPHOME_LOG_TAG(TAG, "modbus_controller.switch"); // Maximum bytes to log in verbose hex output static constexpr size_t MODBUS_SWITCH_MAX_LOG_BYTES = 64; diff --git a/esphome/components/modbus_controller/text_sensor/modbus_textsensor.cpp b/esphome/components/modbus_controller/text_sensor/modbus_textsensor.cpp index 31b3fb3e55..74efd41e0f 100644 --- a/esphome/components/modbus_controller/text_sensor/modbus_textsensor.cpp +++ b/esphome/components/modbus_controller/text_sensor/modbus_textsensor.cpp @@ -4,7 +4,7 @@ namespace esphome::modbus_controller { -static const char *const TAG = "modbus_controller.text_sensor"; +ESPHOME_LOG_TAG(TAG, "modbus_controller.text_sensor"); void ModbusTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Modbus Controller Text Sensor", this); } diff --git a/esphome/components/modbus_server/modbus_server.cpp b/esphome/components/modbus_server/modbus_server.cpp index 65bf4ef2f4..763bbf872d 100644 --- a/esphome/components/modbus_server/modbus_server.cpp +++ b/esphome/components/modbus_server/modbus_server.cpp @@ -6,7 +6,7 @@ namespace esphome::modbus_server { using modbus::ExceptionCode; using modbus::helpers::registers_to_number; -static const char *const TAG = "modbus_server"; +ESPHOME_LOG_TAG(TAG, "modbus_server"); // The widest Modbus value type (QWORD) spans four registers. static constexpr uint8_t MAX_REGISTERS_PER_VALUE = 4; diff --git a/esphome/components/mopeka_ble/mopeka_ble.cpp b/esphome/components/mopeka_ble/mopeka_ble.cpp index 0bef1eb6d4..24e1667a4b 100644 --- a/esphome/components/mopeka_ble/mopeka_ble.cpp +++ b/esphome/components/mopeka_ble/mopeka_ble.cpp @@ -4,7 +4,7 @@ namespace esphome::mopeka_ble { -static const char *const TAG = "mopeka_ble"; +ESPHOME_LOG_TAG(TAG, "mopeka_ble"); // Mopeka Std (CC2540) sensor details static const uint16_t SERVICE_UUID_CC2540 = 0xADA0; diff --git a/esphome/components/mopeka_pro_check/mopeka_pro_check.cpp b/esphome/components/mopeka_pro_check/mopeka_pro_check.cpp index fe3178d3aa..ba93c70d15 100644 --- a/esphome/components/mopeka_pro_check/mopeka_pro_check.cpp +++ b/esphome/components/mopeka_pro_check/mopeka_pro_check.cpp @@ -3,7 +3,7 @@ namespace esphome::mopeka_pro_check { -static const char *const TAG = "mopeka_pro_check"; +ESPHOME_LOG_TAG(TAG, "mopeka_pro_check"); static const uint8_t MANUFACTURER_DATA_LENGTH = 10; static const uint16_t MANUFACTURER_ID = 0x0059; static const double MOPEKA_LPG_COEF[] = {0.573045, -0.002822, -0.00000535}; // Magic numbers provided by Mopeka diff --git a/esphome/components/mopeka_std_check/mopeka_std_check.cpp b/esphome/components/mopeka_std_check/mopeka_std_check.cpp index d70306c97d..f63f2bc190 100644 --- a/esphome/components/mopeka_std_check/mopeka_std_check.cpp +++ b/esphome/components/mopeka_std_check/mopeka_std_check.cpp @@ -5,7 +5,7 @@ namespace esphome::mopeka_std_check { -static const char *const TAG = "mopeka_std_check"; +ESPHOME_LOG_TAG(TAG, "mopeka_std_check"); static const uint16_t SERVICE_UUID = 0xADA0; static const uint8_t MANUFACTURER_DATA_LENGTH = 23; static const uint16_t MANUFACTURER_ID = 0x000D; diff --git a/esphome/components/motion/binary_sensor/motion_binary_sensor.cpp b/esphome/components/motion/binary_sensor/motion_binary_sensor.cpp index f663b41adb..1de535a0ff 100644 --- a/esphome/components/motion/binary_sensor/motion_binary_sensor.cpp +++ b/esphome/components/motion/binary_sensor/motion_binary_sensor.cpp @@ -6,7 +6,7 @@ namespace esphome::motion { -static const char *const TAG = "motion.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "motion.binary_sensor"); // Thresholds used to decide the device is at rest for face_up / face_down detection. // While moving (shaking, being picked up) the orientation reading is dominated by diff --git a/esphome/components/motion/event/motion_event.cpp b/esphome/components/motion/event/motion_event.cpp index 5568c953fd..9ad2668fd4 100644 --- a/esphome/components/motion/event/motion_event.cpp +++ b/esphome/components/motion/event/motion_event.cpp @@ -5,7 +5,7 @@ namespace esphome::motion { -static const char *const TAG = "motion.event"; +ESPHOME_LOG_TAG(TAG, "motion.event"); MotionEvent::MotionEvent(MotionComponent *parent) : parent_(parent) {} diff --git a/esphome/components/motion/motion_component.cpp b/esphome/components/motion/motion_component.cpp index 226dc94e63..3171bef4ec 100644 --- a/esphome/components/motion/motion_component.cpp +++ b/esphome/components/motion/motion_component.cpp @@ -3,7 +3,7 @@ namespace esphome::motion { -static const char *const TAG = "motion"; +ESPHOME_LOG_TAG(TAG, "motion"); static void log_matrix(const float m[9]) { ESP_LOGCONFIG(TAG, " Calibration matrix:"); diff --git a/esphome/components/mpl3115a2/mpl3115a2.cpp b/esphome/components/mpl3115a2/mpl3115a2.cpp index 238e37aff0..db89271625 100644 --- a/esphome/components/mpl3115a2/mpl3115a2.cpp +++ b/esphome/components/mpl3115a2/mpl3115a2.cpp @@ -5,7 +5,7 @@ namespace esphome::mpl3115a2 { -static const char *const TAG = "mpl3115a2"; +ESPHOME_LOG_TAG(TAG, "mpl3115a2"); void MPL3115A2Component::setup() { uint8_t whoami = 0xFF; diff --git a/esphome/components/mpr121/mpr121.cpp b/esphome/components/mpr121/mpr121.cpp index 6b183233d1..26cdcae613 100644 --- a/esphome/components/mpr121/mpr121.cpp +++ b/esphome/components/mpr121/mpr121.cpp @@ -7,7 +7,7 @@ namespace esphome::mpr121 { -static const char *const TAG = "mpr121"; +ESPHOME_LOG_TAG(TAG, "mpr121"); void MPR121Component::setup() { this->disable_loop(); diff --git a/esphome/components/mpu6050/mpu6050.cpp b/esphome/components/mpu6050/mpu6050.cpp index 8784e8caf8..cf393fd4d1 100644 --- a/esphome/components/mpu6050/mpu6050.cpp +++ b/esphome/components/mpu6050/mpu6050.cpp @@ -3,7 +3,7 @@ namespace esphome::mpu6050 { -static const char *const TAG = "mpu6050"; +ESPHOME_LOG_TAG(TAG, "mpu6050"); const uint8_t MPU6050_REGISTER_WHO_AM_I = 0x75; const uint8_t MPU6050_REGISTER_POWER_MANAGEMENT_1 = 0x6B; diff --git a/esphome/components/mpu6886/mpu6886.cpp b/esphome/components/mpu6886/mpu6886.cpp index b8cbd4635a..514ff0dd0e 100644 --- a/esphome/components/mpu6886/mpu6886.cpp +++ b/esphome/components/mpu6886/mpu6886.cpp @@ -3,7 +3,7 @@ namespace esphome::mpu6886 { -static const char *const TAG = "mpu6886"; +ESPHOME_LOG_TAG(TAG, "mpu6886"); const uint8_t MPU6886_REGISTER_WHO_AM_I = 0x75; const uint8_t MPU6886_REGISTER_POWER_MANAGEMENT_1 = 0x6B; diff --git a/esphome/components/mqtt/custom_mqtt_device.cpp b/esphome/components/mqtt/custom_mqtt_device.cpp index 64521f5cf3..42171fcfb1 100644 --- a/esphome/components/mqtt/custom_mqtt_device.cpp +++ b/esphome/components/mqtt/custom_mqtt_device.cpp @@ -6,7 +6,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.custom"; +ESPHOME_LOG_TAG(TAG, "mqtt.custom"); bool CustomMQTTDevice::publish(const std::string &topic, const std::string &payload, uint8_t qos, bool retain) { return global_mqtt_client->publish(topic, payload, qos, retain); diff --git a/esphome/components/mqtt/mqtt_alarm_control_panel.cpp b/esphome/components/mqtt/mqtt_alarm_control_panel.cpp index f059360e23..225f839633 100644 --- a/esphome/components/mqtt/mqtt_alarm_control_panel.cpp +++ b/esphome/components/mqtt/mqtt_alarm_control_panel.cpp @@ -9,7 +9,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.alarm_control_panel"; +ESPHOME_LOG_TAG(TAG, "mqtt.alarm_control_panel"); using namespace esphome::alarm_control_panel; diff --git a/esphome/components/mqtt/mqtt_backend_esp32.cpp b/esphome/components/mqtt/mqtt_backend_esp32.cpp index 791e550496..3b49ca33cd 100644 --- a/esphome/components/mqtt/mqtt_backend_esp32.cpp +++ b/esphome/components/mqtt/mqtt_backend_esp32.cpp @@ -10,7 +10,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt"; +ESPHOME_LOG_TAG(TAG, "mqtt"); bool MQTTBackendESP32::initialize_() { mqtt_cfg_.broker.address.hostname = this->host_.c_str(); diff --git a/esphome/components/mqtt/mqtt_binary_sensor.cpp b/esphome/components/mqtt/mqtt_binary_sensor.cpp index ebb29db44f..7a75cca6e8 100644 --- a/esphome/components/mqtt/mqtt_binary_sensor.cpp +++ b/esphome/components/mqtt/mqtt_binary_sensor.cpp @@ -8,7 +8,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "mqtt.binary_sensor"); MQTT_COMPONENT_TYPE(MQTTBinarySensorComponent, "binary_sensor") const EntityBase *MQTTBinarySensorComponent::get_entity() const { return this->binary_sensor_; } diff --git a/esphome/components/mqtt/mqtt_button.cpp b/esphome/components/mqtt/mqtt_button.cpp index 7e0ae7d06e..906913723c 100644 --- a/esphome/components/mqtt/mqtt_button.cpp +++ b/esphome/components/mqtt/mqtt_button.cpp @@ -8,7 +8,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.button"; +ESPHOME_LOG_TAG(TAG, "mqtt.button"); using namespace esphome::button; diff --git a/esphome/components/mqtt/mqtt_client.cpp b/esphome/components/mqtt/mqtt_client.cpp index 2ecab47904..b3d8ab80b1 100644 --- a/esphome/components/mqtt/mqtt_client.cpp +++ b/esphome/components/mqtt/mqtt_client.cpp @@ -26,7 +26,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt"; +ESPHOME_LOG_TAG(TAG, "mqtt"); // Maximum number of MQTT component resends per loop iteration. // Limits work to avoid triggering the task watchdog on reconnect. diff --git a/esphome/components/mqtt/mqtt_climate.cpp b/esphome/components/mqtt/mqtt_climate.cpp index 0e6a374f9b..83efc3da9c 100644 --- a/esphome/components/mqtt/mqtt_climate.cpp +++ b/esphome/components/mqtt/mqtt_climate.cpp @@ -9,7 +9,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.climate"; +ESPHOME_LOG_TAG(TAG, "mqtt.climate"); using namespace esphome::climate; diff --git a/esphome/components/mqtt/mqtt_component.cpp b/esphome/components/mqtt/mqtt_component.cpp index 59a5d02d97..adb5a95828 100644 --- a/esphome/components/mqtt/mqtt_component.cpp +++ b/esphome/components/mqtt/mqtt_component.cpp @@ -12,7 +12,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.component"; +ESPHOME_LOG_TAG(TAG, "mqtt.component"); // Entity category MQTT strings indexed by EntityCategory enum: NONE(0) is skipped, CONFIG(1), DIAGNOSTIC(2) PROGMEM_STRING_TABLE(EntityCategoryMqttStrings, "", "config", "diagnostic"); diff --git a/esphome/components/mqtt/mqtt_cover.cpp b/esphome/components/mqtt/mqtt_cover.cpp index ddb4b2d69d..a7da9a1b22 100644 --- a/esphome/components/mqtt/mqtt_cover.cpp +++ b/esphome/components/mqtt/mqtt_cover.cpp @@ -9,7 +9,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.cover"; +ESPHOME_LOG_TAG(TAG, "mqtt.cover"); using namespace esphome::cover; diff --git a/esphome/components/mqtt/mqtt_date.cpp b/esphome/components/mqtt/mqtt_date.cpp index c422bb3058..b5f1cf8fb8 100644 --- a/esphome/components/mqtt/mqtt_date.cpp +++ b/esphome/components/mqtt/mqtt_date.cpp @@ -10,7 +10,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.datetime"; +ESPHOME_LOG_TAG(TAG, "mqtt.datetime"); using namespace esphome::datetime; diff --git a/esphome/components/mqtt/mqtt_datetime.cpp b/esphome/components/mqtt/mqtt_datetime.cpp index 1492abd011..8275580938 100644 --- a/esphome/components/mqtt/mqtt_datetime.cpp +++ b/esphome/components/mqtt/mqtt_datetime.cpp @@ -10,7 +10,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.datetime.datetime"; +ESPHOME_LOG_TAG(TAG, "mqtt.datetime.datetime"); using namespace esphome::datetime; diff --git a/esphome/components/mqtt/mqtt_event.cpp b/esphome/components/mqtt/mqtt_event.cpp index 93ff6971b3..4266722ca8 100644 --- a/esphome/components/mqtt/mqtt_event.cpp +++ b/esphome/components/mqtt/mqtt_event.cpp @@ -8,7 +8,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.event"; +ESPHOME_LOG_TAG(TAG, "mqtt.event"); using namespace esphome::event; diff --git a/esphome/components/mqtt/mqtt_fan.cpp b/esphome/components/mqtt/mqtt_fan.cpp index 3a8658a55f..90f51cf6ce 100644 --- a/esphome/components/mqtt/mqtt_fan.cpp +++ b/esphome/components/mqtt/mqtt_fan.cpp @@ -9,7 +9,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.fan"; +ESPHOME_LOG_TAG(TAG, "mqtt.fan"); using namespace esphome::fan; diff --git a/esphome/components/mqtt/mqtt_light.cpp b/esphome/components/mqtt/mqtt_light.cpp index a8b52a3839..e9058eb642 100644 --- a/esphome/components/mqtt/mqtt_light.cpp +++ b/esphome/components/mqtt/mqtt_light.cpp @@ -10,7 +10,7 @@ #include "esphome/components/light/light_json_schema.h" namespace esphome::mqtt { -static const char *const TAG = "mqtt.light"; +ESPHOME_LOG_TAG(TAG, "mqtt.light"); using namespace esphome::light; diff --git a/esphome/components/mqtt/mqtt_lock.cpp b/esphome/components/mqtt/mqtt_lock.cpp index 369c1c6668..8d8b4c38e8 100644 --- a/esphome/components/mqtt/mqtt_lock.cpp +++ b/esphome/components/mqtt/mqtt_lock.cpp @@ -9,7 +9,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.lock"; +ESPHOME_LOG_TAG(TAG, "mqtt.lock"); using namespace esphome::lock; diff --git a/esphome/components/mqtt/mqtt_number.cpp b/esphome/components/mqtt/mqtt_number.cpp index b0bac8b3d7..3b2bebf291 100644 --- a/esphome/components/mqtt/mqtt_number.cpp +++ b/esphome/components/mqtt/mqtt_number.cpp @@ -9,7 +9,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.number"; +ESPHOME_LOG_TAG(TAG, "mqtt.number"); using namespace esphome::number; diff --git a/esphome/components/mqtt/mqtt_select.cpp b/esphome/components/mqtt/mqtt_select.cpp index 25fd813496..42c0ae002e 100644 --- a/esphome/components/mqtt/mqtt_select.cpp +++ b/esphome/components/mqtt/mqtt_select.cpp @@ -8,7 +8,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.select"; +ESPHOME_LOG_TAG(TAG, "mqtt.select"); using namespace esphome::select; diff --git a/esphome/components/mqtt/mqtt_sensor.cpp b/esphome/components/mqtt/mqtt_sensor.cpp index a601a9bcc8..bdaaa47e8f 100644 --- a/esphome/components/mqtt/mqtt_sensor.cpp +++ b/esphome/components/mqtt/mqtt_sensor.cpp @@ -14,7 +14,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.sensor"; +ESPHOME_LOG_TAG(TAG, "mqtt.sensor"); using namespace esphome::sensor; diff --git a/esphome/components/mqtt/mqtt_switch.cpp b/esphome/components/mqtt/mqtt_switch.cpp index 70cd03a4eb..b786b4412e 100644 --- a/esphome/components/mqtt/mqtt_switch.cpp +++ b/esphome/components/mqtt/mqtt_switch.cpp @@ -8,7 +8,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.switch"; +ESPHOME_LOG_TAG(TAG, "mqtt.switch"); using namespace esphome::switch_; diff --git a/esphome/components/mqtt/mqtt_text.cpp b/esphome/components/mqtt/mqtt_text.cpp index 200e420c9c..dd43a8e2cb 100644 --- a/esphome/components/mqtt/mqtt_text.cpp +++ b/esphome/components/mqtt/mqtt_text.cpp @@ -9,7 +9,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.text"; +ESPHOME_LOG_TAG(TAG, "mqtt.text"); using namespace esphome::text; diff --git a/esphome/components/mqtt/mqtt_text_sensor.cpp b/esphome/components/mqtt/mqtt_text_sensor.cpp index 3acd71b50d..d105aaac99 100644 --- a/esphome/components/mqtt/mqtt_text_sensor.cpp +++ b/esphome/components/mqtt/mqtt_text_sensor.cpp @@ -8,7 +8,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.text_sensor"; +ESPHOME_LOG_TAG(TAG, "mqtt.text_sensor"); using namespace esphome::text_sensor; diff --git a/esphome/components/mqtt/mqtt_time.cpp b/esphome/components/mqtt/mqtt_time.cpp index be391ce88c..889ee2bf34 100644 --- a/esphome/components/mqtt/mqtt_time.cpp +++ b/esphome/components/mqtt/mqtt_time.cpp @@ -10,7 +10,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.datetime.time"; +ESPHOME_LOG_TAG(TAG, "mqtt.datetime.time"); using namespace esphome::datetime; diff --git a/esphome/components/mqtt/mqtt_update.cpp b/esphome/components/mqtt/mqtt_update.cpp index c01fb9e52e..a4565058ea 100644 --- a/esphome/components/mqtt/mqtt_update.cpp +++ b/esphome/components/mqtt/mqtt_update.cpp @@ -8,7 +8,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.update"; +ESPHOME_LOG_TAG(TAG, "mqtt.update"); using namespace esphome::update; diff --git a/esphome/components/mqtt/mqtt_valve.cpp b/esphome/components/mqtt/mqtt_valve.cpp index b155a4c897..b41a482de9 100644 --- a/esphome/components/mqtt/mqtt_valve.cpp +++ b/esphome/components/mqtt/mqtt_valve.cpp @@ -9,7 +9,7 @@ namespace esphome::mqtt { -static const char *const TAG = "mqtt.valve"; +ESPHOME_LOG_TAG(TAG, "mqtt.valve"); using namespace esphome::valve; diff --git a/esphome/components/mqtt_subscribe/sensor/mqtt_subscribe_sensor.cpp b/esphome/components/mqtt_subscribe/sensor/mqtt_subscribe_sensor.cpp index afb725feb6..a79216e04d 100644 --- a/esphome/components/mqtt_subscribe/sensor/mqtt_subscribe_sensor.cpp +++ b/esphome/components/mqtt_subscribe/sensor/mqtt_subscribe_sensor.cpp @@ -6,7 +6,7 @@ namespace esphome::mqtt_subscribe { -static const char *const TAG = "mqtt_subscribe.sensor"; +ESPHOME_LOG_TAG(TAG, "mqtt_subscribe.sensor"); void MQTTSubscribeSensor::setup() { mqtt::global_mqtt_client->subscribe( diff --git a/esphome/components/mqtt_subscribe/text_sensor/mqtt_subscribe_text_sensor.cpp b/esphome/components/mqtt_subscribe/text_sensor/mqtt_subscribe_text_sensor.cpp index 470e08d59a..55992f42f9 100644 --- a/esphome/components/mqtt_subscribe/text_sensor/mqtt_subscribe_text_sensor.cpp +++ b/esphome/components/mqtt_subscribe/text_sensor/mqtt_subscribe_text_sensor.cpp @@ -7,7 +7,7 @@ namespace esphome::mqtt_subscribe { -static const char *const TAG = "mqtt_subscribe.text_sensor"; +ESPHOME_LOG_TAG(TAG, "mqtt_subscribe.text_sensor"); void MQTTSubscribeTextSensor::setup() { this->parent_->subscribe( diff --git a/esphome/components/ms5611/ms5611.cpp b/esphome/components/ms5611/ms5611.cpp index 9b7dcbe653..8b275e53f2 100644 --- a/esphome/components/ms5611/ms5611.cpp +++ b/esphome/components/ms5611/ms5611.cpp @@ -4,7 +4,7 @@ namespace esphome::ms5611 { -static const char *const TAG = "ms5611"; +ESPHOME_LOG_TAG(TAG, "ms5611"); static const uint8_t MS5611_ADDRESS = 0x77; static const uint8_t MS5611_CMD_ADC_READ = 0x00; diff --git a/esphome/components/ms8607/ms8607.cpp b/esphome/components/ms8607/ms8607.cpp index b9cbdc749b..832e7ab2d9 100644 --- a/esphome/components/ms8607/ms8607.cpp +++ b/esphome/components/ms8607/ms8607.cpp @@ -7,7 +7,7 @@ namespace esphome::ms8607 { /// TAG used for logging calls -static const char *const TAG = "ms8607"; +ESPHOME_LOG_TAG(TAG, "ms8607"); /// Reset the Pressure/Temperature sensor static const uint8_t MS8607_PT_CMD_RESET = 0x1E; diff --git a/esphome/components/msa3xx/msa3xx.cpp b/esphome/components/msa3xx/msa3xx.cpp index ecde0cb117..78f2b75c9c 100644 --- a/esphome/components/msa3xx/msa3xx.cpp +++ b/esphome/components/msa3xx/msa3xx.cpp @@ -5,7 +5,7 @@ namespace esphome::msa3xx { -static const char *const TAG = "msa3xx"; +ESPHOME_LOG_TAG(TAG, "msa3xx"); const uint8_t MSA_3XX_PART_ID = 0x13; diff --git a/esphome/components/my9231/my9231.cpp b/esphome/components/my9231/my9231.cpp index 0072f7196e..679600eebc 100644 --- a/esphome/components/my9231/my9231.cpp +++ b/esphome/components/my9231/my9231.cpp @@ -4,7 +4,7 @@ namespace esphome::my9231 { -static const char *const TAG = "my9231.output"; +ESPHOME_LOG_TAG(TAG, "my9231.output"); // One-shot select (frame cycle repeat mode / frame cycle One-shot mode) static const uint8_t MY9231_CMD_ONE_SHOT_DISABLE = 0x0 << 6; diff --git a/esphome/components/nau7802/nau7802.cpp b/esphome/components/nau7802/nau7802.cpp index 2092452087..ad1a569e0f 100644 --- a/esphome/components/nau7802/nau7802.cpp +++ b/esphome/components/nau7802/nau7802.cpp @@ -5,7 +5,7 @@ namespace esphome::nau7802 { -static const char *const TAG = "nau7802"; +ESPHOME_LOG_TAG(TAG, "nau7802"); // Only define what we need diff --git a/esphome/components/network/network_component.cpp b/esphome/components/network/network_component.cpp index 7e05983733..fad7a385fd 100644 --- a/esphome/components/network/network_component.cpp +++ b/esphome/components/network/network_component.cpp @@ -23,7 +23,7 @@ namespace esphome::network { -static const char *const TAG = "network"; +ESPHOME_LOG_TAG(TAG, "network"); void NetworkComponent::setup() { // Initialize ESP-IDF network interfaces and ensure the default event loop exists diff --git a/esphome/components/nextion/binary_sensor/nextion_binarysensor.cpp b/esphome/components/nextion/binary_sensor/nextion_binarysensor.cpp index 08e7c58ef1..75e05e2018 100644 --- a/esphome/components/nextion/binary_sensor/nextion_binarysensor.cpp +++ b/esphome/components/nextion/binary_sensor/nextion_binarysensor.cpp @@ -4,7 +4,7 @@ namespace esphome::nextion { -static const char *const TAG = "nextion_binarysensor"; +ESPHOME_LOG_TAG(TAG, "nextion_binarysensor"); void NextionBinarySensor::process_bool(const std::string &variable_name, bool state) { if (!this->nextion_->is_setup()) diff --git a/esphome/components/nextion/nextion.cpp b/esphome/components/nextion/nextion.cpp index 625c915e73..b9194b3f31 100644 --- a/esphome/components/nextion/nextion.cpp +++ b/esphome/components/nextion/nextion.cpp @@ -11,7 +11,7 @@ namespace esphome::nextion { -static const char *const TAG = "nextion"; +ESPHOME_LOG_TAG(TAG, "nextion"); // A user entity may be named sleep_wake too; only the internal NO_RESULT command clears the sleeping flag static bool is_sleep_wake_command(const NextionComponentBase *component) { diff --git a/esphome/components/nextion/nextion_commands.cpp b/esphome/components/nextion/nextion_commands.cpp index dd3a97065c..cac1d60594 100644 --- a/esphome/components/nextion/nextion_commands.cpp +++ b/esphome/components/nextion/nextion_commands.cpp @@ -5,7 +5,7 @@ namespace esphome::nextion { -static const char *const TAG = "nextion"; +ESPHOME_LOG_TAG(TAG, "nextion"); // Sleep safe commands void Nextion::soft_reset() { this->send_command_("rest"); } diff --git a/esphome/components/nextion/nextion_upload.cpp b/esphome/components/nextion/nextion_upload.cpp index a49e7f18d6..f106cdf18f 100644 --- a/esphome/components/nextion/nextion_upload.cpp +++ b/esphome/components/nextion/nextion_upload.cpp @@ -6,7 +6,7 @@ namespace esphome::nextion { -static const char *const TAG = "nextion.upload"; +ESPHOME_LOG_TAG(TAG, "nextion.upload"); bool Nextion::upload_end_(bool successful) { if (successful) { diff --git a/esphome/components/nextion/nextion_upload_arduino.cpp b/esphome/components/nextion/nextion_upload_arduino.cpp index 944fa1db47..c755a0e9c5 100644 --- a/esphome/components/nextion/nextion_upload_arduino.cpp +++ b/esphome/components/nextion/nextion_upload_arduino.cpp @@ -13,7 +13,7 @@ namespace esphome::nextion { -static const char *const TAG = "nextion.upload"; +ESPHOME_LOG_TAG(TAG, "nextion.upload"); static constexpr size_t NEXTION_MAX_RESPONSE_LOG_BYTES = 16; // Timeout for display acknowledgment during TFT upload (ms). diff --git a/esphome/components/nextion/nextion_upload_esp32.cpp b/esphome/components/nextion/nextion_upload_esp32.cpp index c4dc74b5d3..cabd0761c2 100644 --- a/esphome/components/nextion/nextion_upload_esp32.cpp +++ b/esphome/components/nextion/nextion_upload_esp32.cpp @@ -16,7 +16,7 @@ namespace esphome::nextion { -static const char *const TAG = "nextion.upload"; +ESPHOME_LOG_TAG(TAG, "nextion.upload"); static constexpr size_t NEXTION_MAX_RESPONSE_LOG_BYTES = 16; // Timeout for display acknowledgment during TFT upload (ms). diff --git a/esphome/components/nextion/sensor/nextion_sensor.cpp b/esphome/components/nextion/sensor/nextion_sensor.cpp index ca657522f9..bb5206e8d8 100644 --- a/esphome/components/nextion/sensor/nextion_sensor.cpp +++ b/esphome/components/nextion/sensor/nextion_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::nextion { -static const char *const TAG = "nextion_sensor"; +ESPHOME_LOG_TAG(TAG, "nextion_sensor"); void NextionSensor::process_sensor(const std::string &variable_name, int state) { if (!this->nextion_->is_setup()) diff --git a/esphome/components/nextion/switch/nextion_switch.cpp b/esphome/components/nextion/switch/nextion_switch.cpp index 0018cff005..f363666dbf 100644 --- a/esphome/components/nextion/switch/nextion_switch.cpp +++ b/esphome/components/nextion/switch/nextion_switch.cpp @@ -4,7 +4,7 @@ namespace esphome::nextion { -static const char *const TAG = "nextion_switch"; +ESPHOME_LOG_TAG(TAG, "nextion_switch"); void NextionSwitch::process_bool(const std::string &variable_name, bool on) { if (!this->nextion_->is_setup()) diff --git a/esphome/components/nextion/text_sensor/nextion_textsensor.cpp b/esphome/components/nextion/text_sensor/nextion_textsensor.cpp index 45e4691423..b2ae436684 100644 --- a/esphome/components/nextion/text_sensor/nextion_textsensor.cpp +++ b/esphome/components/nextion/text_sensor/nextion_textsensor.cpp @@ -4,7 +4,7 @@ namespace esphome::nextion { -static const char *const TAG = "nextion_textsensor"; +ESPHOME_LOG_TAG(TAG, "nextion_textsensor"); void NextionTextSensor::process_text(const std::string &variable_name, const std::string &text_value) { if (!this->nextion_->is_setup()) diff --git a/esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp b/esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp index 995255d1e4..3595f37016 100644 --- a/esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp +++ b/esphome/components/nfc/binary_sensor/nfc_binary_sensor.cpp @@ -5,7 +5,7 @@ namespace esphome::nfc { -static const char *const TAG = "nfc.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "nfc.binary_sensor"); void NfcTagBinarySensor::setup() { this->publish_initial_state(false); } diff --git a/esphome/components/nfc/ndef_message.cpp b/esphome/components/nfc/ndef_message.cpp index e597b9192d..552dfe99d3 100644 --- a/esphome/components/nfc/ndef_message.cpp +++ b/esphome/components/nfc/ndef_message.cpp @@ -3,7 +3,7 @@ namespace esphome::nfc { -static const char *const TAG = "nfc.ndef_message"; +ESPHOME_LOG_TAG(TAG, "nfc.ndef_message"); NdefMessage::NdefMessage(const std::span data) { ESP_LOGV(TAG, "Building NdefMessage with %zu bytes", data.size()); diff --git a/esphome/components/nfc/ndef_record.cpp b/esphome/components/nfc/ndef_record.cpp index 8b9e7023ed..0e8e7ff6ef 100644 --- a/esphome/components/nfc/ndef_record.cpp +++ b/esphome/components/nfc/ndef_record.cpp @@ -2,7 +2,7 @@ namespace esphome::nfc { -static const char *const TAG = "nfc.ndef_record"; +ESPHOME_LOG_TAG(TAG, "nfc.ndef_record"); NdefRecord::NdefRecord(std::vector payload_data) { this->payload_ = std::string(payload_data.begin(), payload_data.end()); diff --git a/esphome/components/nfc/ndef_record_text.cpp b/esphome/components/nfc/ndef_record_text.cpp index 8ad687daf8..f1e81dcd96 100644 --- a/esphome/components/nfc/ndef_record_text.cpp +++ b/esphome/components/nfc/ndef_record_text.cpp @@ -3,7 +3,7 @@ namespace esphome::nfc { -static const char *const TAG = "nfc.ndef_record_text"; +ESPHOME_LOG_TAG(TAG, "nfc.ndef_record_text"); NdefRecordText::NdefRecordText(const std::vector &payload) { if (payload.empty()) { diff --git a/esphome/components/nfc/ndef_record_uri.cpp b/esphome/components/nfc/ndef_record_uri.cpp index e2c6d21a34..5d7ebbba48 100644 --- a/esphome/components/nfc/ndef_record_uri.cpp +++ b/esphome/components/nfc/ndef_record_uri.cpp @@ -2,7 +2,7 @@ namespace esphome::nfc { -static const char *const TAG = "nfc.ndef_record_uri"; +ESPHOME_LOG_TAG(TAG, "nfc.ndef_record_uri"); NdefRecordUri::NdefRecordUri(const std::vector &payload) { if (payload.empty()) { diff --git a/esphome/components/nfc/nfc.cpp b/esphome/components/nfc/nfc.cpp index a9fc1c2b8c..03703bb421 100644 --- a/esphome/components/nfc/nfc.cpp +++ b/esphome/components/nfc/nfc.cpp @@ -5,7 +5,7 @@ namespace esphome::nfc { -static const char *const TAG = "nfc"; +ESPHOME_LOG_TAG(TAG, "nfc"); char *format_uid_to(char *buffer, std::span uid) { return format_hex_pretty_to(buffer, FORMAT_UID_BUFFER_SIZE, uid.data(), uid.size(), '-'); diff --git a/esphome/components/nfc/nfc_helpers.cpp b/esphome/components/nfc/nfc_helpers.cpp index 82f4591bdf..412cc385c6 100644 --- a/esphome/components/nfc/nfc_helpers.cpp +++ b/esphome/components/nfc/nfc_helpers.cpp @@ -2,7 +2,7 @@ namespace esphome::nfc { -static const char *const TAG = "nfc.helpers"; +ESPHOME_LOG_TAG(TAG, "nfc.helpers"); bool has_ha_tag_ndef(const NfcTag &tag) { return !get_ha_tag_ndef(tag).empty(); } diff --git a/esphome/components/nfc/nfc_tag.cpp b/esphome/components/nfc/nfc_tag.cpp index c43210517d..0d2d2a2076 100644 --- a/esphome/components/nfc/nfc_tag.cpp +++ b/esphome/components/nfc/nfc_tag.cpp @@ -2,6 +2,6 @@ namespace esphome::nfc { -static const char *const TAG = "nfc.tag"; +ESPHOME_LOG_TAG(TAG, "nfc.tag"); } // namespace esphome::nfc diff --git a/esphome/components/noblex/noblex.cpp b/esphome/components/noblex/noblex.cpp index ac8d2641fe..a9fb3935f1 100644 --- a/esphome/components/noblex/noblex.cpp +++ b/esphome/components/noblex/noblex.cpp @@ -4,7 +4,7 @@ namespace esphome::noblex { -static const char *const TAG = "noblex.climate"; +ESPHOME_LOG_TAG(TAG, "noblex.climate"); const uint16_t NOBLEX_HEADER_MARK = 9000; const uint16_t NOBLEX_HEADER_SPACE = 4500; diff --git a/esphome/components/noise/noise.cpp b/esphome/components/noise/noise.cpp index 118bfb234f..5e70300f21 100644 --- a/esphome/components/noise/noise.cpp +++ b/esphome/components/noise/noise.cpp @@ -13,7 +13,7 @@ namespace esphome::noise { -static const char *const TAG = "noise"; +ESPHOME_LOG_TAG(TAG, "noise"); void NoiseContext::load_psk(psk_t &out) const { if (this->psk_ == nullptr) { diff --git a/esphome/components/noise/noise_handshake.cpp b/esphome/components/noise/noise_handshake.cpp index bd1afa198d..e0b7ca7c37 100644 --- a/esphome/components/noise/noise_handshake.cpp +++ b/esphome/components/noise/noise_handshake.cpp @@ -6,7 +6,7 @@ namespace esphome::noise { -static const char *const TAG = "noise"; +ESPHOME_LOG_TAG(TAG, "noise"); // Log the failing noise-c call at the same verbosity the api helper used // before this class existed; callers only see one collapsed error code. diff --git a/esphome/components/npi19/npi19.cpp b/esphome/components/npi19/npi19.cpp index 207acc9d99..2f81bfe3ba 100644 --- a/esphome/components/npi19/npi19.cpp +++ b/esphome/components/npi19/npi19.cpp @@ -5,7 +5,7 @@ namespace esphome::npi19 { -static const char *const TAG = "npi19"; +ESPHOME_LOG_TAG(TAG, "npi19"); static const uint8_t READ_COMMAND = 0xAC; diff --git a/esphome/components/nrf52/dfu.cpp b/esphome/components/nrf52/dfu.cpp index 3d9219e96f..a1d574a034 100644 --- a/esphome/components/nrf52/dfu.cpp +++ b/esphome/components/nrf52/dfu.cpp @@ -10,7 +10,7 @@ namespace esphome::nrf52 { -static const char *const TAG = "dfu"; +ESPHOME_LOG_TAG(TAG, "dfu"); static const uint32_t DFU_DBL_RESET_MAGIC = 0x5A1AD5; // SALADS static const uint8_t DFU_MAGIC_UF2_RESET = 0x57; // Adafruit nRF52 bootloader UF2 magic diff --git a/esphome/components/ntc/ntc.cpp b/esphome/components/ntc/ntc.cpp index 49a42e858e..d2b095a3d7 100644 --- a/esphome/components/ntc/ntc.cpp +++ b/esphome/components/ntc/ntc.cpp @@ -3,7 +3,7 @@ namespace esphome::ntc { -static const char *const TAG = "ntc"; +ESPHOME_LOG_TAG(TAG, "ntc"); void NTC::setup() { this->sensor_->add_on_state_callback([this](float value) { this->process_(value); }); diff --git a/esphome/components/number/automation.cpp b/esphome/components/number/automation.cpp index a3d49a6ff6..1bca604659 100644 --- a/esphome/components/number/automation.cpp +++ b/esphome/components/number/automation.cpp @@ -3,7 +3,7 @@ namespace esphome::number { -static const char *const TAG = "number.automation"; +ESPHOME_LOG_TAG(TAG, "number.automation"); union convert { float from; diff --git a/esphome/components/number/number.cpp b/esphome/components/number/number.cpp index ca5aab6469..1d5533c423 100644 --- a/esphome/components/number/number.cpp +++ b/esphome/components/number/number.cpp @@ -5,7 +5,7 @@ namespace esphome::number { -static const char *const TAG = "number"; +ESPHOME_LOG_TAG(TAG, "number"); // Function implementation of LOG_NUMBER macro to reduce code size void log_number(const char *tag, const char *prefix, const char *type, Number *obj) { diff --git a/esphome/components/number/number_call.cpp b/esphome/components/number/number_call.cpp index e300ca72de..a928eaf3fa 100644 --- a/esphome/components/number/number_call.cpp +++ b/esphome/components/number/number_call.cpp @@ -4,7 +4,7 @@ namespace esphome::number { -static const char *const TAG = "number"; +ESPHOME_LOG_TAG(TAG, "number"); // Helper functions to reduce code size for logging void NumberCall::log_perform_warning_(const LogString *message) { diff --git a/esphome/components/number/number_traits.cpp b/esphome/components/number/number_traits.cpp index 1e4239ceca..e9559e9177 100644 --- a/esphome/components/number/number_traits.cpp +++ b/esphome/components/number/number_traits.cpp @@ -3,6 +3,6 @@ namespace esphome::number { -static const char *const TAG = "number"; +ESPHOME_LOG_TAG(TAG, "number"); } // namespace esphome::number diff --git a/esphome/components/number/sensor/number_sensor.cpp b/esphome/components/number/sensor/number_sensor.cpp index 227202622a..e90c349f4f 100644 --- a/esphome/components/number/sensor/number_sensor.cpp +++ b/esphome/components/number/sensor/number_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::number { -static const char *const TAG = "number.sensor"; +ESPHOME_LOG_TAG(TAG, "number.sensor"); void NumberSensor::setup() { this->source_->add_on_state_callback([this](float value) { this->publish_state(value); }); diff --git a/esphome/components/one_wire/one_wire.cpp b/esphome/components/one_wire/one_wire.cpp index aeab821f6a..65a9962349 100644 --- a/esphome/components/one_wire/one_wire.cpp +++ b/esphome/components/one_wire/one_wire.cpp @@ -2,7 +2,7 @@ namespace esphome::one_wire { -static const char *const TAG = "one_wire"; +ESPHOME_LOG_TAG(TAG, "one_wire"); const std::string &OneWireDevice::get_address_name() { if (this->address_name_.empty()) { diff --git a/esphome/components/one_wire/one_wire_bus.cpp b/esphome/components/one_wire/one_wire_bus.cpp index b62e4f47d4..0a4880cf73 100644 --- a/esphome/components/one_wire/one_wire_bus.cpp +++ b/esphome/components/one_wire/one_wire_bus.cpp @@ -3,7 +3,7 @@ namespace esphome::one_wire { -static const char *const TAG = "one_wire"; +ESPHOME_LOG_TAG(TAG, "one_wire"); static const uint8_t DALLAS_MODEL_DS18S20 = 0x10; static const uint8_t DALLAS_MODEL_DS1822 = 0x22; diff --git a/esphome/components/online_image/download_buffer.cpp b/esphome/components/online_image/download_buffer.cpp index 2ec6365aa1..c4ea9e5533 100644 --- a/esphome/components/online_image/download_buffer.cpp +++ b/esphome/components/online_image/download_buffer.cpp @@ -4,7 +4,7 @@ namespace esphome::online_image { -static const char *const TAG = "online_image.download_buffer"; +ESPHOME_LOG_TAG(TAG, "online_image.download_buffer"); DownloadBuffer::DownloadBuffer(size_t size) : size_(size) { RAMAllocator allocator; diff --git a/esphome/components/online_image/online_image.cpp b/esphome/components/online_image/online_image.cpp index a21849d618..4497d5cad1 100644 --- a/esphome/components/online_image/online_image.cpp +++ b/esphome/components/online_image/online_image.cpp @@ -5,7 +5,7 @@ #include #include -static const char *const TAG = "online_image"; +ESPHOME_LOG_TAG(TAG, "online_image"); static const char *const CONTENT_TYPE_HEADER_NAME = "content-type"; static const char *const ETAG_HEADER_NAME = "etag"; static const char *const IF_NONE_MATCH_HEADER_NAME = "if-none-match"; diff --git a/esphome/components/opentherm/hub.cpp b/esphome/components/opentherm/hub.cpp index f8b515fa05..c253d18671 100644 --- a/esphome/components/opentherm/hub.cpp +++ b/esphome/components/opentherm/hub.cpp @@ -5,7 +5,7 @@ namespace esphome::opentherm { -static const char *const TAG = "opentherm"; +ESPHOME_LOG_TAG(TAG, "opentherm"); namespace message_data { bool parse_flag8_lb_0(OpenthermData &data) { return read_bit(data.valueLB, 0); } bool parse_flag8_lb_1(OpenthermData &data) { return read_bit(data.valueLB, 1); } diff --git a/esphome/components/opentherm/number/opentherm_number.cpp b/esphome/components/opentherm/number/opentherm_number.cpp index d78c6eb38a..f2d8d76f6f 100644 --- a/esphome/components/opentherm/number/opentherm_number.cpp +++ b/esphome/components/opentherm/number/opentherm_number.cpp @@ -2,7 +2,7 @@ namespace esphome::opentherm { -static const char *const TAG = "opentherm.number"; +ESPHOME_LOG_TAG(TAG, "opentherm.number"); void OpenthermNumber::control(float value) { this->publish_state(value); diff --git a/esphome/components/opentherm/opentherm.cpp b/esphome/components/opentherm/opentherm.cpp index 3343871cd0..b8b639167d 100644 --- a/esphome/components/opentherm/opentherm.cpp +++ b/esphome/components/opentherm/opentherm.cpp @@ -20,7 +20,7 @@ namespace esphome::opentherm { using std::string; -static const char *const TAG = "opentherm"; +ESPHOME_LOG_TAG(TAG, "opentherm"); #ifdef ESP8266 OpenTherm *OpenTherm::instance = nullptr; diff --git a/esphome/components/opentherm/output/opentherm_output.cpp b/esphome/components/opentherm/output/opentherm_output.cpp index 9b87cd8d12..adbb1c40c1 100644 --- a/esphome/components/opentherm/output/opentherm_output.cpp +++ b/esphome/components/opentherm/output/opentherm_output.cpp @@ -3,7 +3,7 @@ namespace esphome::opentherm { -static const char *const TAG = "opentherm.output"; +ESPHOME_LOG_TAG(TAG, "opentherm.output"); void opentherm::OpenthermOutput::write_state(float state) { ESP_LOGD(TAG, "Received state: %.2f. Min value: %.2f, max value: %.2f", state, min_value_, max_value_); diff --git a/esphome/components/opentherm/switch/opentherm_switch.cpp b/esphome/components/opentherm/switch/opentherm_switch.cpp index 2fc99e793e..6bf06f825e 100644 --- a/esphome/components/opentherm/switch/opentherm_switch.cpp +++ b/esphome/components/opentherm/switch/opentherm_switch.cpp @@ -2,7 +2,7 @@ namespace esphome::opentherm { -static const char *const TAG = "opentherm.switch"; +ESPHOME_LOG_TAG(TAG, "opentherm.switch"); void OpenthermSwitch::write_state(bool state) { this->publish_state(state); } diff --git a/esphome/components/openthread/openthread.cpp b/esphome/components/openthread/openthread.cpp index 7d98522cd2..4986850cd4 100644 --- a/esphome/components/openthread/openthread.cpp +++ b/esphome/components/openthread/openthread.cpp @@ -16,7 +16,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -static const char *const TAG = "openthread"; +ESPHOME_LOG_TAG(TAG, "openthread"); namespace esphome::openthread { diff --git a/esphome/components/openthread/openthread_esp.cpp b/esphome/components/openthread/openthread_esp.cpp index 526fc961f2..f3860b2cc8 100644 --- a/esphome/components/openthread/openthread_esp.cpp +++ b/esphome/components/openthread/openthread_esp.cpp @@ -17,7 +17,7 @@ #include "esp_vfs_eventfd.h" #include "nvs_flash.h" -static const char *const TAG = "openthread"; +ESPHOME_LOG_TAG(TAG, "openthread"); namespace esphome::openthread { diff --git a/esphome/components/openthread/openthread_zephyr.cpp b/esphome/components/openthread/openthread_zephyr.cpp index 0f474fc040..c252034c33 100644 --- a/esphome/components/openthread/openthread_zephyr.cpp +++ b/esphome/components/openthread/openthread_zephyr.cpp @@ -7,7 +7,7 @@ #include "esphome/core/helpers.h" #include -static const char *const TAG = "openthread"; +ESPHOME_LOG_TAG(TAG, "openthread"); namespace esphome::openthread { diff --git a/esphome/components/openthread_info/openthread_info_sensor.cpp b/esphome/components/openthread_info/openthread_info_sensor.cpp index 9beb52d64b..d17dc9a9b6 100644 --- a/esphome/components/openthread_info/openthread_info_sensor.cpp +++ b/esphome/components/openthread_info/openthread_info_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::openthread_info { -static const char *const TAG = "openthread_info"; +ESPHOME_LOG_TAG(TAG, "openthread_info"); void ParentAverageRssiOpenThreadInfo::dump_config() { LOG_SENSOR("", "Parent Average RSSI", this); } void ParentLastRssiOpenThreadInfo::dump_config() { LOG_SENSOR("", "Parent Last RSSI", this); } diff --git a/esphome/components/openthread_info/openthread_info_text_sensor.cpp b/esphome/components/openthread_info/openthread_info_text_sensor.cpp index fc61ad81b2..44eb546850 100644 --- a/esphome/components/openthread_info/openthread_info_text_sensor.cpp +++ b/esphome/components/openthread_info/openthread_info_text_sensor.cpp @@ -5,7 +5,7 @@ namespace esphome::openthread_info { -static const char *const TAG = "openthread_info"; +ESPHOME_LOG_TAG(TAG, "openthread_info"); void IPAddressOpenThreadInfo::dump_config() { LOG_TEXT_SENSOR("", "IPAddress", this); } void RoleOpenThreadInfo::dump_config() { LOG_TEXT_SENSOR("", "Role", this); } diff --git a/esphome/components/opt3001/opt3001.cpp b/esphome/components/opt3001/opt3001.cpp index ce5fbdfd82..c6692d8dad 100644 --- a/esphome/components/opt3001/opt3001.cpp +++ b/esphome/components/opt3001/opt3001.cpp @@ -3,7 +3,7 @@ namespace esphome::opt3001 { -static const char *const TAG = "opt3001.sensor"; +ESPHOME_LOG_TAG(TAG, "opt3001.sensor"); static const uint8_t OPT3001_REG_RESULT = 0x00; static const uint8_t OPT3001_REG_CONFIGURATION = 0x01; diff --git a/esphome/components/ota/ota_backend_arduino_libretiny.cpp b/esphome/components/ota/ota_backend_arduino_libretiny.cpp index 231c4d2dd2..02a5c5750f 100644 --- a/esphome/components/ota/ota_backend_arduino_libretiny.cpp +++ b/esphome/components/ota/ota_backend_arduino_libretiny.cpp @@ -9,7 +9,7 @@ namespace esphome::ota { -static const char *const TAG = "ota"; +ESPHOME_LOG_TAG(TAG, "ota"); std::unique_ptr make_ota_backend() { return make_unique(); } diff --git a/esphome/components/ota/ota_backend_arduino_rp2.cpp b/esphome/components/ota/ota_backend_arduino_rp2.cpp index 48725b1265..74f44c0b3b 100644 --- a/esphome/components/ota/ota_backend_arduino_rp2.cpp +++ b/esphome/components/ota/ota_backend_arduino_rp2.cpp @@ -11,7 +11,7 @@ namespace esphome::ota { -static const char *const TAG = "ota"; +ESPHOME_LOG_TAG(TAG, "ota"); std::unique_ptr make_ota_backend() { return make_unique(); } diff --git a/esphome/components/ota/ota_backend_esp8266.cpp b/esphome/components/ota/ota_backend_esp8266.cpp index 2a6a9e08b1..5be55a5200 100644 --- a/esphome/components/ota/ota_backend_esp8266.cpp +++ b/esphome/components/ota/ota_backend_esp8266.cpp @@ -46,7 +46,7 @@ static constexpr size_t MIN_BUFFER_SIZE = 256; namespace esphome::ota { -static const char *const TAG = "ota"; +ESPHOME_LOG_TAG(TAG, "ota"); std::unique_ptr make_ota_backend() { return make_unique(); } diff --git a/esphome/components/ota/ota_backend_esp_idf.cpp b/esphome/components/ota/ota_backend_esp_idf.cpp index f33f37bbeb..2316aad5cf 100644 --- a/esphome/components/ota/ota_backend_esp_idf.cpp +++ b/esphome/components/ota/ota_backend_esp_idf.cpp @@ -15,7 +15,7 @@ namespace esphome::ota { -static const char *const TAG = "ota"; +ESPHOME_LOG_TAG(TAG, "ota"); std::unique_ptr make_ota_backend() { return make_unique(); } diff --git a/esphome/components/ota/ota_backend_host.cpp b/esphome/components/ota/ota_backend_host.cpp index 89e3f99e1e..456fbb5863 100644 --- a/esphome/components/ota/ota_backend_host.cpp +++ b/esphome/components/ota/ota_backend_host.cpp @@ -27,7 +27,7 @@ namespace esphome::ota { namespace { -const char *const TAG = "ota"; +ESPHOME_LOG_TAG(TAG, "ota"); constexpr size_t MAX_OTA_SIZE = 256u * 1024u * 1024u; // 256 MiB constexpr size_t HEADER_PEEK_SIZE = 64; diff --git a/esphome/components/ota/ota_bootloader_esp_idf.cpp b/esphome/components/ota/ota_bootloader_esp_idf.cpp index 5a83d92689..a59d010e4c 100644 --- a/esphome/components/ota/ota_bootloader_esp_idf.cpp +++ b/esphome/components/ota/ota_bootloader_esp_idf.cpp @@ -12,7 +12,7 @@ namespace esphome::ota { -static const char *const TAG = "ota"; +ESPHOME_LOG_TAG(TAG, "ota"); OTAResponseTypes IDFOTABackend::register_and_validate_bootloader_part_() { // Register the bootloader partition diff --git a/esphome/components/ota/ota_partitions_esp_idf.cpp b/esphome/components/ota/ota_partitions_esp_idf.cpp index d2b1196de6..f9ce1b49e1 100644 --- a/esphome/components/ota/ota_partitions_esp_idf.cpp +++ b/esphome/components/ota/ota_partitions_esp_idf.cpp @@ -16,7 +16,7 @@ namespace esphome::ota { -static const char *const TAG = "ota"; +ESPHOME_LOG_TAG(TAG, "ota"); static inline bool check_overlap(uint32_t a_offset, size_t a_size, uint32_t b_offset, size_t b_size) { return (a_offset + a_size > b_offset && b_offset + b_size > a_offset); diff --git a/esphome/components/ota/ota_signature_esp_idf.cpp b/esphome/components/ota/ota_signature_esp_idf.cpp index 2192a79441..59ffa9edb0 100644 --- a/esphome/components/ota/ota_signature_esp_idf.cpp +++ b/esphome/components/ota/ota_signature_esp_idf.cpp @@ -30,7 +30,7 @@ namespace esphome::ota { -static const char *const TAG = "ota"; +ESPHOME_LOG_TAG(TAG, "ota"); // Route the "Signature check: " prefix (and its per-block form) through one // shared format string each, so the prefix is pooled once by the linker instead diff --git a/esphome/components/output/button/output_button.cpp b/esphome/components/output/button/output_button.cpp index 5833743586..6ebbae13d6 100644 --- a/esphome/components/output/button/output_button.cpp +++ b/esphome/components/output/button/output_button.cpp @@ -3,7 +3,7 @@ namespace esphome::output { -static const char *const TAG = "output.button"; +ESPHOME_LOG_TAG(TAG, "output.button"); void OutputButton::dump_config() { LOG_BUTTON("", "Output Button", this); diff --git a/esphome/components/output/float_output.cpp b/esphome/components/output/float_output.cpp index e2b029f368..8057d0f9f1 100644 --- a/esphome/components/output/float_output.cpp +++ b/esphome/components/output/float_output.cpp @@ -4,7 +4,7 @@ namespace esphome::output { -static const char *const TAG = "output.float"; +ESPHOME_LOG_TAG(TAG, "output.float"); #ifdef USE_OUTPUT_FLOAT_POWER_SCALING void FloatOutput::set_max_power(float max_power) { diff --git a/esphome/components/output/lock/output_lock.cpp b/esphome/components/output/lock/output_lock.cpp index ee9d918542..2f90f602f0 100644 --- a/esphome/components/output/lock/output_lock.cpp +++ b/esphome/components/output/lock/output_lock.cpp @@ -3,7 +3,7 @@ namespace esphome::output { -static const char *const TAG = "output.lock"; +ESPHOME_LOG_TAG(TAG, "output.lock"); void OutputLock::dump_config() { LOG_LOCK("", "Output Lock", this); } diff --git a/esphome/components/output/switch/output_switch.cpp b/esphome/components/output/switch/output_switch.cpp index a21cbc0f6b..a7bbbab5e6 100644 --- a/esphome/components/output/switch/output_switch.cpp +++ b/esphome/components/output/switch/output_switch.cpp @@ -3,7 +3,7 @@ namespace esphome::output { -static const char *const TAG = "output.switch"; +ESPHOME_LOG_TAG(TAG, "output.switch"); void OutputSwitch::dump_config() { LOG_SWITCH("", "Output Switch", this); } void OutputSwitch::setup() { this->control(this->get_initial_state_with_restore_mode().value_or(false)); } diff --git a/esphome/components/packet_transport/packet_transport.cpp b/esphome/components/packet_transport/packet_transport.cpp index 998e1be5fc..f2dc43654a 100644 --- a/esphome/components/packet_transport/packet_transport.cpp +++ b/esphome/components/packet_transport/packet_transport.cpp @@ -50,7 +50,7 @@ static constexpr size_t PACKET_MAX_LOG_BYTES = 168; * Ping key (4 bytes) * */ -static const char *const TAG = "packet_transport"; +ESPHOME_LOG_TAG(TAG, "packet_transport"); static size_t round4(size_t value) { return (value + 3) & ~3; } diff --git a/esphome/components/partition/light_partition.cpp b/esphome/components/partition/light_partition.cpp index 2755f82294..6f2645b365 100644 --- a/esphome/components/partition/light_partition.cpp +++ b/esphome/components/partition/light_partition.cpp @@ -3,6 +3,6 @@ namespace esphome::partition { -static const char *const TAG = "partition.light"; +ESPHOME_LOG_TAG(TAG, "partition.light"); } // namespace esphome::partition diff --git a/esphome/components/pca6416a/pca6416a.cpp b/esphome/components/pca6416a/pca6416a.cpp index 4c19feab6e..f805a8da54 100644 --- a/esphome/components/pca6416a/pca6416a.cpp +++ b/esphome/components/pca6416a/pca6416a.cpp @@ -20,7 +20,7 @@ enum PCA6416AGPIORegisters { PCAL6416A_PULL_DIR1 = 0x49, }; -static const char *const TAG = "pca6416a"; +ESPHOME_LOG_TAG(TAG, "pca6416a"); void PCA6416AComponent::setup() { // Test to see if device exists diff --git a/esphome/components/pca9554/pca9554.cpp b/esphome/components/pca9554/pca9554.cpp index c3ea6a3c0c..f367d14067 100644 --- a/esphome/components/pca9554/pca9554.cpp +++ b/esphome/components/pca9554/pca9554.cpp @@ -9,7 +9,7 @@ const uint8_t OUTPUT_REG = 1; const uint8_t INVERT_REG = 2; const uint8_t CONFIG_REG = 3; -static const char *const TAG = "pca9554"; +ESPHOME_LOG_TAG(TAG, "pca9554"); void PCA9554Component::setup() { this->reg_width_ = (this->pin_count_ + 7) / 8; diff --git a/esphome/components/pca9685/pca9685_output.cpp b/esphome/components/pca9685/pca9685_output.cpp index 533b3391b1..fe417ed65d 100644 --- a/esphome/components/pca9685/pca9685_output.cpp +++ b/esphome/components/pca9685/pca9685_output.cpp @@ -5,7 +5,7 @@ namespace esphome::pca9685 { -static const char *const TAG = "pca9685"; +ESPHOME_LOG_TAG(TAG, "pca9685"); // PCA9685 mode constants are now inline constexpr in pca9685_output.h diff --git a/esphome/components/pcd8544/pcd_8544.cpp b/esphome/components/pcd8544/pcd_8544.cpp index c80283ffc9..953c4ac19b 100644 --- a/esphome/components/pcd8544/pcd_8544.cpp +++ b/esphome/components/pcd8544/pcd_8544.cpp @@ -5,7 +5,7 @@ namespace esphome::pcd8544 { -static const char *const TAG = "pcd_8544"; +ESPHOME_LOG_TAG(TAG, "pcd_8544"); void PCD8544::setup_pins_() { this->spi_setup(); diff --git a/esphome/components/pcf85063/pcf85063.cpp b/esphome/components/pcf85063/pcf85063.cpp index 6ec61770f2..8ce76e9781 100644 --- a/esphome/components/pcf85063/pcf85063.cpp +++ b/esphome/components/pcf85063/pcf85063.cpp @@ -6,7 +6,7 @@ namespace esphome::pcf85063 { -static const char *const TAG = "pcf85063"; +ESPHOME_LOG_TAG(TAG, "pcf85063"); void PCF85063Component::setup() { if (!this->read_rtc_()) { diff --git a/esphome/components/pcf8563/pcf8563.cpp b/esphome/components/pcf8563/pcf8563.cpp index 93c0f2bdf2..90ea4b3fd1 100644 --- a/esphome/components/pcf8563/pcf8563.cpp +++ b/esphome/components/pcf8563/pcf8563.cpp @@ -6,7 +6,7 @@ namespace esphome::pcf8563 { -static const char *const TAG = "PCF8563"; +ESPHOME_LOG_TAG(TAG, "PCF8563"); void PCF8563Component::setup() { if (!this->read_rtc_()) { diff --git a/esphome/components/pcf8574/pcf8574.cpp b/esphome/components/pcf8574/pcf8574.cpp index 2e054b0683..727e9a2026 100644 --- a/esphome/components/pcf8574/pcf8574.cpp +++ b/esphome/components/pcf8574/pcf8574.cpp @@ -3,7 +3,7 @@ namespace esphome::pcf8574 { -static const char *const TAG = "pcf8574"; +ESPHOME_LOG_TAG(TAG, "pcf8574"); void PCF8574Component::setup() { if (!this->read_gpio_()) { diff --git a/esphome/components/pcm5122/pcm5122.cpp b/esphome/components/pcm5122/pcm5122.cpp index 4f6417f6c0..0ca851357f 100644 --- a/esphome/components/pcm5122/pcm5122.cpp +++ b/esphome/components/pcm5122/pcm5122.cpp @@ -7,7 +7,7 @@ namespace esphome::pcm5122 { -static const char *const TAG = "pcm5122"; +ESPHOME_LOG_TAG(TAG, "pcm5122"); void PCM5122::setup() { // Hold XSMT low (soft mute asserted) until init completes diff --git a/esphome/components/pcm5122/pcm5122_gpio.cpp b/esphome/components/pcm5122/pcm5122_gpio.cpp index 1aef130457..104b2cb535 100644 --- a/esphome/components/pcm5122/pcm5122_gpio.cpp +++ b/esphome/components/pcm5122/pcm5122_gpio.cpp @@ -5,7 +5,7 @@ namespace esphome::pcm5122 { -static const char *const TAG = "pcm5122.gpio"; +ESPHOME_LOG_TAG(TAG, "pcm5122.gpio"); void PCM5122GPIOPin::setup() { this->pin_mode(this->flags_); } diff --git a/esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp b/esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp index e8e9530dba..9bc10872d2 100644 --- a/esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp +++ b/esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp @@ -14,7 +14,7 @@ static const uint8_t PI4IOE5V6408_REGISTER_IN_STATE = 0x0F; static const uint8_t PI4IOE5V6408_REGISTER_INTERRUPT_ENABLE_MASK = 0x11; static const uint8_t PI4IOE5V6408_REGISTER_INTERRUPT_STATUS = 0x13; -static const char *const TAG = "pi4ioe5v6408"; +ESPHOME_LOG_TAG(TAG, "pi4ioe5v6408"); void PI4IOE5V6408Component::setup() { if (this->reset_) { diff --git a/esphome/components/pid/pid_autotuner.cpp b/esphome/components/pid/pid_autotuner.cpp index a7ae631956..8b9ce7bbee 100644 --- a/esphome/components/pid/pid_autotuner.cpp +++ b/esphome/components/pid/pid_autotuner.cpp @@ -5,7 +5,7 @@ namespace esphome::pid { -static const char *const TAG = "pid.autotune"; +ESPHOME_LOG_TAG(TAG, "pid.autotune"); /* * # PID Autotuner diff --git a/esphome/components/pid/pid_climate.cpp b/esphome/components/pid/pid_climate.cpp index 1f0d45b084..67585f65e8 100644 --- a/esphome/components/pid/pid_climate.cpp +++ b/esphome/components/pid/pid_climate.cpp @@ -3,7 +3,7 @@ namespace esphome::pid { -static const char *const TAG = "pid.climate"; +ESPHOME_LOG_TAG(TAG, "pid.climate"); bool PIDClimate::set_deadband_thresholds(float threshold_low, float threshold_high) { if (threshold_low > threshold_high) { diff --git a/esphome/components/pid/sensor/pid_climate_sensor.cpp b/esphome/components/pid/sensor/pid_climate_sensor.cpp index afc77efde3..1fbb42a0b1 100644 --- a/esphome/components/pid/sensor/pid_climate_sensor.cpp +++ b/esphome/components/pid/sensor/pid_climate_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::pid { -static const char *const TAG = "pid.sensor"; +ESPHOME_LOG_TAG(TAG, "pid.sensor"); void PIDClimateSensor::setup() { this->parent_->add_on_pid_computed_callback([this]() { this->update_from_parent_(); }); diff --git a/esphome/components/pipsolar/output/pipsolar_output.cpp b/esphome/components/pipsolar/output/pipsolar_output.cpp index 1af753fce3..21e1a4ffcb 100644 --- a/esphome/components/pipsolar/output/pipsolar_output.cpp +++ b/esphome/components/pipsolar/output/pipsolar_output.cpp @@ -4,7 +4,7 @@ namespace esphome::pipsolar { -static const char *const TAG = "pipsolar.output"; +ESPHOME_LOG_TAG(TAG, "pipsolar.output"); void PipsolarOutput::write_state(float state) { char tmp[16]; diff --git a/esphome/components/pipsolar/pipsolar.cpp b/esphome/components/pipsolar/pipsolar.cpp index bd5733fe74..ade93b8735 100644 --- a/esphome/components/pipsolar/pipsolar.cpp +++ b/esphome/components/pipsolar/pipsolar.cpp @@ -4,7 +4,7 @@ namespace esphome::pipsolar { -static const char *const TAG = "pipsolar"; +ESPHOME_LOG_TAG(TAG, "pipsolar"); void Pipsolar::setup() { this->state_ = STATE_IDLE; diff --git a/esphome/components/pipsolar/switch/pipsolar_switch.cpp b/esphome/components/pipsolar/switch/pipsolar_switch.cpp index 1eedfed0fd..266df24630 100644 --- a/esphome/components/pipsolar/switch/pipsolar_switch.cpp +++ b/esphome/components/pipsolar/switch/pipsolar_switch.cpp @@ -4,7 +4,7 @@ namespace esphome::pipsolar { -static const char *const TAG = "pipsolar.switch"; +ESPHOME_LOG_TAG(TAG, "pipsolar.switch"); void PipsolarSwitch::dump_config() { LOG_SWITCH("", "Pipsolar Switch", this); } void PipsolarSwitch::write_state(bool state) { diff --git a/esphome/components/pixoo/pixoo.cpp b/esphome/components/pixoo/pixoo.cpp index aa035be347..7e9b0bd89b 100644 --- a/esphome/components/pixoo/pixoo.cpp +++ b/esphome/components/pixoo/pixoo.cpp @@ -8,7 +8,7 @@ namespace esphome::pixoo { -static const char *const TAG = "pixoo"; +ESPHOME_LOG_TAG(TAG, "pixoo"); // Divoom LED-board packet protocol. static constexpr uint8_t PACKET_HEAD = 0xAA; diff --git a/esphome/components/pm1006/pm1006.cpp b/esphome/components/pm1006/pm1006.cpp index d4c6824713..ebd508b535 100644 --- a/esphome/components/pm1006/pm1006.cpp +++ b/esphome/components/pm1006/pm1006.cpp @@ -3,7 +3,7 @@ namespace esphome::pm1006 { -static const char *const TAG = "pm1006"; +ESPHOME_LOG_TAG(TAG, "pm1006"); static const uint8_t PM1006_RESPONSE_HEADER[] = {0x16, 0x11, 0x0B}; static const uint8_t PM1006_REQUEST[] = {0x11, 0x02, 0x0B, 0x01, 0xE1}; diff --git a/esphome/components/pm2005/pm2005.cpp b/esphome/components/pm2005/pm2005.cpp index 54a98bf3ad..784a555e02 100644 --- a/esphome/components/pm2005/pm2005.cpp +++ b/esphome/components/pm2005/pm2005.cpp @@ -3,7 +3,7 @@ namespace esphome::pm2005 { -static const char *const TAG = "pm2005"; +ESPHOME_LOG_TAG(TAG, "pm2005"); // Converts a sensor situation to a human readable string static const LogString *pm2005_get_situation_string(int status) { diff --git a/esphome/components/pmsa003i/pmsa003i.cpp b/esphome/components/pmsa003i/pmsa003i.cpp index f20b93fff8..6885795e8a 100644 --- a/esphome/components/pmsa003i/pmsa003i.cpp +++ b/esphome/components/pmsa003i/pmsa003i.cpp @@ -5,7 +5,7 @@ namespace esphome::pmsa003i { -static const char *const TAG = "pmsa003i"; +ESPHOME_LOG_TAG(TAG, "pmsa003i"); static const uint8_t COUNT_PAYLOAD_BYTES = 28; static const uint8_t COUNT_PAYLOAD_LENGTH_BYTES = 2; diff --git a/esphome/components/pmsx003/pmsx003.cpp b/esphome/components/pmsx003/pmsx003.cpp index f8d890ac9e..14b1f60df5 100644 --- a/esphome/components/pmsx003/pmsx003.cpp +++ b/esphome/components/pmsx003/pmsx003.cpp @@ -4,7 +4,7 @@ namespace esphome::pmsx003 { -static const char *const TAG = "pmsx003"; +ESPHOME_LOG_TAG(TAG, "pmsx003"); static const uint8_t START_CHARACTER_1 = 0x42; static const uint8_t START_CHARACTER_2 = 0x4D; diff --git a/esphome/components/pmwcs3/pmwcs3.cpp b/esphome/components/pmwcs3/pmwcs3.cpp index 94c0c30766..7493f5d97f 100644 --- a/esphome/components/pmwcs3/pmwcs3.cpp +++ b/esphome/components/pmwcs3/pmwcs3.cpp @@ -20,7 +20,7 @@ static const uint8_t PMWCS3_REG_RES = 0x0B; static const uint8_t PMWCS3_REG_RC = 0x0C; static const uint8_t PMWCS3_REG_RT = 0x0D; -static const char *const TAG = "pmwcs3"; +ESPHOME_LOG_TAG(TAG, "pmwcs3"); void PMWCS3Component::new_i2c_address(uint8_t address) { if (!this->write_byte(PMWCS3_SET_I2C_ADDRESS, address)) { diff --git a/esphome/components/pn532/pn532.cpp b/esphome/components/pn532/pn532.cpp index 89392105a2..8fd92c9031 100644 --- a/esphome/components/pn532/pn532.cpp +++ b/esphome/components/pn532/pn532.cpp @@ -14,7 +14,7 @@ namespace esphome::pn532 { -static const char *const TAG = "pn532"; +ESPHOME_LOG_TAG(TAG, "pn532"); void PN532::setup() { // Get version data diff --git a/esphome/components/pn532/pn532_mifare_classic.cpp b/esphome/components/pn532/pn532_mifare_classic.cpp index 9f937b3e28..878e07825d 100644 --- a/esphome/components/pn532/pn532_mifare_classic.cpp +++ b/esphome/components/pn532/pn532_mifare_classic.cpp @@ -8,7 +8,7 @@ namespace esphome::pn532 { -static const char *const TAG = "pn532.mifare_classic"; +ESPHOME_LOG_TAG(TAG, "pn532.mifare_classic"); std::unique_ptr PN532::read_mifare_classic_tag_(nfc::NfcTagUid &uid) { uint8_t current_block = 4; diff --git a/esphome/components/pn532/pn532_mifare_ultralight.cpp b/esphome/components/pn532/pn532_mifare_ultralight.cpp index 90c8523722..afb60bd843 100644 --- a/esphome/components/pn532/pn532_mifare_ultralight.cpp +++ b/esphome/components/pn532/pn532_mifare_ultralight.cpp @@ -7,7 +7,7 @@ namespace esphome::pn532 { -static const char *const TAG = "pn532.mifare_ultralight"; +ESPHOME_LOG_TAG(TAG, "pn532.mifare_ultralight"); std::unique_ptr PN532::read_mifare_ultralight_tag_(nfc::NfcTagUid &uid) { UltralightReadBuffer data; diff --git a/esphome/components/pn532_i2c/pn532_i2c.cpp b/esphome/components/pn532_i2c/pn532_i2c.cpp index 7f00e18d4c..1687edd511 100644 --- a/esphome/components/pn532_i2c/pn532_i2c.cpp +++ b/esphome/components/pn532_i2c/pn532_i2c.cpp @@ -11,7 +11,7 @@ namespace esphome::pn532_i2c { -static const char *const TAG = "pn532_i2c"; +ESPHOME_LOG_TAG(TAG, "pn532_i2c"); bool PN532I2C::is_read_ready() { uint8_t status; diff --git a/esphome/components/pn532_spi/pn532_spi.cpp b/esphome/components/pn532_spi/pn532_spi.cpp index 73d65e4330..e86153be86 100644 --- a/esphome/components/pn532_spi/pn532_spi.cpp +++ b/esphome/components/pn532_spi/pn532_spi.cpp @@ -11,7 +11,7 @@ namespace esphome::pn532_spi { -static const char *const TAG = "pn532_spi"; +ESPHOME_LOG_TAG(TAG, "pn532_spi"); // Maximum bytes to log in verbose hex output static constexpr size_t PN532_MAX_LOG_BYTES = 64; diff --git a/esphome/components/pn7150/pn7150.cpp b/esphome/components/pn7150/pn7150.cpp index 25bb7a0c24..16bbac38e4 100644 --- a/esphome/components/pn7150/pn7150.cpp +++ b/esphome/components/pn7150/pn7150.cpp @@ -4,7 +4,7 @@ namespace esphome::pn7150 { -static const char *const TAG = "pn7150"; +ESPHOME_LOG_TAG(TAG, "pn7150"); void PN7150::dump_config() { ESP_LOGCONFIG(TAG, "PN7150:"); diff --git a/esphome/components/pn7150_i2c/pn7150_i2c.cpp b/esphome/components/pn7150_i2c/pn7150_i2c.cpp index 58d9daa311..a87bd7d32e 100644 --- a/esphome/components/pn7150_i2c/pn7150_i2c.cpp +++ b/esphome/components/pn7150_i2c/pn7150_i2c.cpp @@ -4,7 +4,7 @@ namespace esphome::pn7150_i2c { -static const char *const TAG = "pn7150_i2c"; +ESPHOME_LOG_TAG(TAG, "pn7150_i2c"); uint8_t PN7150I2C::read_nfcc(nfc::NciMessage &rx, const uint16_t timeout) { if (this->wait_for_irq_(timeout) != nfc::STATUS_OK) { diff --git a/esphome/components/pn7160/pn7160.cpp b/esphome/components/pn7160/pn7160.cpp index 185ff0ce09..7460f7cb6f 100644 --- a/esphome/components/pn7160/pn7160.cpp +++ b/esphome/components/pn7160/pn7160.cpp @@ -5,7 +5,7 @@ namespace esphome::pn7160 { -static const char *const TAG = "pn7160"; +ESPHOME_LOG_TAG(TAG, "pn7160"); void PN7160::setup() { if (this->dwl_req_pin_ != nullptr) { diff --git a/esphome/components/pn7160_i2c/pn7160_i2c.cpp b/esphome/components/pn7160_i2c/pn7160_i2c.cpp index d559c6c251..c9da1f4ad2 100644 --- a/esphome/components/pn7160_i2c/pn7160_i2c.cpp +++ b/esphome/components/pn7160_i2c/pn7160_i2c.cpp @@ -4,7 +4,7 @@ namespace esphome::pn7160_i2c { -static const char *const TAG = "pn7160_i2c"; +ESPHOME_LOG_TAG(TAG, "pn7160_i2c"); uint8_t PN7160I2C::read_nfcc(nfc::NciMessage &rx, const uint16_t timeout) { if (this->wait_for_irq_(timeout) != nfc::STATUS_OK) { diff --git a/esphome/components/pn7160_spi/pn7160_spi.cpp b/esphome/components/pn7160_spi/pn7160_spi.cpp index 85a6c1fb7d..2914b11e48 100644 --- a/esphome/components/pn7160_spi/pn7160_spi.cpp +++ b/esphome/components/pn7160_spi/pn7160_spi.cpp @@ -3,7 +3,7 @@ namespace esphome::pn7160_spi { -static const char *const TAG = "pn7160_spi"; +ESPHOME_LOG_TAG(TAG, "pn7160_spi"); void PN7160Spi::setup() { this->spi_setup(); diff --git a/esphome/components/pn71xx/pn71xx.cpp b/esphome/components/pn71xx/pn71xx.cpp index 6a24acd843..469700e01e 100644 --- a/esphome/components/pn71xx/pn71xx.cpp +++ b/esphome/components/pn71xx/pn71xx.cpp @@ -10,7 +10,7 @@ namespace esphome::pn71xx { -static const char *const TAG = "pn71xx"; +ESPHOME_LOG_TAG(TAG, "pn71xx"); // Builds a message with a URI record and, optionally, the Home Assistant Android app record static std::unique_ptr build_uri_message(const std::string &uri, diff --git a/esphome/components/pn71xx/pn71xx_mifare_classic.cpp b/esphome/components/pn71xx/pn71xx_mifare_classic.cpp index c1c927634d..e1e805d108 100644 --- a/esphome/components/pn71xx/pn71xx_mifare_classic.cpp +++ b/esphome/components/pn71xx/pn71xx_mifare_classic.cpp @@ -8,7 +8,7 @@ namespace esphome::pn71xx { -static const char *const TAG = "pn71xx.mifare_classic"; +ESPHOME_LOG_TAG(TAG, "pn71xx.mifare_classic"); uint8_t PN71xx::read_mifare_classic_tag_(nfc::NfcTag &tag) { uint8_t current_block = 4; diff --git a/esphome/components/pn71xx/pn71xx_mifare_ultralight.cpp b/esphome/components/pn71xx/pn71xx_mifare_ultralight.cpp index 53874e18de..68b86b6257 100644 --- a/esphome/components/pn71xx/pn71xx_mifare_ultralight.cpp +++ b/esphome/components/pn71xx/pn71xx_mifare_ultralight.cpp @@ -8,7 +8,7 @@ namespace esphome::pn71xx { -static const char *const TAG = "pn71xx.mifare_ultralight"; +ESPHOME_LOG_TAG(TAG, "pn71xx.mifare_ultralight"); uint8_t PN71xx::read_mifare_ultralight_tag_(nfc::NfcTag &tag) { UltralightReadBuffer data; diff --git a/esphome/components/power_supply/power_supply.cpp b/esphome/components/power_supply/power_supply.cpp index f094f6e2e9..7daee1663a 100644 --- a/esphome/components/power_supply/power_supply.cpp +++ b/esphome/components/power_supply/power_supply.cpp @@ -3,7 +3,7 @@ namespace esphome::power_supply { -static const char *const TAG = "power_supply"; +ESPHOME_LOG_TAG(TAG, "power_supply"); void PowerSupply::setup() { this->pin_->setup(); diff --git a/esphome/components/provisioning/provisioning.cpp b/esphome/components/provisioning/provisioning.cpp index 02c089bfed..0089bdcbb7 100644 --- a/esphome/components/provisioning/provisioning.cpp +++ b/esphome/components/provisioning/provisioning.cpp @@ -10,7 +10,7 @@ namespace esphome::provisioning { -static const char *const TAG = "provisioning"; +ESPHOME_LOG_TAG(TAG, "provisioning"); ProvisioningManager *global_provisioning_manager = // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) nullptr; diff --git a/esphome/components/psram/psram.cpp b/esphome/components/psram/psram.cpp index ab680c9695..55b6873d05 100644 --- a/esphome/components/psram/psram.cpp +++ b/esphome/components/psram/psram.cpp @@ -9,7 +9,7 @@ #include namespace esphome::psram { -static const char *const TAG = "psram"; +ESPHOME_LOG_TAG(TAG, "psram"); void PsramComponent::dump_config() { ESP_LOGCONFIG(TAG, "PSRAM:"); diff --git a/esphome/components/pulse_counter/pulse_counter_sensor.cpp b/esphome/components/pulse_counter/pulse_counter_sensor.cpp index 13bf3baf83..b104016fb8 100644 --- a/esphome/components/pulse_counter/pulse_counter_sensor.cpp +++ b/esphome/components/pulse_counter/pulse_counter_sensor.cpp @@ -9,7 +9,7 @@ namespace esphome::pulse_counter { -static const char *const TAG = "pulse_counter"; +ESPHOME_LOG_TAG(TAG, "pulse_counter"); const char *const EDGE_MODE_TO_STRING[] = {"DISABLE", "INCREMENT", "DECREMENT"}; diff --git a/esphome/components/pulse_meter/pulse_meter_sensor.cpp b/esphome/components/pulse_meter/pulse_meter_sensor.cpp index d6959d1a96..c2d4c648ce 100644 --- a/esphome/components/pulse_meter/pulse_meter_sensor.cpp +++ b/esphome/components/pulse_meter/pulse_meter_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::pulse_meter { -static const char *const TAG = "pulse_meter"; +ESPHOME_LOG_TAG(TAG, "pulse_meter"); void PulseMeterSensor::set_total_pulses(uint32_t pulses) { this->total_pulses_ = pulses; diff --git a/esphome/components/pulse_width/pulse_width.cpp b/esphome/components/pulse_width/pulse_width.cpp index 5209ed5352..53896cbacd 100644 --- a/esphome/components/pulse_width/pulse_width.cpp +++ b/esphome/components/pulse_width/pulse_width.cpp @@ -3,7 +3,7 @@ namespace esphome::pulse_width { -static const char *const TAG = "pulse_width"; +ESPHOME_LOG_TAG(TAG, "pulse_width"); void IRAM_ATTR PulseWidthSensorStore::gpio_intr(PulseWidthSensorStore *arg) { const bool new_level = arg->pin_.digital_read(); diff --git a/esphome/components/pvvx_mithermometer/display/pvvx_display.cpp b/esphome/components/pvvx_mithermometer/display/pvvx_display.cpp index 64b8974901..57876f8c07 100644 --- a/esphome/components/pvvx_mithermometer/display/pvvx_display.cpp +++ b/esphome/components/pvvx_mithermometer/display/pvvx_display.cpp @@ -7,7 +7,7 @@ namespace esphome::pvvx_mithermometer { -static const char *const TAG = "display.pvvx_mithermometer"; +ESPHOME_LOG_TAG(TAG, "display.pvvx_mithermometer"); void PVVXDisplay::dump_config() { char service_buf[ble_device_base::UUID_STR_LEN]; diff --git a/esphome/components/pvvx_mithermometer/pvvx_mithermometer.cpp b/esphome/components/pvvx_mithermometer/pvvx_mithermometer.cpp index 9141d12b16..0d7f440f15 100644 --- a/esphome/components/pvvx_mithermometer/pvvx_mithermometer.cpp +++ b/esphome/components/pvvx_mithermometer/pvvx_mithermometer.cpp @@ -3,7 +3,7 @@ namespace esphome::pvvx_mithermometer { -static const char *const TAG = "pvvx_mithermometer"; +ESPHOME_LOG_TAG(TAG, "pvvx_mithermometer"); void PVVXMiThermometer::dump_config() { ESP_LOGCONFIG(TAG, "PVVX MiThermometer"); diff --git a/esphome/components/pylontech/pylontech.cpp b/esphome/components/pylontech/pylontech.cpp index 932b71ba55..0898b92486 100644 --- a/esphome/components/pylontech/pylontech.cpp +++ b/esphome/components/pylontech/pylontech.cpp @@ -26,7 +26,7 @@ namespace esphome::pylontech { -static const char *const TAG = "pylontech"; +ESPHOME_LOG_TAG(TAG, "pylontech"); static const int MAX_DATA_LENGTH_BYTES = 256; static const uint8_t ASCII_LF = 0x0A; diff --git a/esphome/components/pylontech/sensor/pylontech_sensor.cpp b/esphome/components/pylontech/sensor/pylontech_sensor.cpp index e2def28be5..dc236f47a5 100644 --- a/esphome/components/pylontech/sensor/pylontech_sensor.cpp +++ b/esphome/components/pylontech/sensor/pylontech_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::pylontech { -static const char *const TAG = "pylontech.sensor"; +ESPHOME_LOG_TAG(TAG, "pylontech.sensor"); PylontechSensor::PylontechSensor(int8_t bat_num) { this->bat_num_ = bat_num; } diff --git a/esphome/components/pylontech/text_sensor/pylontech_text_sensor.cpp b/esphome/components/pylontech/text_sensor/pylontech_text_sensor.cpp index a7c9db1599..1beb04064e 100644 --- a/esphome/components/pylontech/text_sensor/pylontech_text_sensor.cpp +++ b/esphome/components/pylontech/text_sensor/pylontech_text_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::pylontech { -static const char *const TAG = "pylontech.textsensor"; +ESPHOME_LOG_TAG(TAG, "pylontech.textsensor"); PylontechTextSensor::PylontechTextSensor(int8_t bat_num) { this->bat_num_ = bat_num; } diff --git a/esphome/components/pzem004t/pzem004t.cpp b/esphome/components/pzem004t/pzem004t.cpp index a28b448340..7809e803c9 100644 --- a/esphome/components/pzem004t/pzem004t.cpp +++ b/esphome/components/pzem004t/pzem004t.cpp @@ -5,7 +5,7 @@ namespace esphome::pzem004t { -static const char *const TAG = "pzem004t"; +ESPHOME_LOG_TAG(TAG, "pzem004t"); void PZEM004T::setup() { // Clear UART buffer diff --git a/esphome/components/pzem6l24/pzem6l24.cpp b/esphome/components/pzem6l24/pzem6l24.cpp index f9f97606a8..41524eebd2 100644 --- a/esphome/components/pzem6l24/pzem6l24.cpp +++ b/esphome/components/pzem6l24/pzem6l24.cpp @@ -8,7 +8,7 @@ namespace esphome::pzem6l24 { -static const char *const TAG = "pzem6l24"; +ESPHOME_LOG_TAG(TAG, "pzem6l24"); // ----------------------------------------------------------------------- // Register map (input registers, starting address 0x0000): diff --git a/esphome/components/pzemac/pzemac.cpp b/esphome/components/pzemac/pzemac.cpp index c0d163c1de..e291844d78 100644 --- a/esphome/components/pzemac/pzemac.cpp +++ b/esphome/components/pzemac/pzemac.cpp @@ -5,7 +5,7 @@ namespace esphome::pzemac { namespace helpers = modbus::helpers; -static const char *const TAG = "pzemac"; +ESPHOME_LOG_TAG(TAG, "pzemac"); static const uint8_t PZEM_CMD_RESET_ENERGY = 0x42; static const uint8_t PZEM_REGISTER_COUNT = 10; // 10x 16-bit registers diff --git a/esphome/components/pzemdc/pzemdc.cpp b/esphome/components/pzemdc/pzemdc.cpp index eb9a355806..76b9c2b2e0 100644 --- a/esphome/components/pzemdc/pzemdc.cpp +++ b/esphome/components/pzemdc/pzemdc.cpp @@ -5,7 +5,7 @@ namespace esphome::pzemdc { namespace helpers = modbus::helpers; -static const char *const TAG = "pzemdc"; +ESPHOME_LOG_TAG(TAG, "pzemdc"); static const uint8_t PZEM_CMD_RESET_ENERGY = 0x42; static const uint8_t PZEM_REGISTER_COUNT = 8; // 8x 16-bit registers diff --git a/esphome/components/qmc5883l/qmc5883l.cpp b/esphome/components/qmc5883l/qmc5883l.cpp index ba6a71f97d..dcfa46abc5 100644 --- a/esphome/components/qmc5883l/qmc5883l.cpp +++ b/esphome/components/qmc5883l/qmc5883l.cpp @@ -7,7 +7,7 @@ namespace esphome::qmc5883l { -static const char *const TAG = "qmc5883l"; +ESPHOME_LOG_TAG(TAG, "qmc5883l"); static const uint8_t QMC5883L_ADDRESS = 0x0D; diff --git a/esphome/components/qmi8658/qmi8658.cpp b/esphome/components/qmi8658/qmi8658.cpp index 2fd457d290..4f35d5bf36 100644 --- a/esphome/components/qmi8658/qmi8658.cpp +++ b/esphome/components/qmi8658/qmi8658.cpp @@ -4,7 +4,7 @@ namespace esphome::qmi8658 { -static const char *const TAG = "qmi8658"; +ESPHOME_LOG_TAG(TAG, "qmi8658"); // Acceleration scale (g per LSB), indexed by accel_range_ >> 4. // Full-scale = range_g, mapped over a signed 16-bit value (2^15 counts). diff --git a/esphome/components/qmp6988/qmp6988.cpp b/esphome/components/qmp6988/qmp6988.cpp index 547991f75e..ea3bf19eb4 100644 --- a/esphome/components/qmp6988/qmp6988.cpp +++ b/esphome/components/qmp6988/qmp6988.cpp @@ -43,7 +43,7 @@ static const uint8_t QMP6988_CONFIG_REG_FILTER_LEN = 3; static const uint32_t SUBTRACTOR = 8388608; -static const char *const TAG = "qmp6988"; +ESPHOME_LOG_TAG(TAG, "qmp6988"); static const char *oversampling_to_str(QMP6988Oversampling oversampling) { switch (oversampling) { diff --git a/esphome/components/qr_code/qr_code.cpp b/esphome/components/qr_code/qr_code.cpp index edb78b98e1..78d20d9bfe 100644 --- a/esphome/components/qr_code/qr_code.cpp +++ b/esphome/components/qr_code/qr_code.cpp @@ -5,7 +5,7 @@ namespace esphome::qr_code { -static const char *const TAG = "qr_code"; +ESPHOME_LOG_TAG(TAG, "qr_code"); void QrCode::dump_config() { ESP_LOGCONFIG(TAG, diff --git a/esphome/components/qwiic_pir/qwiic_pir.cpp b/esphome/components/qwiic_pir/qwiic_pir.cpp index eb338db772..fffc3514d0 100644 --- a/esphome/components/qwiic_pir/qwiic_pir.cpp +++ b/esphome/components/qwiic_pir/qwiic_pir.cpp @@ -3,7 +3,7 @@ namespace esphome::qwiic_pir { -static const char *const TAG = "qwiic_pir"; +ESPHOME_LOG_TAG(TAG, "qwiic_pir"); void QwiicPIRComponent::setup() { // Verify I2C communcation by reading and verifying the chip ID diff --git a/esphome/components/radio_frequency/radio_frequency.cpp b/esphome/components/radio_frequency/radio_frequency.cpp index a238603217..231d6c3f89 100644 --- a/esphome/components/radio_frequency/radio_frequency.cpp +++ b/esphome/components/radio_frequency/radio_frequency.cpp @@ -6,7 +6,7 @@ namespace esphome::radio_frequency { -static const char *const TAG = "radio_frequency"; +ESPHOME_LOG_TAG(TAG, "radio_frequency"); void RadioFrequency::dump_config() { ESP_LOGCONFIG(TAG, diff --git a/esphome/components/radon_eye_ble/radon_eye_listener.cpp b/esphome/components/radon_eye_ble/radon_eye_listener.cpp index 9ff279cab9..bef5975785 100644 --- a/esphome/components/radon_eye_ble/radon_eye_listener.cpp +++ b/esphome/components/radon_eye_ble/radon_eye_listener.cpp @@ -4,7 +4,7 @@ namespace esphome::radon_eye_ble { -static const char *const TAG = "radon_eye_ble"; +ESPHOME_LOG_TAG(TAG, "radon_eye_ble"); bool RadonEyeListener::parse_device(const ble_device_base::ESPBTDevice &device) { // Radon Eye devices have names starting with "FR:" diff --git a/esphome/components/radon_eye_rd200/radon_eye_rd200.cpp b/esphome/components/radon_eye_rd200/radon_eye_rd200.cpp index de5bd3d8d5..84b89f377b 100644 --- a/esphome/components/radon_eye_rd200/radon_eye_rd200.cpp +++ b/esphome/components/radon_eye_rd200/radon_eye_rd200.cpp @@ -7,7 +7,7 @@ namespace esphome::radon_eye_rd200 { -static const char *const TAG = "radon_eye_rd200"; +ESPHOME_LOG_TAG(TAG, "radon_eye_rd200"); static const esp32_ble_tracker::ESPBTUUID SERVICE_UUID_V1 = esp32_ble_tracker::ESPBTUUID::from_raw("00001523-1212-efde-1523-785feabcd123"); diff --git a/esphome/components/rc522/rc522.cpp b/esphome/components/rc522/rc522.cpp index 7c1b6ae314..6549ba9846 100644 --- a/esphome/components/rc522/rc522.cpp +++ b/esphome/components/rc522/rc522.cpp @@ -9,7 +9,7 @@ namespace esphome::rc522 { static const uint8_t WAIT_I_RQ = 0x30; // RxIRq and IdleIRq -static const char *const TAG = "rc522"; +ESPHOME_LOG_TAG(TAG, "rc522"); // Max UID size for RFID tags (4, 7, or 10 bytes) static constexpr size_t RC522_MAX_UID_SIZE = 10; diff --git a/esphome/components/rc522_i2c/rc522_i2c.cpp b/esphome/components/rc522_i2c/rc522_i2c.cpp index dbc86ff8e7..7fc0416030 100644 --- a/esphome/components/rc522_i2c/rc522_i2c.cpp +++ b/esphome/components/rc522_i2c/rc522_i2c.cpp @@ -3,7 +3,7 @@ namespace esphome::rc522_i2c { -static const char *const TAG = "rc522_i2c"; +ESPHOME_LOG_TAG(TAG, "rc522_i2c"); void RC522I2C::dump_config() { RC522::dump_config(); diff --git a/esphome/components/rc522_spi/rc522_spi.cpp b/esphome/components/rc522_spi/rc522_spi.cpp index b63ad1cfdc..2d9bbf5b52 100644 --- a/esphome/components/rc522_spi/rc522_spi.cpp +++ b/esphome/components/rc522_spi/rc522_spi.cpp @@ -7,7 +7,7 @@ namespace esphome::rc522_spi { -static const char *const TAG = "rc522_spi"; +ESPHOME_LOG_TAG(TAG, "rc522_spi"); void RC522Spi::setup() { this->spi_setup(); diff --git a/esphome/components/rd03d/rd03d.cpp b/esphome/components/rd03d/rd03d.cpp index 18328def9f..7a2af571c7 100644 --- a/esphome/components/rd03d/rd03d.cpp +++ b/esphome/components/rd03d/rd03d.cpp @@ -8,7 +8,7 @@ namespace esphome::rd03d { -static const char *const TAG = "rd03d"; +ESPHOME_LOG_TAG(TAG, "rd03d"); // Delay before sending configuration commands to allow radar to initialize static constexpr uint32_t SETUP_TIMEOUT_MS = 100; diff --git a/esphome/components/rdm6300/rdm6300.cpp b/esphome/components/rdm6300/rdm6300.cpp index 00c91cbc47..2bdbde9174 100644 --- a/esphome/components/rdm6300/rdm6300.cpp +++ b/esphome/components/rdm6300/rdm6300.cpp @@ -4,7 +4,7 @@ namespace esphome::rdm6300 { -static const char *const TAG = "rdm6300"; +ESPHOME_LOG_TAG(TAG, "rdm6300"); static const uint8_t RDM6300_START_BYTE = 0x02; static const uint8_t RDM6300_END_BYTE = 0x03; diff --git a/esphome/components/remote_base/abbwelcome_protocol.cpp b/esphome/components/remote_base/abbwelcome_protocol.cpp index 2000148ca8..638f33687a 100644 --- a/esphome/components/remote_base/abbwelcome_protocol.cpp +++ b/esphome/components/remote_base/abbwelcome_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.abbwelcome"; +ESPHOME_LOG_TAG(TAG, "remote.abbwelcome"); static constexpr uint32_t BIT_ONE_SPACE_US = 102; static constexpr uint32_t BIT_ZERO_MARK_US = 32; // 18-44 diff --git a/esphome/components/remote_base/aeha_protocol.cpp b/esphome/components/remote_base/aeha_protocol.cpp index 69f91ba90e..eb05f7d21e 100644 --- a/esphome/components/remote_base/aeha_protocol.cpp +++ b/esphome/components/remote_base/aeha_protocol.cpp @@ -4,7 +4,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.aeha"; +ESPHOME_LOG_TAG(TAG, "remote.aeha"); static constexpr uint16_t BITWISE = 425; static constexpr uint16_t HEADER_HIGH_US = BITWISE * 8; diff --git a/esphome/components/remote_base/beo4_protocol.cpp b/esphome/components/remote_base/beo4_protocol.cpp index 9291501ea3..e79e05d839 100644 --- a/esphome/components/remote_base/beo4_protocol.cpp +++ b/esphome/components/remote_base/beo4_protocol.cpp @@ -5,7 +5,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.beo4"; +ESPHOME_LOG_TAG(TAG, "remote.beo4"); // beo4 pulse width, high=carrier_pulse low=data_pulse constexpr uint16_t PW_CARR_US = 200; // carrier pulse length diff --git a/esphome/components/remote_base/brennenstuhl_protocol.cpp b/esphome/components/remote_base/brennenstuhl_protocol.cpp index 35261dc00a..2537ba5560 100644 --- a/esphome/components/remote_base/brennenstuhl_protocol.cpp +++ b/esphome/components/remote_base/brennenstuhl_protocol.cpp @@ -5,7 +5,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.brennenstuhl"; +ESPHOME_LOG_TAG(TAG, "remote.brennenstuhl"); // receiver timing ranges [µs] constexpr uint32_t START_PULSE_MIN = 200; diff --git a/esphome/components/remote_base/byronsx_protocol.cpp b/esphome/components/remote_base/byronsx_protocol.cpp index 11d6d975d1..468b11f695 100644 --- a/esphome/components/remote_base/byronsx_protocol.cpp +++ b/esphome/components/remote_base/byronsx_protocol.cpp @@ -5,7 +5,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.byronsx"; +ESPHOME_LOG_TAG(TAG, "remote.byronsx"); static constexpr uint32_t BIT_TIME_US = 333; static constexpr uint8_t NBITS_ADDRESS = 8; diff --git a/esphome/components/remote_base/canalsat_protocol.cpp b/esphome/components/remote_base/canalsat_protocol.cpp index eafa98ebcc..ac83c37227 100644 --- a/esphome/components/remote_base/canalsat_protocol.cpp +++ b/esphome/components/remote_base/canalsat_protocol.cpp @@ -3,8 +3,8 @@ namespace esphome::remote_base { -static const char *const CANALSAT_TAG = "remote.canalsat"; -static const char *const CANALSATLD_TAG = "remote.canalsatld"; +ESPHOME_LOG_TAG(CANALSAT_TAG, "remote.canalsat"); +ESPHOME_LOG_TAG(CANALSATLD_TAG, "remote.canalsatld"); static constexpr uint16_t CANALSAT_FREQ = 55500; static constexpr uint16_t CANALSATLD_FREQ = 56000; diff --git a/esphome/components/remote_base/coolix_protocol.cpp b/esphome/components/remote_base/coolix_protocol.cpp index 53e1d59f13..e2e54afadb 100644 --- a/esphome/components/remote_base/coolix_protocol.cpp +++ b/esphome/components/remote_base/coolix_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.coolix"; +ESPHOME_LOG_TAG(TAG, "remote.coolix"); static const int32_t TICK_US = 560; static const int32_t HEADER_MARK_US = 8 * TICK_US; diff --git a/esphome/components/remote_base/dish_protocol.cpp b/esphome/components/remote_base/dish_protocol.cpp index 5a89c91a50..6877d661bd 100644 --- a/esphome/components/remote_base/dish_protocol.cpp +++ b/esphome/components/remote_base/dish_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.dish"; +ESPHOME_LOG_TAG(TAG, "remote.dish"); static constexpr uint32_t HEADER_HIGH_US = 400; static constexpr uint32_t HEADER_LOW_US = 6100; diff --git a/esphome/components/remote_base/dooya_protocol.cpp b/esphome/components/remote_base/dooya_protocol.cpp index 6dc7926b4a..5291d69345 100644 --- a/esphome/components/remote_base/dooya_protocol.cpp +++ b/esphome/components/remote_base/dooya_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.dooya"; +ESPHOME_LOG_TAG(TAG, "remote.dooya"); static constexpr uint32_t HEADER_HIGH_US = 5000; static constexpr uint32_t HEADER_LOW_US = 1500; diff --git a/esphome/components/remote_base/drayton_protocol.cpp b/esphome/components/remote_base/drayton_protocol.cpp index 2261bd04e9..598f1a476e 100644 --- a/esphome/components/remote_base/drayton_protocol.cpp +++ b/esphome/components/remote_base/drayton_protocol.cpp @@ -5,7 +5,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.drayton"; +ESPHOME_LOG_TAG(TAG, "remote.drayton"); static constexpr uint32_t BIT_TIME_US = 500; static constexpr uint8_t CARRIER_KHZ = 2; diff --git a/esphome/components/remote_base/dyson_protocol.cpp b/esphome/components/remote_base/dyson_protocol.cpp index 942b40d26f..f6a7943ebd 100644 --- a/esphome/components/remote_base/dyson_protocol.cpp +++ b/esphome/components/remote_base/dyson_protocol.cpp @@ -5,7 +5,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.dyson"; +ESPHOME_LOG_TAG(TAG, "remote.dyson"); // pulsewidth [µs] constexpr uint32_t PW_MARK_US = 780; diff --git a/esphome/components/remote_base/gobox_protocol.cpp b/esphome/components/remote_base/gobox_protocol.cpp index 1d67be86b8..affafa694c 100644 --- a/esphome/components/remote_base/gobox_protocol.cpp +++ b/esphome/components/remote_base/gobox_protocol.cpp @@ -4,7 +4,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.gobox"; +ESPHOME_LOG_TAG(TAG, "remote.gobox"); constexpr uint32_t BIT_MARK_US = 580; // 70us seems like a safe time delta for the receiver... constexpr uint32_t BIT_ONE_SPACE_US = 1640; diff --git a/esphome/components/remote_base/haier_protocol.cpp b/esphome/components/remote_base/haier_protocol.cpp index 8801f1049a..3c9ba7b61f 100644 --- a/esphome/components/remote_base/haier_protocol.cpp +++ b/esphome/components/remote_base/haier_protocol.cpp @@ -4,7 +4,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.haier"; +ESPHOME_LOG_TAG(TAG, "remote.haier"); constexpr uint32_t HEADER_LOW_US = 3100; constexpr uint32_t HEADER_HIGH_US = 4400; diff --git a/esphome/components/remote_base/hob2hood_protocol.cpp b/esphome/components/remote_base/hob2hood_protocol.cpp index 9e706b9fe6..95683ba8cc 100644 --- a/esphome/components/remote_base/hob2hood_protocol.cpp +++ b/esphome/components/remote_base/hob2hood_protocol.cpp @@ -7,7 +7,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.hob2hood"; +ESPHOME_LOG_TAG(TAG, "remote.hob2hood"); // A frame is 25 bits: a leading 0, then the command byte, command + 1 and command + 2. Zero bits are marks // and one bits are spaces; equal neighbours merge into one run of n * BIT_TIME_US plus a fixed adjustment. diff --git a/esphome/components/remote_base/jvc_protocol.cpp b/esphome/components/remote_base/jvc_protocol.cpp index 86a47e757d..6fbbf6ee47 100644 --- a/esphome/components/remote_base/jvc_protocol.cpp +++ b/esphome/components/remote_base/jvc_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.jvc"; +ESPHOME_LOG_TAG(TAG, "remote.jvc"); static constexpr uint8_t NBITS = 16; static constexpr uint32_t HEADER_HIGH_US = 8400; diff --git a/esphome/components/remote_base/keeloq_protocol.cpp b/esphome/components/remote_base/keeloq_protocol.cpp index 8cc9de94b8..caa950218e 100644 --- a/esphome/components/remote_base/keeloq_protocol.cpp +++ b/esphome/components/remote_base/keeloq_protocol.cpp @@ -5,7 +5,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.keeloq"; +ESPHOME_LOG_TAG(TAG, "remote.keeloq"); static constexpr uint32_t BIT_TIME_US = 380; static constexpr uint8_t NBITS_PREAMBLE = 12; diff --git a/esphome/components/remote_base/lg_protocol.cpp b/esphome/components/remote_base/lg_protocol.cpp index e450659b42..07f4b5a1dc 100644 --- a/esphome/components/remote_base/lg_protocol.cpp +++ b/esphome/components/remote_base/lg_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.lg"; +ESPHOME_LOG_TAG(TAG, "remote.lg"); static constexpr uint32_t HEADER_HIGH_US = 8000; static constexpr uint32_t HEADER_LOW_US = 4000; diff --git a/esphome/components/remote_base/magiquest_protocol.cpp b/esphome/components/remote_base/magiquest_protocol.cpp index f417827b38..5b47f7e438 100644 --- a/esphome/components/remote_base/magiquest_protocol.cpp +++ b/esphome/components/remote_base/magiquest_protocol.cpp @@ -7,7 +7,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.magiquest"; +ESPHOME_LOG_TAG(TAG, "remote.magiquest"); static constexpr uint32_t MAGIQUEST_UNIT = 288; // us static constexpr uint32_t MAGIQUEST_ONE_MARK = 2 * MAGIQUEST_UNIT; diff --git a/esphome/components/remote_base/midea_protocol.cpp b/esphome/components/remote_base/midea_protocol.cpp index 6889c5d9b4..57aeda2e90 100644 --- a/esphome/components/remote_base/midea_protocol.cpp +++ b/esphome/components/remote_base/midea_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.midea"; +ESPHOME_LOG_TAG(TAG, "remote.midea"); static const int32_t TICK_US = 560; static const int32_t HEADER_MARK_US = 8 * TICK_US; diff --git a/esphome/components/remote_base/mirage_protocol.cpp b/esphome/components/remote_base/mirage_protocol.cpp index 380cfaecb2..c2a487080b 100644 --- a/esphome/components/remote_base/mirage_protocol.cpp +++ b/esphome/components/remote_base/mirage_protocol.cpp @@ -4,7 +4,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.mirage"; +ESPHOME_LOG_TAG(TAG, "remote.mirage"); constexpr uint32_t HEADER_MARK_US = 8360; constexpr uint32_t HEADER_SPACE_US = 4248; diff --git a/esphome/components/remote_base/nec_protocol.cpp b/esphome/components/remote_base/nec_protocol.cpp index e639248b4e..3edb50141c 100644 --- a/esphome/components/remote_base/nec_protocol.cpp +++ b/esphome/components/remote_base/nec_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.nec"; +ESPHOME_LOG_TAG(TAG, "remote.nec"); static constexpr uint32_t HEADER_HIGH_US = 9000; static constexpr uint32_t HEADER_LOW_US = 4500; diff --git a/esphome/components/remote_base/nexa_protocol.cpp b/esphome/components/remote_base/nexa_protocol.cpp index e691a69598..2d0d2cf757 100644 --- a/esphome/components/remote_base/nexa_protocol.cpp +++ b/esphome/components/remote_base/nexa_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.nexa"; +ESPHOME_LOG_TAG(TAG, "remote.nexa"); static constexpr uint8_t NBITS = 32; static constexpr uint32_t HEADER_HIGH_US = 319; diff --git a/esphome/components/remote_base/panasonic_protocol.cpp b/esphome/components/remote_base/panasonic_protocol.cpp index b026213080..c2fc35d3ec 100644 --- a/esphome/components/remote_base/panasonic_protocol.cpp +++ b/esphome/components/remote_base/panasonic_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.panasonic"; +ESPHOME_LOG_TAG(TAG, "remote.panasonic"); static constexpr uint32_t HEADER_HIGH_US = 3502; static constexpr uint32_t HEADER_LOW_US = 1750; diff --git a/esphome/components/remote_base/pioneer_protocol.cpp b/esphome/components/remote_base/pioneer_protocol.cpp index f4d6aa4026..20603848f1 100644 --- a/esphome/components/remote_base/pioneer_protocol.cpp +++ b/esphome/components/remote_base/pioneer_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.pioneer"; +ESPHOME_LOG_TAG(TAG, "remote.pioneer"); static constexpr uint32_t HEADER_HIGH_US = 9000; static constexpr uint32_t HEADER_LOW_US = 4500; diff --git a/esphome/components/remote_base/pronto_protocol.cpp b/esphome/components/remote_base/pronto_protocol.cpp index dc128d4622..e47ba89291 100644 --- a/esphome/components/remote_base/pronto_protocol.cpp +++ b/esphome/components/remote_base/pronto_protocol.cpp @@ -37,7 +37,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.pronto"; +ESPHOME_LOG_TAG(TAG, "remote.pronto"); bool ProntoData::operator==(const ProntoData &rhs) const { std::vector data1 = encode_pronto(data); diff --git a/esphome/components/remote_base/raw_protocol.cpp b/esphome/components/remote_base/raw_protocol.cpp index 02c2916849..134204aa2a 100644 --- a/esphome/components/remote_base/raw_protocol.cpp +++ b/esphome/components/remote_base/raw_protocol.cpp @@ -4,7 +4,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.raw"; +ESPHOME_LOG_TAG(TAG, "remote.raw"); bool RawDumper::dump(RemoteReceiveData src) { char buffer[256]; diff --git a/esphome/components/remote_base/rc5_protocol.cpp b/esphome/components/remote_base/rc5_protocol.cpp index fd136a4e6d..cec747eb48 100644 --- a/esphome/components/remote_base/rc5_protocol.cpp +++ b/esphome/components/remote_base/rc5_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.rc5"; +ESPHOME_LOG_TAG(TAG, "remote.rc5"); static constexpr uint32_t BIT_TIME_US = 889; static constexpr uint8_t NBITS = 14; diff --git a/esphome/components/remote_base/rc6_protocol.cpp b/esphome/components/remote_base/rc6_protocol.cpp index ddd9e53258..067b8b812e 100644 --- a/esphome/components/remote_base/rc6_protocol.cpp +++ b/esphome/components/remote_base/rc6_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const RC6_TAG = "remote.rc6"; +ESPHOME_LOG_TAG(RC6_TAG, "remote.rc6"); static constexpr uint16_t RC6_FREQ = 36000; static constexpr uint16_t RC6_UNIT = 444; diff --git a/esphome/components/remote_base/rc_switch_protocol.cpp b/esphome/components/remote_base/rc_switch_protocol.cpp index bdd6615d43..a469cf2d45 100644 --- a/esphome/components/remote_base/rc_switch_protocol.cpp +++ b/esphome/components/remote_base/rc_switch_protocol.cpp @@ -6,7 +6,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.rc_switch"; +ESPHOME_LOG_TAG(TAG, "remote.rc_switch"); RCSwitchBase rc_switch_protocol(uint8_t index) { // entry 0 is the all-zero protocol, so an out of range index from a lambda transmits nothing diff --git a/esphome/components/remote_base/remote_base.cpp b/esphome/components/remote_base/remote_base.cpp index a685b733b4..7205fb6221 100644 --- a/esphome/components/remote_base/remote_base.cpp +++ b/esphome/components/remote_base/remote_base.cpp @@ -4,7 +4,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote_base"; +ESPHOME_LOG_TAG(TAG, "remote_base"); /* RemoteReceiveData */ diff --git a/esphome/components/remote_base/roomba_protocol.cpp b/esphome/components/remote_base/roomba_protocol.cpp index 8053792a60..bd40a7a544 100644 --- a/esphome/components/remote_base/roomba_protocol.cpp +++ b/esphome/components/remote_base/roomba_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.roomba"; +ESPHOME_LOG_TAG(TAG, "remote.roomba"); static constexpr uint8_t NBITS = 8; static constexpr uint32_t BIT_ONE_HIGH_US = 3000; diff --git a/esphome/components/remote_base/samsung36_protocol.cpp b/esphome/components/remote_base/samsung36_protocol.cpp index ded8c71aa3..c59ccf0106 100644 --- a/esphome/components/remote_base/samsung36_protocol.cpp +++ b/esphome/components/remote_base/samsung36_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.samsung36"; +ESPHOME_LOG_TAG(TAG, "remote.samsung36"); static constexpr uint8_t NBITS = 78; diff --git a/esphome/components/remote_base/samsung_protocol.cpp b/esphome/components/remote_base/samsung_protocol.cpp index 7190e97403..7fce46313b 100644 --- a/esphome/components/remote_base/samsung_protocol.cpp +++ b/esphome/components/remote_base/samsung_protocol.cpp @@ -4,7 +4,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.samsung"; +ESPHOME_LOG_TAG(TAG, "remote.samsung"); static constexpr uint32_t HEADER_HIGH_US = 4500; static constexpr uint32_t HEADER_LOW_US = 4500; diff --git a/esphome/components/remote_base/sony_protocol.cpp b/esphome/components/remote_base/sony_protocol.cpp index 0abb7fc0e0..00d5aee9c8 100644 --- a/esphome/components/remote_base/sony_protocol.cpp +++ b/esphome/components/remote_base/sony_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.sony"; +ESPHOME_LOG_TAG(TAG, "remote.sony"); static constexpr uint32_t HEADER_HIGH_US = 2400; static constexpr uint32_t HEADER_LOW_US = 600; diff --git a/esphome/components/remote_base/symphony_protocol.cpp b/esphome/components/remote_base/symphony_protocol.cpp index 8b39abf9ad..962cf12ff6 100644 --- a/esphome/components/remote_base/symphony_protocol.cpp +++ b/esphome/components/remote_base/symphony_protocol.cpp @@ -5,7 +5,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.symphony"; +ESPHOME_LOG_TAG(TAG, "remote.symphony"); // Reference implementation and timing details: // IRremoteESP8266 ir_Symphony.cpp diff --git a/esphome/components/remote_base/toshiba_ac_protocol.cpp b/esphome/components/remote_base/toshiba_ac_protocol.cpp index 077b4340fa..addcd6f9cb 100644 --- a/esphome/components/remote_base/toshiba_ac_protocol.cpp +++ b/esphome/components/remote_base/toshiba_ac_protocol.cpp @@ -4,7 +4,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.toshibaac"; +ESPHOME_LOG_TAG(TAG, "remote.toshibaac"); static constexpr uint32_t HEADER_HIGH_US = 4500; static constexpr uint32_t HEADER_LOW_US = 4500; diff --git a/esphome/components/remote_base/toto_protocol.cpp b/esphome/components/remote_base/toto_protocol.cpp index 042efcbc36..c94fce87be 100644 --- a/esphome/components/remote_base/toto_protocol.cpp +++ b/esphome/components/remote_base/toto_protocol.cpp @@ -3,7 +3,7 @@ namespace esphome::remote_base { -static const char *const TAG = "remote.toto"; +ESPHOME_LOG_TAG(TAG, "remote.toto"); static constexpr uint32_t PREAMBLE_HIGH_US = 6200; static constexpr uint32_t PREAMBLE_LOW_US = 2800; diff --git a/esphome/components/remote_receiver/remote_receiver.cpp b/esphome/components/remote_receiver/remote_receiver.cpp index b3e4649096..58c72a8bb8 100644 --- a/esphome/components/remote_receiver/remote_receiver.cpp +++ b/esphome/components/remote_receiver/remote_receiver.cpp @@ -7,7 +7,7 @@ namespace esphome::remote_receiver { -static const char *const TAG = "remote_receiver"; +ESPHOME_LOG_TAG(TAG, "remote_receiver"); static void IRAM_ATTR HOT write_value(RemoteReceiverComponentStore *arg, uint32_t delta, bool level) { // convert level to -1 or +1 and write the delta to the buffer diff --git a/esphome/components/remote_receiver/remote_receiver_rmt.cpp b/esphome/components/remote_receiver/remote_receiver_rmt.cpp index 64392aa7ee..2b76ab8989 100644 --- a/esphome/components/remote_receiver/remote_receiver_rmt.cpp +++ b/esphome/components/remote_receiver/remote_receiver_rmt.cpp @@ -10,7 +10,7 @@ namespace esphome::remote_receiver { -static const char *const TAG = "remote_receiver"; +ESPHOME_LOG_TAG(TAG, "remote_receiver"); static constexpr uint32_t DEFAULT_BUFFER_SLOTS = 4; static bool IRAM_ATTR HOT rmt_callback(rmt_channel_handle_t channel, const rmt_rx_done_event_data_t *event, void *arg) { diff --git a/esphome/components/remote_transmitter/remote_transmitter.cpp b/esphome/components/remote_transmitter/remote_transmitter.cpp index 29ef9bc2cc..34eb67b3c5 100644 --- a/esphome/components/remote_transmitter/remote_transmitter.cpp +++ b/esphome/components/remote_transmitter/remote_transmitter.cpp @@ -7,7 +7,7 @@ namespace esphome::remote_transmitter { -static const char *const TAG = "remote_transmitter"; +ESPHOME_LOG_TAG(TAG, "remote_transmitter"); void RemoteTransmitterComponent::setup() { this->pin_->setup(); diff --git a/esphome/components/remote_transmitter/remote_transmitter_bk72xx.cpp b/esphome/components/remote_transmitter/remote_transmitter_bk72xx.cpp index 822389ccf9..dced3720b4 100644 --- a/esphome/components/remote_transmitter/remote_transmitter_bk72xx.cpp +++ b/esphome/components/remote_transmitter/remote_transmitter_bk72xx.cpp @@ -19,7 +19,7 @@ namespace esphome::remote_transmitter { -static const char *const TAG = "remote_transmitter"; +ESPHOME_LOG_TAG(TAG, "remote_transmitter"); #ifdef REMOTE_TRANSMITTER_BK_PWM diff --git a/esphome/components/remote_transmitter/remote_transmitter_libretiny_isr.cpp b/esphome/components/remote_transmitter/remote_transmitter_libretiny_isr.cpp index 26e9a1baa3..55f18277ce 100644 --- a/esphome/components/remote_transmitter/remote_transmitter_libretiny_isr.cpp +++ b/esphome/components/remote_transmitter/remote_transmitter_libretiny_isr.cpp @@ -12,7 +12,7 @@ namespace esphome::remote_transmitter { -static const char *const TAG = "remote_transmitter"; +ESPHOME_LOG_TAG(TAG, "remote_transmitter"); // Margin past a transmission's expected duration before the chain is declared stalled static constexpr uint32_t STALL_MARGIN_MS = 1000; diff --git a/esphome/components/remote_transmitter/remote_transmitter_rmt.cpp b/esphome/components/remote_transmitter/remote_transmitter_rmt.cpp index 91bd339f21..f6550d107c 100644 --- a/esphome/components/remote_transmitter/remote_transmitter_rmt.cpp +++ b/esphome/components/remote_transmitter/remote_transmitter_rmt.cpp @@ -9,7 +9,7 @@ namespace esphome::remote_transmitter { -static const char *const TAG = "remote_transmitter"; +ESPHOME_LOG_TAG(TAG, "remote_transmitter"); // Maximum RMT symbol duration (15-bit field) static constexpr uint32_t RMT_SYMBOL_DURATION_MAX = 0x7FFF; diff --git a/esphome/components/remote_transmitter/remote_transmitter_rtl87xx.cpp b/esphome/components/remote_transmitter/remote_transmitter_rtl87xx.cpp index 799f46401c..62be203ee3 100644 --- a/esphome/components/remote_transmitter/remote_transmitter_rtl87xx.cpp +++ b/esphome/components/remote_transmitter/remote_transmitter_rtl87xx.cpp @@ -15,7 +15,7 @@ namespace esphome::remote_transmitter { -static const char *const TAG = "remote_transmitter"; +ESPHOME_LOG_TAG(TAG, "remote_transmitter"); // PWM peripheral carrier, envelope paced by a gtimer interrupt chain. Bit-banging would need // interrupts disabled for the whole frame, but this core's micros() derives from the FreeRTOS diff --git a/esphome/components/resampler/microphone/resampler_microphone.cpp b/esphome/components/resampler/microphone/resampler_microphone.cpp index 0dcd523380..a50f6adea8 100644 --- a/esphome/components/resampler/microphone/resampler_microphone.cpp +++ b/esphome/components/resampler/microphone/resampler_microphone.cpp @@ -9,7 +9,7 @@ namespace esphome::resampler { -static const char *const TAG = "resampler.microphone"; +ESPHOME_LOG_TAG(TAG, "resampler.microphone"); // Duration of audio the resampler converts per step; longer source chunks are processed in several steps static constexpr uint32_t BUFFER_DURATION_MS = 16; diff --git a/esphome/components/resampler/speaker/resampler_speaker.cpp b/esphome/components/resampler/speaker/resampler_speaker.cpp index 16d2d5dc9e..99b00ec094 100644 --- a/esphome/components/resampler/speaker/resampler_speaker.cpp +++ b/esphome/components/resampler/speaker/resampler_speaker.cpp @@ -22,7 +22,7 @@ static const uint32_t TASK_STACK_SIZE = 3072; static const uint32_t STATE_TRANSITION_TIMEOUT_MS = 5000; -static const char *const TAG = "resampler_speaker"; +ESPHOME_LOG_TAG(TAG, "resampler_speaker"); enum ResamplingEventGroupBits : uint32_t { COMMAND_STOP = (1 << 0), // signals stop request diff --git a/esphome/components/resistance/resistance_sensor.cpp b/esphome/components/resistance/resistance_sensor.cpp index 7522d026a4..d6bc324fa4 100644 --- a/esphome/components/resistance/resistance_sensor.cpp +++ b/esphome/components/resistance/resistance_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::resistance { -static const char *const TAG = "resistance"; +ESPHOME_LOG_TAG(TAG, "resistance"); void ResistanceSensor::dump_config() { LOG_SENSOR("", "Resistance Sensor", this); diff --git a/esphome/components/restart/button/restart_button.cpp b/esphome/components/restart/button/restart_button.cpp index d6404315ea..cffa47896c 100644 --- a/esphome/components/restart/button/restart_button.cpp +++ b/esphome/components/restart/button/restart_button.cpp @@ -5,7 +5,7 @@ namespace esphome::restart { -static const char *const TAG = "restart.button"; +ESPHOME_LOG_TAG(TAG, "restart.button"); void RestartButton::press_action() { ESP_LOGI(TAG, "Restarting device"); diff --git a/esphome/components/restart/switch/restart_switch.cpp b/esphome/components/restart/switch/restart_switch.cpp index 96a4fc40f5..50102366fc 100644 --- a/esphome/components/restart/switch/restart_switch.cpp +++ b/esphome/components/restart/switch/restart_switch.cpp @@ -5,7 +5,7 @@ namespace esphome::restart { -static const char *const TAG = "restart"; +ESPHOME_LOG_TAG(TAG, "restart"); void RestartSwitch::write_state(bool state) { // Acknowledge diff --git a/esphome/components/rf_bridge/rf_bridge.cpp b/esphome/components/rf_bridge/rf_bridge.cpp index a4a4da5d8c..86daaf4b08 100644 --- a/esphome/components/rf_bridge/rf_bridge.cpp +++ b/esphome/components/rf_bridge/rf_bridge.cpp @@ -7,7 +7,7 @@ namespace esphome::rf_bridge { -static const char *const TAG = "rf_bridge"; +ESPHOME_LOG_TAG(TAG, "rf_bridge"); void RFBridgeComponent::ack_() { ESP_LOGV(TAG, "Sending ACK"); diff --git a/esphome/components/ring_buffer/ring_buffer.cpp b/esphome/components/ring_buffer/ring_buffer.cpp index dfcc53ebb2..7197a07348 100644 --- a/esphome/components/ring_buffer/ring_buffer.cpp +++ b/esphome/components/ring_buffer/ring_buffer.cpp @@ -7,7 +7,7 @@ namespace esphome::ring_buffer { -static const char *const TAG = "ring_buffer"; +ESPHOME_LOG_TAG(TAG, "ring_buffer"); RingBuffer::~RingBuffer() { // create() only builds the ring buffer once storage_ is allocated diff --git a/esphome/components/rotary_encoder/rotary_encoder.cpp b/esphome/components/rotary_encoder/rotary_encoder.cpp index 0734ca87d3..4c43830888 100644 --- a/esphome/components/rotary_encoder/rotary_encoder.cpp +++ b/esphome/components/rotary_encoder/rotary_encoder.cpp @@ -4,7 +4,7 @@ namespace esphome::rotary_encoder { -static const char *const TAG = "rotary_encoder"; +ESPHOME_LOG_TAG(TAG, "rotary_encoder"); // based on https://github.com/jkDesignDE/MechInputs/blob/master/QEIx4.cpp static const uint8_t STATE_LUT_MASK = 0x1C; // clears upper counter increment/decrement bits and pin states diff --git a/esphome/components/router/speaker/router_speaker.cpp b/esphome/components/router/speaker/router_speaker.cpp index dd2428e4df..5fdc1ac716 100644 --- a/esphome/components/router/speaker/router_speaker.cpp +++ b/esphome/components/router/speaker/router_speaker.cpp @@ -12,7 +12,7 @@ namespace esphome::router { -static const char *const TAG = "router.speaker"; +ESPHOME_LOG_TAG(TAG, "router.speaker"); // Maximum time to wait for the active output to report running after start() before giving up static const uint32_t STATE_TRANSITION_TIMEOUT_MS = 5000; diff --git a/esphome/components/rp2/crash_handler.cpp b/esphome/components/rp2/crash_handler.cpp index 9bcdc8bee4..0741cc24e3 100644 --- a/esphome/components/rp2/crash_handler.cpp +++ b/esphome/components/rp2/crash_handler.cpp @@ -53,7 +53,7 @@ static constexpr size_t MAX_BACKTRACE = 4; namespace esphome::rp2 { -static const char *const TAG = "rp2.crash"; +ESPHOME_LOG_TAG(TAG, "rp2.crash"); // Filled from the watchdog scratch registers on the first read. static struct CrashData { diff --git a/esphome/components/rp2/gpio.cpp b/esphome/components/rp2/gpio.cpp index b95da9bcdb..93bdba1fca 100644 --- a/esphome/components/rp2/gpio.cpp +++ b/esphome/components/rp2/gpio.cpp @@ -6,7 +6,7 @@ namespace esphome { namespace rp2 { -static const char *const TAG = "rp2"; +ESPHOME_LOG_TAG(TAG, "rp2"); static int flags_to_mode(gpio::Flags flags, uint8_t pin) { flags = diff --git a/esphome/components/rp2/preferences.cpp b/esphome/components/rp2/preferences.cpp index d1e0bc555f..dfe19f4bf4 100644 --- a/esphome/components/rp2/preferences.cpp +++ b/esphome/components/rp2/preferences.cpp @@ -14,7 +14,7 @@ namespace esphome::rp2 { -static const char *const TAG = "preferences"; +ESPHOME_LOG_TAG(TAG, "preferences"); static constexpr uint32_t RP2040_FLASH_STORAGE_SIZE = 512; diff --git a/esphome/components/rp2040_ble/rp2040_ble.cpp b/esphome/components/rp2040_ble/rp2040_ble.cpp index 80e8bf9415..fca0c45d6f 100644 --- a/esphome/components/rp2040_ble/rp2040_ble.cpp +++ b/esphome/components/rp2040_ble/rp2040_ble.cpp @@ -11,7 +11,7 @@ namespace esphome::rp2040_ble { -static const char *const TAG = "rp2040_ble"; +ESPHOME_LOG_TAG(TAG, "rp2040_ble"); // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) RP2040BLE *global_ble = nullptr; diff --git a/esphome/components/rp2040_pio_led_strip/led_strip.cpp b/esphome/components/rp2040_pio_led_strip/led_strip.cpp index 1f4bea9ecd..8ea9880c7c 100644 --- a/esphome/components/rp2040_pio_led_strip/led_strip.cpp +++ b/esphome/components/rp2040_pio_led_strip/led_strip.cpp @@ -14,7 +14,7 @@ namespace esphome::rp2040_pio_led_strip { -static const char *const TAG = "rp2040_pio_led_strip"; +ESPHOME_LOG_TAG(TAG, "rp2040_pio_led_strip"); // DMA interrupt service routine void RP2040PIOLEDStripLightOutput::dma_write_complete_handler() { diff --git a/esphome/components/rp2040_pwm/rp2040_pwm.cpp b/esphome/components/rp2040_pwm/rp2040_pwm.cpp index 270cc33551..8324da3dcf 100644 --- a/esphome/components/rp2040_pwm/rp2040_pwm.cpp +++ b/esphome/components/rp2040_pwm/rp2040_pwm.cpp @@ -13,7 +13,7 @@ namespace esphome::rp2040_pwm { -static const char *const TAG = "rp2040_pwm"; +ESPHOME_LOG_TAG(TAG, "rp2040_pwm"); void RP2040PWM::setup() { this->setup_pwm_(); } diff --git a/esphome/components/rp2_ble_tracker/rp2_ble_tracker.cpp b/esphome/components/rp2_ble_tracker/rp2_ble_tracker.cpp index a0a04b981d..192e19455e 100644 --- a/esphome/components/rp2_ble_tracker/rp2_ble_tracker.cpp +++ b/esphome/components/rp2_ble_tracker/rp2_ble_tracker.cpp @@ -9,7 +9,7 @@ namespace esphome::rp2_ble_tracker { -static const char *const TAG = "rp2_ble_tracker"; +ESPHOME_LOG_TAG(TAG, "rp2_ble_tracker"); // Floor between controller start attempts; insurance against a failing // scan_start() being retried every loop. diff --git a/esphome/components/rtttl/rtttl.cpp b/esphome/components/rtttl/rtttl.cpp index a5f8567c9d..fb2bf63a64 100644 --- a/esphome/components/rtttl/rtttl.cpp +++ b/esphome/components/rtttl/rtttl.cpp @@ -6,7 +6,7 @@ namespace esphome::rtttl { -static const char *const TAG = "rtttl"; +ESPHOME_LOG_TAG(TAG, "rtttl"); static constexpr uint8_t SONG_NAME_LENGTH_LIMIT = 64; static constexpr uint8_t SEMITONES_IN_OCTAVE = 12; diff --git a/esphome/components/runtime_image/bmp_decoder.cpp b/esphome/components/runtime_image/bmp_decoder.cpp index 204d6cc14b..9260860f40 100644 --- a/esphome/components/runtime_image/bmp_decoder.cpp +++ b/esphome/components/runtime_image/bmp_decoder.cpp @@ -10,7 +10,7 @@ namespace esphome::runtime_image { -static const char *const TAG = "image_decoder.bmp"; +ESPHOME_LOG_TAG(TAG, "image_decoder.bmp"); void BmpDecoder::reset() { ImageDecoder::reset(); diff --git a/esphome/components/runtime_image/image_decoder.cpp b/esphome/components/runtime_image/image_decoder.cpp index f2c4f5c8cd..7056ce35aa 100644 --- a/esphome/components/runtime_image/image_decoder.cpp +++ b/esphome/components/runtime_image/image_decoder.cpp @@ -6,7 +6,7 @@ namespace esphome::runtime_image { -static const char *const TAG = "image_decoder"; +ESPHOME_LOG_TAG(TAG, "image_decoder"); bool ImageDecoder::set_size(int width, int height) { bool success = this->image_->resize(width, height) > 0; diff --git a/esphome/components/runtime_image/jpeg_decoder.cpp b/esphome/components/runtime_image/jpeg_decoder.cpp index 85ec945259..74ced63a4e 100644 --- a/esphome/components/runtime_image/jpeg_decoder.cpp +++ b/esphome/components/runtime_image/jpeg_decoder.cpp @@ -11,7 +11,7 @@ #include "esp_task_wdt.h" #endif -static const char *const TAG = "image_decoder.jpeg"; +ESPHOME_LOG_TAG(TAG, "image_decoder.jpeg"); namespace esphome::runtime_image { diff --git a/esphome/components/runtime_image/png_decoder.cpp b/esphome/components/runtime_image/png_decoder.cpp index 106f25bbe1..ae76347118 100644 --- a/esphome/components/runtime_image/png_decoder.cpp +++ b/esphome/components/runtime_image/png_decoder.cpp @@ -6,7 +6,7 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" -static const char *const TAG = "image_decoder.png"; +ESPHOME_LOG_TAG(TAG, "image_decoder.png"); namespace esphome::runtime_image { diff --git a/esphome/components/runtime_image/qoi_decoder.cpp b/esphome/components/runtime_image/qoi_decoder.cpp index b0fabb5233..dacaace3fd 100644 --- a/esphome/components/runtime_image/qoi_decoder.cpp +++ b/esphome/components/runtime_image/qoi_decoder.cpp @@ -10,7 +10,7 @@ namespace esphome::runtime_image { -static const char *const TAG = "image_decoder.qoi"; +ESPHOME_LOG_TAG(TAG, "image_decoder.qoi"); constexpr uint8_t QOI_OP_RGB = 0b11111110; constexpr uint8_t QOI_OP_RGBA = 0b11111111; diff --git a/esphome/components/runtime_image/runtime_image.cpp b/esphome/components/runtime_image/runtime_image.cpp index 5c14d39807..6c10194574 100644 --- a/esphome/components/runtime_image/runtime_image.cpp +++ b/esphome/components/runtime_image/runtime_image.cpp @@ -21,7 +21,7 @@ namespace esphome::runtime_image { -static const char *const TAG = "runtime_image"; +ESPHOME_LOG_TAG(TAG, "runtime_image"); // Widest supported format is 4 bytes/pixel, so 32767 * 32767 * 4 still fits a 32-bit size_t static constexpr int MAX_IMAGE_DIMENSION = 32767; diff --git a/esphome/components/ruuvi_ble/ruuvi_ble.cpp b/esphome/components/ruuvi_ble/ruuvi_ble.cpp index 19753b3c9e..c781e282fe 100644 --- a/esphome/components/ruuvi_ble/ruuvi_ble.cpp +++ b/esphome/components/ruuvi_ble/ruuvi_ble.cpp @@ -3,7 +3,7 @@ namespace esphome::ruuvi_ble { -static const char *const TAG = "ruuvi_ble"; +ESPHOME_LOG_TAG(TAG, "ruuvi_ble"); bool parse_ruuvi_data_byte(const ble_device_base::adv_data_t &adv_data, RuuviParseResult &result) { const uint8_t data_type = adv_data[0]; diff --git a/esphome/components/ruuvitag/ruuvitag.cpp b/esphome/components/ruuvitag/ruuvitag.cpp index 1536befb1b..3dc4a3a223 100644 --- a/esphome/components/ruuvitag/ruuvitag.cpp +++ b/esphome/components/ruuvitag/ruuvitag.cpp @@ -3,7 +3,7 @@ namespace esphome::ruuvitag { -static const char *const TAG = "ruuvitag"; +ESPHOME_LOG_TAG(TAG, "ruuvitag"); void RuuviTag::dump_config() { ESP_LOGCONFIG(TAG, "RuuviTag"); diff --git a/esphome/components/rx8025t/rx8025t.cpp b/esphome/components/rx8025t/rx8025t.cpp index fee2c83a5f..502f6f265d 100644 --- a/esphome/components/rx8025t/rx8025t.cpp +++ b/esphome/components/rx8025t/rx8025t.cpp @@ -11,7 +11,7 @@ static constexpr uint8_t RX8025T_REG_FLAG = 0x0E; static constexpr uint8_t RX8025T_FLAG_VDET = 0x01; static constexpr uint8_t RX8025T_FLAG_VLF = 0x02; -static const char *const TAG = "rx8025t"; +ESPHOME_LOG_TAG(TAG, "rx8025t"); constexpr uint8_t bcd2dec(uint8_t val) { return (val >> 4) * 10 + (val & 0x0f); } constexpr uint8_t dec2bcd(uint8_t val) { return ((val / 10) << 4) + (val % 10); } diff --git a/esphome/components/rx8130/rx8130.cpp b/esphome/components/rx8130/rx8130.cpp index 1b5b71f0e0..63153c5db3 100644 --- a/esphome/components/rx8130/rx8130.cpp +++ b/esphome/components/rx8130/rx8130.cpp @@ -21,7 +21,7 @@ static const uint8_t RX8130_BIT_CTRL_STOP = 0x40; static const uint8_t RX8130_BAT_FLAGS = 0x30; static const uint8_t RX8130_CLEAR_FLAGS = 0x00; -static const char *const TAG = "rx8130"; +ESPHOME_LOG_TAG(TAG, "rx8130"); constexpr uint8_t bcd2dec(uint8_t val) { return (val >> 4) * 10 + (val & 0x0f); } constexpr uint8_t dec2bcd(uint8_t val) { return ((val / 10) << 4) + (val % 10); } diff --git a/esphome/components/safe_mode/button/safe_mode_button.cpp b/esphome/components/safe_mode/button/safe_mode_button.cpp index 982ecf8402..e9779953f0 100644 --- a/esphome/components/safe_mode/button/safe_mode_button.cpp +++ b/esphome/components/safe_mode/button/safe_mode_button.cpp @@ -5,7 +5,7 @@ namespace esphome::safe_mode { -static const char *const TAG = "safe_mode.button"; +ESPHOME_LOG_TAG(TAG, "safe_mode.button"); void SafeModeButton::press_action() { ESP_LOGI(TAG, "Restarting in safe mode"); diff --git a/esphome/components/safe_mode/safe_mode.cpp b/esphome/components/safe_mode/safe_mode.cpp index 8fd5911ab5..3099df5860 100644 --- a/esphome/components/safe_mode/safe_mode.cpp +++ b/esphome/components/safe_mode/safe_mode.cpp @@ -21,7 +21,7 @@ namespace esphome::safe_mode { -static const char *const TAG = "safe_mode"; +ESPHOME_LOG_TAG(TAG, "safe_mode"); #if defined(USE_ESP32) && defined(USE_OTA_ROLLBACK) && !defined(USE_OTA_PARTITIONS) // Find a non-running app partition. If verify is true, only returns a partition diff --git a/esphome/components/safe_mode/switch/safe_mode_switch.cpp b/esphome/components/safe_mode/switch/safe_mode_switch.cpp index b4b9735757..c60c59dbfc 100644 --- a/esphome/components/safe_mode/switch/safe_mode_switch.cpp +++ b/esphome/components/safe_mode/switch/safe_mode_switch.cpp @@ -5,7 +5,7 @@ namespace esphome::safe_mode { -static const char *const TAG = "safe_mode.switch"; +ESPHOME_LOG_TAG(TAG, "safe_mode.switch"); void SafeModeSwitch::write_state(bool state) { // Acknowledge diff --git a/esphome/components/scd30/scd30.cpp b/esphome/components/scd30/scd30.cpp index a780297756..3e8794e65c 100644 --- a/esphome/components/scd30/scd30.cpp +++ b/esphome/components/scd30/scd30.cpp @@ -8,7 +8,7 @@ namespace esphome::scd30 { -static const char *const TAG = "scd30"; +ESPHOME_LOG_TAG(TAG, "scd30"); static const uint16_t SCD30_CMD_GET_FIRMWARE_VERSION = 0xd100; static const uint16_t SCD30_CMD_START_CONTINUOUS_MEASUREMENTS = 0x0010; diff --git a/esphome/components/scd4x/scd4x.cpp b/esphome/components/scd4x/scd4x.cpp index d9a2439bb9..8249a6feb1 100644 --- a/esphome/components/scd4x/scd4x.cpp +++ b/esphome/components/scd4x/scd4x.cpp @@ -4,7 +4,7 @@ namespace esphome::scd4x { -static const char *const TAG = "scd4x"; +ESPHOME_LOG_TAG(TAG, "scd4x"); static const uint16_t SCD41_ID = 0x1408; static const uint16_t SCD40_ID = 0x440; diff --git a/esphome/components/script/script.cpp b/esphome/components/script/script.cpp index bfe96e1b23..7174a9a0b4 100644 --- a/esphome/components/script/script.cpp +++ b/esphome/components/script/script.cpp @@ -3,7 +3,7 @@ namespace esphome::script { -static const char *const TAG = "script"; +ESPHOME_LOG_TAG(TAG, "script"); void ScriptLogger::esp_log_(int level, int line, ProgmemStr format, const char *param) { esp_log_printf_(level, TAG, line, format, param); diff --git a/esphome/components/sdm_meter/sdm_meter.cpp b/esphome/components/sdm_meter/sdm_meter.cpp index c1b359cc97..5389325cc2 100644 --- a/esphome/components/sdm_meter/sdm_meter.cpp +++ b/esphome/components/sdm_meter/sdm_meter.cpp @@ -6,7 +6,7 @@ namespace esphome::sdm_meter { namespace helpers = modbus::helpers; -static const char *const TAG = "sdm_meter"; +ESPHOME_LOG_TAG(TAG, "sdm_meter"); static const uint8_t MODBUS_REGISTER_COUNT = 80; // 80 x 16-bit registers (40 float values) diff --git a/esphome/components/sdp3x/sdp3x.cpp b/esphome/components/sdp3x/sdp3x.cpp index 7fcd47a265..98b5d9940a 100644 --- a/esphome/components/sdp3x/sdp3x.cpp +++ b/esphome/components/sdp3x/sdp3x.cpp @@ -5,7 +5,7 @@ namespace esphome::sdp3x { -static const char *const TAG = "sdp3x.sensor"; +ESPHOME_LOG_TAG(TAG, "sdp3x.sensor"); static const uint16_t SDP3X_SOFT_RESET = 0x0006; static const uint16_t SDP3X_READ_ID1 = 0x367C; static const uint16_t SDP3X_READ_ID2 = 0xE102; diff --git a/esphome/components/sds011/sds011.cpp b/esphome/components/sds011/sds011.cpp index dfc7857266..3d46f0613e 100644 --- a/esphome/components/sds011/sds011.cpp +++ b/esphome/components/sds011/sds011.cpp @@ -4,7 +4,7 @@ namespace esphome::sds011 { -static const char *const TAG = "sds011"; +ESPHOME_LOG_TAG(TAG, "sds011"); static const uint8_t SDS011_MSG_REQUEST_LENGTH = 19; static const uint8_t SDS011_MSG_RESPONSE_LENGTH = 10; diff --git a/esphome/components/seeed_mr24hpc1/seeed_mr24hpc1.cpp b/esphome/components/seeed_mr24hpc1/seeed_mr24hpc1.cpp index a0dc7ae4cb..31c8e89af3 100644 --- a/esphome/components/seeed_mr24hpc1/seeed_mr24hpc1.cpp +++ b/esphome/components/seeed_mr24hpc1/seeed_mr24hpc1.cpp @@ -7,7 +7,7 @@ namespace esphome::seeed_mr24hpc1 { -static const char *const TAG = "seeed_mr24hpc1"; +ESPHOME_LOG_TAG(TAG, "seeed_mr24hpc1"); // Prints the component's configuration data. dump_config() prints all of the component's configuration // items in an easy-to-read format, including the configuration key-value pairs. diff --git a/esphome/components/seeed_mr60bha2/seeed_mr60bha2.cpp b/esphome/components/seeed_mr60bha2/seeed_mr60bha2.cpp index cbf0415f6c..c5d1292458 100644 --- a/esphome/components/seeed_mr60bha2/seeed_mr60bha2.cpp +++ b/esphome/components/seeed_mr60bha2/seeed_mr60bha2.cpp @@ -7,7 +7,7 @@ namespace esphome::seeed_mr60bha2 { -static const char *const TAG = "seeed_mr60bha2"; +ESPHOME_LOG_TAG(TAG, "seeed_mr60bha2"); // Maximum bytes to log in verbose hex output static constexpr size_t MR60BHA2_MAX_LOG_BYTES = 64; diff --git a/esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp b/esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp index 2d1cd0fbb4..332c59061b 100644 --- a/esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp +++ b/esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp @@ -7,7 +7,7 @@ namespace esphome::seeed_mr60fda2 { -static const char *const TAG = "seeed_mr60fda2"; +ESPHOME_LOG_TAG(TAG, "seeed_mr60fda2"); // Maximum bytes to log in verbose hex output static constexpr size_t MR60FDA2_MAX_LOG_BYTES = 64; diff --git a/esphome/components/selec_meter/selec_meter.cpp b/esphome/components/selec_meter/selec_meter.cpp index 3ad1f8b87c..a11cc6a008 100644 --- a/esphome/components/selec_meter/selec_meter.cpp +++ b/esphome/components/selec_meter/selec_meter.cpp @@ -6,7 +6,7 @@ namespace esphome::selec_meter { namespace helpers = modbus::helpers; -static const char *const TAG = "selec_meter"; +ESPHOME_LOG_TAG(TAG, "selec_meter"); static const uint8_t MODBUS_REGISTER_COUNT = 34; // 34 x 16-bit registers diff --git a/esphome/components/select/select.cpp b/esphome/components/select/select.cpp index 05a0ee1ed9..4d77c6d6f6 100644 --- a/esphome/components/select/select.cpp +++ b/esphome/components/select/select.cpp @@ -6,7 +6,7 @@ namespace esphome::select { -static const char *const TAG = "select"; +ESPHOME_LOG_TAG(TAG, "select"); void Select::publish_state(const char *state) { auto index = this->index_of(state); diff --git a/esphome/components/select/select_call.cpp b/esphome/components/select/select_call.cpp index 9d2fb725f3..167e6769a4 100644 --- a/esphome/components/select/select_call.cpp +++ b/esphome/components/select/select_call.cpp @@ -4,7 +4,7 @@ namespace esphome::select { -static const char *const TAG = "select"; +ESPHOME_LOG_TAG(TAG, "select"); SelectCall &SelectCall::set_option(const char *option, size_t len) { return this->with_option(option, len); } diff --git a/esphome/components/sen0321/sen0321.cpp b/esphome/components/sen0321/sen0321.cpp index e074934d0f..564e05e039 100644 --- a/esphome/components/sen0321/sen0321.cpp +++ b/esphome/components/sen0321/sen0321.cpp @@ -4,7 +4,7 @@ namespace esphome::sen0321_sensor { -static const char *const TAG = "sen0321_sensor.sensor"; +ESPHOME_LOG_TAG(TAG, "sen0321_sensor.sensor"); void Sen0321Sensor::setup() { if (!this->write_byte(SENSOR_MODE_REGISTER, SENSOR_MODE_AUTO)) { diff --git a/esphome/components/sen21231/sen21231.cpp b/esphome/components/sen21231/sen21231.cpp index 3f6212e7f2..29175d845c 100644 --- a/esphome/components/sen21231/sen21231.cpp +++ b/esphome/components/sen21231/sen21231.cpp @@ -3,7 +3,7 @@ namespace esphome::sen21231_sensor { -static const char *const TAG = "sen21231_sensor.sensor"; +ESPHOME_LOG_TAG(TAG, "sen21231_sensor.sensor"); void Sen21231Sensor::update() { this->read_data_(); } diff --git a/esphome/components/sen5x/sen5x.cpp b/esphome/components/sen5x/sen5x.cpp index f8df89ee33..f192a40288 100644 --- a/esphome/components/sen5x/sen5x.cpp +++ b/esphome/components/sen5x/sen5x.cpp @@ -7,7 +7,7 @@ namespace esphome::sen5x { -static const char *const TAG = "sen5x"; +ESPHOME_LOG_TAG(TAG, "sen5x"); static const uint16_t SEN5X_CMD_AUTO_CLEANING_INTERVAL = 0x8004; static const uint16_t SEN5X_CMD_GET_DATA_READY_STATUS = 0x0202; diff --git a/esphome/components/sen6x/sen6x.cpp b/esphome/components/sen6x/sen6x.cpp index ed6cb24c52..91762e0f07 100644 --- a/esphome/components/sen6x/sen6x.cpp +++ b/esphome/components/sen6x/sen6x.cpp @@ -5,7 +5,7 @@ namespace esphome::sen6x { -static const char *const TAG = "sen6x"; +ESPHOME_LOG_TAG(TAG, "sen6x"); static constexpr uint8_t POLL_RETRIES = 24; // 24 attempts static constexpr uint32_t I2C_READ_DELAY = 20; // 20 ms to wait for I2C read to complete diff --git a/esphome/components/sendspin/image/sendspin_image.cpp b/esphome/components/sendspin/image/sendspin_image.cpp index 8605048f33..4787abc760 100644 --- a/esphome/components/sendspin/image/sendspin_image.cpp +++ b/esphome/components/sendspin/image/sendspin_image.cpp @@ -8,7 +8,7 @@ namespace esphome::sendspin_ { -static const char *const TAG = "sendspin.image"; +ESPHOME_LOG_TAG(TAG, "sendspin.image"); // How long a displayed frame may wait for sendspin.image.transition_finished before a warning // names the missing ack. Generous next to a typical fade of a second or two. diff --git a/esphome/components/sendspin/media_player/sendspin_media_player.cpp b/esphome/components/sendspin/media_player/sendspin_media_player.cpp index ec5d5b2cbc..8c82022f1e 100644 --- a/esphome/components/sendspin/media_player/sendspin_media_player.cpp +++ b/esphome/components/sendspin/media_player/sendspin_media_player.cpp @@ -16,7 +16,7 @@ namespace esphome::sendspin_ { -static const char *const TAG = "sendspin.media_player"; +ESPHOME_LOG_TAG(TAG, "sendspin.media_player"); // THREAD CONTEXT: Main loop. The callbacks registered here also fire on the main loop, // since SendspinHub dispatches group updates and controller state from client_->loop(). diff --git a/esphome/components/sendspin/media_source/sendspin_media_source.cpp b/esphome/components/sendspin/media_source/sendspin_media_source.cpp index f1706a260b..5e5cf18799 100644 --- a/esphome/components/sendspin/media_source/sendspin_media_source.cpp +++ b/esphome/components/sendspin/media_source/sendspin_media_source.cpp @@ -9,7 +9,7 @@ namespace esphome::sendspin_ { -static const char *const TAG = "sendspin.media_source"; +ESPHOME_LOG_TAG(TAG, "sendspin.media_source"); static constexpr char URI_PREFIX[] = "sendspin://"; diff --git a/esphome/components/sendspin/sendspin_hub.cpp b/esphome/components/sendspin/sendspin_hub.cpp index 927e0e49ad..12617e0081 100644 --- a/esphome/components/sendspin/sendspin_hub.cpp +++ b/esphome/components/sendspin/sendspin_hub.cpp @@ -22,7 +22,7 @@ namespace esphome::sendspin_ { -static const char *const TAG = "sendspin.hub"; +ESPHOME_LOG_TAG(TAG, "sendspin.hub"); namespace { diff --git a/esphome/components/sendspin/sensor/sendspin_sensor.cpp b/esphome/components/sendspin/sensor/sendspin_sensor.cpp index 0562f32901..bacb7f66ad 100644 --- a/esphome/components/sendspin/sensor/sendspin_sensor.cpp +++ b/esphome/components/sendspin/sensor/sendspin_sensor.cpp @@ -8,7 +8,7 @@ namespace esphome::sendspin_ { -static const char *const TAG = "sendspin.sensor"; +ESPHOME_LOG_TAG(TAG, "sendspin.sensor"); // --- SendspinTrackProgressSensor --- diff --git a/esphome/components/sendspin/switch/sendspin_switch.cpp b/esphome/components/sendspin/switch/sendspin_switch.cpp index af4d053854..343202e7f4 100644 --- a/esphome/components/sendspin/switch/sendspin_switch.cpp +++ b/esphome/components/sendspin/switch/sendspin_switch.cpp @@ -6,7 +6,7 @@ namespace esphome::sendspin_ { -static const char *const TAG = "sendspin.switch"; +ESPHOME_LOG_TAG(TAG, "sendspin.switch"); void SendspinSwitch::setup() { // The hub waits for this request, so a restore mode without a state still has to answer. diff --git a/esphome/components/sendspin/text_sensor/sendspin_text_sensor.cpp b/esphome/components/sendspin/text_sensor/sendspin_text_sensor.cpp index 69dd32e785..cda987f2e3 100644 --- a/esphome/components/sendspin/text_sensor/sendspin_text_sensor.cpp +++ b/esphome/components/sendspin/text_sensor/sendspin_text_sensor.cpp @@ -8,7 +8,7 @@ namespace esphome::sendspin_ { -static const char *const TAG = "sendspin.text_sensor"; +ESPHOME_LOG_TAG(TAG, "sendspin.text_sensor"); void SendspinTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Sendspin", this); } diff --git a/esphome/components/senseair/senseair.cpp b/esphome/components/senseair/senseair.cpp index f5017cff75..858510f427 100644 --- a/esphome/components/senseair/senseair.cpp +++ b/esphome/components/senseair/senseair.cpp @@ -4,7 +4,7 @@ namespace esphome::senseair { -static const char *const TAG = "senseair"; +ESPHOME_LOG_TAG(TAG, "senseair"); static const uint8_t SENSEAIR_REQUEST_LENGTH = 8; static const uint8_t SENSEAIR_PPM_STATUS_RESPONSE_LENGTH = 13; static const uint8_t SENSEAIR_ABC_PERIOD_RESPONSE_LENGTH = 7; diff --git a/esphome/components/sensirion_common/i2c_sensirion.cpp b/esphome/components/sensirion_common/i2c_sensirion.cpp index 3325c27772..19172e68d2 100644 --- a/esphome/components/sensirion_common/i2c_sensirion.cpp +++ b/esphome/components/sensirion_common/i2c_sensirion.cpp @@ -6,7 +6,7 @@ namespace esphome::sensirion_common { -static const char *const TAG = "sensirion_i2c"; +ESPHOME_LOG_TAG(TAG, "sensirion_i2c"); // To avoid memory allocations for small writes a stack buffer is used static const size_t BUFFER_STACK_SIZE = 16; diff --git a/esphome/components/sensor/filter.cpp b/esphome/components/sensor/filter.cpp index 9b9d7c033a..28f7e6100d 100644 --- a/esphome/components/sensor/filter.cpp +++ b/esphome/components/sensor/filter.cpp @@ -11,7 +11,7 @@ namespace esphome::sensor { -static const char *const TAG = "sensor.filter"; +ESPHOME_LOG_TAG(TAG, "sensor.filter"); // Filter void Filter::input(float value) { diff --git a/esphome/components/sensor/sensor.cpp b/esphome/components/sensor/sensor.cpp index bee5d7c6d3..df73e2c481 100644 --- a/esphome/components/sensor/sensor.cpp +++ b/esphome/components/sensor/sensor.cpp @@ -6,7 +6,7 @@ namespace esphome::sensor { -static const char *const TAG = "sensor"; +ESPHOME_LOG_TAG(TAG, "sensor"); // Function implementation of LOG_SENSOR macro to reduce code size void log_sensor(const char *tag, const char *prefix, const char *type, Sensor *obj) { diff --git a/esphome/components/serial_proxy/serial_proxy.cpp b/esphome/components/serial_proxy/serial_proxy.cpp index 16e0f0b984..d512362fa0 100644 --- a/esphome/components/serial_proxy/serial_proxy.cpp +++ b/esphome/components/serial_proxy/serial_proxy.cpp @@ -20,7 +20,7 @@ namespace esphome::serial_proxy { -static const char *const TAG = "serial_proxy"; +ESPHOME_LOG_TAG(TAG, "serial_proxy"); uint32_t SerialProxy::stall_loop_time = 0; uint32_t SerialProxy::stall_spent_ms = 0; diff --git a/esphome/components/servo/servo.cpp b/esphome/components/servo/servo.cpp index 8d5344cf44..a415fdb8f7 100644 --- a/esphome/components/servo/servo.cpp +++ b/esphome/components/servo/servo.cpp @@ -5,7 +5,7 @@ namespace esphome::servo { -static const char *const TAG = "servo"; +ESPHOME_LOG_TAG(TAG, "servo"); uint32_t global_servo_id = 1911044085ULL; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/components/sfa30/sfa30.cpp b/esphome/components/sfa30/sfa30.cpp index 960806e98b..efa3d8dc61 100644 --- a/esphome/components/sfa30/sfa30.cpp +++ b/esphome/components/sfa30/sfa30.cpp @@ -3,7 +3,7 @@ namespace esphome::sfa30 { -static const char *const TAG = "sfa30"; +ESPHOME_LOG_TAG(TAG, "sfa30"); static const uint16_t SFA30_CMD_GET_DEVICE_MARKING = 0xD060; static const uint16_t SFA30_CMD_START_CONTINUOUS_MEASUREMENTS = 0x0006; diff --git a/esphome/components/sfa40/sfa40.cpp b/esphome/components/sfa40/sfa40.cpp index 0d6bee3f9a..31a25a4f38 100644 --- a/esphome/components/sfa40/sfa40.cpp +++ b/esphome/components/sfa40/sfa40.cpp @@ -4,7 +4,7 @@ namespace esphome::sfa40 { -static const char *const TAG = "sfa40"; +ESPHOME_LOG_TAG(TAG, "sfa40"); // SFA40 Datasheet: https://sensirion.com/media/documents/5B06EDD9/69F84BD8/Sensirion_Datasheet_SFA40.pdf diff --git a/esphome/components/sgp30/sgp30.cpp b/esphome/components/sgp30/sgp30.cpp index fd007c92cc..72827ad51b 100644 --- a/esphome/components/sgp30/sgp30.cpp +++ b/esphome/components/sgp30/sgp30.cpp @@ -8,7 +8,7 @@ namespace esphome::sgp30 { -static const char *const TAG = "sgp30"; +ESPHOME_LOG_TAG(TAG, "sgp30"); static const uint16_t SGP30_CMD_GET_SERIAL_ID = 0x3682; static const uint16_t SGP30_CMD_GET_FEATURESET = 0x202f; diff --git a/esphome/components/sgp4x/sgp4x.cpp b/esphome/components/sgp4x/sgp4x.cpp index 0cf5c31483..854dddba05 100644 --- a/esphome/components/sgp4x/sgp4x.cpp +++ b/esphome/components/sgp4x/sgp4x.cpp @@ -7,7 +7,7 @@ namespace esphome::sgp4x { -static const char *const TAG = "sgp4x"; +ESPHOME_LOG_TAG(TAG, "sgp4x"); void SGP4xComponent::setup() { // Serial Number identification diff --git a/esphome/components/shelly_dimmer/shelly_dimmer.cpp b/esphome/components/shelly_dimmer/shelly_dimmer.cpp index b69e417591..eedf7ff7ce 100644 --- a/esphome/components/shelly_dimmer/shelly_dimmer.cpp +++ b/esphome/components/shelly_dimmer/shelly_dimmer.cpp @@ -19,7 +19,7 @@ namespace { -constexpr char TAG[] = "shelly_dimmer"; +ESPHOME_LOG_TAG(TAG, "shelly_dimmer"); constexpr uint8_t SHELLY_DIMMER_ACK_TIMEOUT = 200; // ms constexpr uint8_t SHELLY_DIMMER_MAX_RETRIES = 3; diff --git a/esphome/components/shelly_dimmer/stm32flash.cpp b/esphome/components/shelly_dimmer/stm32flash.cpp index beb015851e..c33876e494 100644 --- a/esphome/components/shelly_dimmer/stm32flash.cpp +++ b/esphome/components/shelly_dimmer/stm32flash.cpp @@ -108,7 +108,7 @@ constexpr uint8_t STM_OBL_LAUNCH_CODE[] = { constexpr uint32_t STM_OBL_LAUNCH_CODE_SIZE = sizeof(STM_OBL_LAUNCH_CODE); -constexpr char TAG[] = "stm32flash"; +ESPHOME_LOG_TAG(TAG, "stm32flash"); } // Anonymous namespace diff --git a/esphome/components/sht3xd/sht3xd.cpp b/esphome/components/sht3xd/sht3xd.cpp index eba6be65d5..672d119aed 100644 --- a/esphome/components/sht3xd/sht3xd.cpp +++ b/esphome/components/sht3xd/sht3xd.cpp @@ -3,7 +3,7 @@ namespace esphome::sht3xd { -static const char *const TAG = "sht3xd"; +ESPHOME_LOG_TAG(TAG, "sht3xd"); // https://sensirion.com/media/documents/E5762713/63D103C2/Sensirion_electronic_identification_code_SHT3x.pdf // indicates two possible read serial number registers either with clock stretching enabled or disabled. diff --git a/esphome/components/sht4x/sht4x.cpp b/esphome/components/sht4x/sht4x.cpp index 4a3df5a91f..45de59fe0d 100644 --- a/esphome/components/sht4x/sht4x.cpp +++ b/esphome/components/sht4x/sht4x.cpp @@ -4,7 +4,7 @@ namespace esphome::sht4x { -static const char *const TAG = "sht4x"; +ESPHOME_LOG_TAG(TAG, "sht4x"); static const uint8_t MEASURECOMMANDS[] = {0xFD, 0xF6, 0xE0}; static const uint8_t SERIAL_NUMBER_COMMAND = 0x89; diff --git a/esphome/components/shtcx/shtcx.cpp b/esphome/components/shtcx/shtcx.cpp index 9ec0a2cdb7..68f2c4ea21 100644 --- a/esphome/components/shtcx/shtcx.cpp +++ b/esphome/components/shtcx/shtcx.cpp @@ -4,7 +4,7 @@ namespace esphome::shtcx { -static const char *const TAG = "shtcx"; +ESPHOME_LOG_TAG(TAG, "shtcx"); static constexpr uint16_t SHTCX_COMMAND_SLEEP = 0xB098; static constexpr uint16_t SHTCX_COMMAND_WAKEUP = 0x3517; diff --git a/esphome/components/shutdown/button/shutdown_button.cpp b/esphome/components/shutdown/button/shutdown_button.cpp index 6394c6c14e..7a1380469b 100644 --- a/esphome/components/shutdown/button/shutdown_button.cpp +++ b/esphome/components/shutdown/button/shutdown_button.cpp @@ -12,7 +12,7 @@ namespace esphome::shutdown { -static const char *const TAG = "shutdown.button"; +ESPHOME_LOG_TAG(TAG, "shutdown.button"); void ShutdownButton::dump_config() { LOG_BUTTON("", "Shutdown Button", this); } void ShutdownButton::press_action() { diff --git a/esphome/components/shutdown/switch/shutdown_switch.cpp b/esphome/components/shutdown/switch/shutdown_switch.cpp index a44a572aa1..6e0a70ff82 100644 --- a/esphome/components/shutdown/switch/shutdown_switch.cpp +++ b/esphome/components/shutdown/switch/shutdown_switch.cpp @@ -12,7 +12,7 @@ namespace esphome::shutdown { -static const char *const TAG = "shutdown.switch"; +ESPHOME_LOG_TAG(TAG, "shutdown.switch"); void ShutdownSwitch::dump_config() { LOG_SWITCH("", "Shutdown Switch", this); } void ShutdownSwitch::write_state(bool state) { diff --git a/esphome/components/sigma_delta_output/sigma_delta_output.cpp b/esphome/components/sigma_delta_output/sigma_delta_output.cpp index 6cc131c68f..37412c5d9b 100644 --- a/esphome/components/sigma_delta_output/sigma_delta_output.cpp +++ b/esphome/components/sigma_delta_output/sigma_delta_output.cpp @@ -3,7 +3,7 @@ namespace esphome::sigma_delta_output { -static const char *const TAG = "output.sigma_delta"; +ESPHOME_LOG_TAG(TAG, "output.sigma_delta"); void SigmaDeltaOutput::setup() { if (this->pin_) diff --git a/esphome/components/sim800l/sim800l.cpp b/esphome/components/sim800l/sim800l.cpp index 13b9888e05..e75e5e95dd 100644 --- a/esphome/components/sim800l/sim800l.cpp +++ b/esphome/components/sim800l/sim800l.cpp @@ -5,7 +5,7 @@ namespace esphome::sim800l { -static const char *const TAG = "sim800l"; +ESPHOME_LOG_TAG(TAG, "sim800l"); const char ASCII_CR = 0x0D; const char ASCII_LF = 0x0A; diff --git a/esphome/components/slow_pwm/slow_pwm_output.cpp b/esphome/components/slow_pwm/slow_pwm_output.cpp index e695ab9540..f41455bc80 100644 --- a/esphome/components/slow_pwm/slow_pwm_output.cpp +++ b/esphome/components/slow_pwm/slow_pwm_output.cpp @@ -5,7 +5,7 @@ namespace esphome::slow_pwm { -static const char *const TAG = "output.slow_pwm"; +ESPHOME_LOG_TAG(TAG, "output.slow_pwm"); void SlowPWMOutput::setup() { if (this->pin_) diff --git a/esphome/components/sm10bit_base/sm10bit_base.cpp b/esphome/components/sm10bit_base/sm10bit_base.cpp index 45de3c457d..d01ec5dbdb 100644 --- a/esphome/components/sm10bit_base/sm10bit_base.cpp +++ b/esphome/components/sm10bit_base/sm10bit_base.cpp @@ -3,7 +3,7 @@ namespace esphome::sm10bit_base { -static const char *const TAG = "sm10bit_base"; +ESPHOME_LOG_TAG(TAG, "sm10bit_base"); static const uint8_t SM10BIT_ADDR_STANDBY = 0x0; static const uint8_t SM10BIT_ADDR_START_3CH = 0x8; diff --git a/esphome/components/sm16716/sm16716.cpp b/esphome/components/sm16716/sm16716.cpp index 59e9f1b712..647a40dc47 100644 --- a/esphome/components/sm16716/sm16716.cpp +++ b/esphome/components/sm16716/sm16716.cpp @@ -3,7 +3,7 @@ namespace esphome::sm16716 { -static const char *const TAG = "sm16716"; +ESPHOME_LOG_TAG(TAG, "sm16716"); void SM16716::setup() { this->data_pin_->setup(); diff --git a/esphome/components/sm2135/sm2135.cpp b/esphome/components/sm2135/sm2135.cpp index 0086a63878..c8a4287b65 100644 --- a/esphome/components/sm2135/sm2135.cpp +++ b/esphome/components/sm2135/sm2135.cpp @@ -5,7 +5,7 @@ namespace esphome::sm2135 { -static const char *const TAG = "sm2135"; +ESPHOME_LOG_TAG(TAG, "sm2135"); static const uint8_t SM2135_ADDR_MC = 0xC0; // Max current register static const uint8_t SM2135_ADDR_CH = 0xC1; // RGB or CW channel select register diff --git a/esphome/components/sm2235/sm2235.cpp b/esphome/components/sm2235/sm2235.cpp index e981bd0f71..3bd302047b 100644 --- a/esphome/components/sm2235/sm2235.cpp +++ b/esphome/components/sm2235/sm2235.cpp @@ -3,7 +3,7 @@ namespace esphome::sm2235 { -static const char *const TAG = "sm2235"; +ESPHOME_LOG_TAG(TAG, "sm2235"); void SM2235::setup() { this->data_pin_->setup(); diff --git a/esphome/components/sm2335/sm2335.cpp b/esphome/components/sm2335/sm2335.cpp index 93f1096800..6e0d7b3588 100644 --- a/esphome/components/sm2335/sm2335.cpp +++ b/esphome/components/sm2335/sm2335.cpp @@ -3,7 +3,7 @@ namespace esphome::sm2335 { -static const char *const TAG = "sm2335"; +ESPHOME_LOG_TAG(TAG, "sm2335"); void SM2335::setup() { this->data_pin_->setup(); diff --git a/esphome/components/sm300d2/sm300d2.cpp b/esphome/components/sm300d2/sm300d2.cpp index 882959a454..0660e0f20e 100644 --- a/esphome/components/sm300d2/sm300d2.cpp +++ b/esphome/components/sm300d2/sm300d2.cpp @@ -3,7 +3,7 @@ namespace esphome::sm300d2 { -static const char *const TAG = "sm300d2"; +ESPHOME_LOG_TAG(TAG, "sm300d2"); static const uint8_t SM300D2_RESPONSE_LENGTH = 17; void SM300D2Sensor::update() { diff --git a/esphome/components/sml/sensor/sml_sensor.cpp b/esphome/components/sml/sensor/sml_sensor.cpp index 047a13e88d..9861edcf8f 100644 --- a/esphome/components/sml/sensor/sml_sensor.cpp +++ b/esphome/components/sml/sensor/sml_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::sml { -static const char *const TAG = "sml_sensor"; +ESPHOME_LOG_TAG(TAG, "sml_sensor"); SmlSensor::SmlSensor(std::string server_id, std::string obis_code) : SmlListener(std::move(server_id), std::move(obis_code)) {} diff --git a/esphome/components/sml/sml.cpp b/esphome/components/sml/sml.cpp index bacfbcccef..a4bc4373d7 100644 --- a/esphome/components/sml/sml.cpp +++ b/esphome/components/sml/sml.cpp @@ -5,7 +5,7 @@ namespace esphome::sml { -static const char *const TAG = "sml"; +ESPHOME_LOG_TAG(TAG, "sml"); const char START_BYTES_DETECTED = 1; const char END_BYTES_DETECTED = 2; diff --git a/esphome/components/sml/text_sensor/sml_text_sensor.cpp b/esphome/components/sml/text_sensor/sml_text_sensor.cpp index d0965e3dca..9bd31923ec 100644 --- a/esphome/components/sml/text_sensor/sml_text_sensor.cpp +++ b/esphome/components/sml/text_sensor/sml_text_sensor.cpp @@ -6,7 +6,7 @@ namespace esphome::sml { -static const char *const TAG = "sml_text_sensor"; +ESPHOME_LOG_TAG(TAG, "sml_text_sensor"); SmlTextSensor::SmlTextSensor(std::string server_id, std::string obis_code, SmlType format) : SmlListener(std::move(server_id), std::move(obis_code)), format_(format) {} diff --git a/esphome/components/smt100/smt100.cpp b/esphome/components/smt100/smt100.cpp index 2889a9fb4d..7785bbca2d 100644 --- a/esphome/components/smt100/smt100.cpp +++ b/esphome/components/smt100/smt100.cpp @@ -3,7 +3,7 @@ namespace esphome::smt100 { -static const char *const TAG = "smt100"; +ESPHOME_LOG_TAG(TAG, "smt100"); void SMT100Component::update() { ESP_LOGV(TAG, "Sending measurement request"); diff --git a/esphome/components/sn74hc165/sn74hc165.cpp b/esphome/components/sn74hc165/sn74hc165.cpp index fde789e90c..318390e8e2 100644 --- a/esphome/components/sn74hc165/sn74hc165.cpp +++ b/esphome/components/sn74hc165/sn74hc165.cpp @@ -3,7 +3,7 @@ namespace esphome::sn74hc165 { -static const char *const TAG = "sn74hc165"; +ESPHOME_LOG_TAG(TAG, "sn74hc165"); void SN74HC165Component::setup() { // initialize pins diff --git a/esphome/components/sn74hc595/sn74hc595.cpp b/esphome/components/sn74hc595/sn74hc595.cpp index 710e51ad12..4691ffcf6d 100644 --- a/esphome/components/sn74hc595/sn74hc595.cpp +++ b/esphome/components/sn74hc595/sn74hc595.cpp @@ -4,7 +4,7 @@ namespace esphome::sn74hc595 { -static const char *const TAG = "sn74hc595"; +ESPHOME_LOG_TAG(TAG, "sn74hc595"); void SN74HC595Component::pre_setup_() { if (this->have_oe_pin_) { // disable output diff --git a/esphome/components/snapshot/display/snapshot_display.cpp b/esphome/components/snapshot/display/snapshot_display.cpp index 6297e3e18f..6618d9ae74 100644 --- a/esphome/components/snapshot/display/snapshot_display.cpp +++ b/esphome/components/snapshot/display/snapshot_display.cpp @@ -7,7 +7,7 @@ namespace esphome::snapshot { -static const char *const TAG = "snapshot.display"; +ESPHOME_LOG_TAG(TAG, "snapshot.display"); namespace { diff --git a/esphome/components/snapshot/snapshot.cpp b/esphome/components/snapshot/snapshot.cpp index 096ec48eb3..58406f17ff 100644 --- a/esphome/components/snapshot/snapshot.cpp +++ b/esphome/components/snapshot/snapshot.cpp @@ -22,7 +22,7 @@ namespace esphome::snapshot { namespace { -constexpr const char *const TAG = "snapshot"; +ESPHOME_LOG_TAG(TAG, "snapshot"); // Longest name we will build a path from. NAME_MAX is 255 and we may append a collision suffix. constexpr size_t MAX_NAME_LENGTH = 200; diff --git a/esphome/components/sntp/sntp_component.cpp b/esphome/components/sntp/sntp_component.cpp index f8d48b4098..de951483bb 100644 --- a/esphome/components/sntp/sntp_component.cpp +++ b/esphome/components/sntp/sntp_component.cpp @@ -11,7 +11,7 @@ namespace esphome::sntp { -static const char *const TAG = "sntp"; +ESPHOME_LOG_TAG(TAG, "sntp"); #if defined(USE_ESP32) SNTPComponent *SNTPComponent::instance = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/components/socket/ipv4_resolve.cpp b/esphome/components/socket/ipv4_resolve.cpp index d2316cd064..d5da8745b9 100644 --- a/esphome/components/socket/ipv4_resolve.cpp +++ b/esphome/components/socket/ipv4_resolve.cpp @@ -16,7 +16,7 @@ namespace esphome::socket { -static const char *const TAG = "socket"; +ESPHOME_LOG_TAG(TAG, "socket"); bool Ipv4Resolve::consume_failure() { #if defined(IPV4_RESOLVE_ATOMIC_STATE) diff --git a/esphome/components/socket/lwip_raw_tcp_impl.cpp b/esphome/components/socket/lwip_raw_tcp_impl.cpp index b411445b98..2b21291c30 100644 --- a/esphome/components/socket/lwip_raw_tcp_impl.cpp +++ b/esphome/components/socket/lwip_raw_tcp_impl.cpp @@ -43,7 +43,7 @@ namespace esphome::socket { // (Ethernet). On ESP8266, it's a no-op. #define LWIP_LOCK() esphome::LwIPLock lwip_lock_guard // NOLINT -static const char *const TAG = "socket"; +ESPHOME_LOG_TAG(TAG, "socket"); #ifdef USE_ESP8266 // optimistic_yield() rate limit in microseconds of CONT time; cheap when hot. diff --git a/esphome/components/sonoff_d1/sonoff_d1.cpp b/esphome/components/sonoff_d1/sonoff_d1.cpp index 3e5af2b51f..02282fef9c 100644 --- a/esphome/components/sonoff_d1/sonoff_d1.cpp +++ b/esphome/components/sonoff_d1/sonoff_d1.cpp @@ -46,7 +46,7 @@ namespace esphome::sonoff_d1 { -static const char *const TAG = "sonoff_d1"; +ESPHOME_LOG_TAG(TAG, "sonoff_d1"); // Protocol constants static constexpr size_t SONOFF_D1_ACK_SIZE = 7; diff --git a/esphome/components/sound_level/sound_level.cpp b/esphome/components/sound_level/sound_level.cpp index 99ab7932d6..c5eee3665c 100644 --- a/esphome/components/sound_level/sound_level.cpp +++ b/esphome/components/sound_level/sound_level.cpp @@ -9,7 +9,7 @@ namespace esphome::sound_level { -static const char *const TAG = "sound_level"; +ESPHOME_LOG_TAG(TAG, "sound_level"); static const uint32_t MAX_FILL_DURATION_MS = 30; static const uint32_t RING_BUFFER_DURATION_MS = 120; diff --git a/esphome/components/spa06_base/spa06_base.cpp b/esphome/components/spa06_base/spa06_base.cpp index d3de5168e4..987a14c66a 100644 --- a/esphome/components/spa06_base/spa06_base.cpp +++ b/esphome/components/spa06_base/spa06_base.cpp @@ -6,7 +6,7 @@ namespace esphome::spa06_base { -static const char *const TAG = "spa06"; +ESPHOME_LOG_TAG(TAG, "spa06"); // Sign extension function for <=16 bit types inline int16_t decode16(uint8_t msb, uint8_t lsb, size_t bits, size_t head = 0) { diff --git a/esphome/components/spa06_i2c/spa06_i2c.cpp b/esphome/components/spa06_i2c/spa06_i2c.cpp index 4970b0822d..cdb0818d39 100644 --- a/esphome/components/spa06_i2c/spa06_i2c.cpp +++ b/esphome/components/spa06_i2c/spa06_i2c.cpp @@ -4,7 +4,7 @@ namespace esphome::spa06_i2c { -static const char *const TAG = "spa06_i2c"; +ESPHOME_LOG_TAG(TAG, "spa06_i2c"); void SPA06I2CComponent::dump_config() { LOG_I2C_DEVICE(this); diff --git a/esphome/components/spa06_spi/spa06_spi.cpp b/esphome/components/spa06_spi/spa06_spi.cpp index 9f3683d219..08d725d4f8 100644 --- a/esphome/components/spa06_spi/spa06_spi.cpp +++ b/esphome/components/spa06_spi/spa06_spi.cpp @@ -13,7 +13,7 @@ inline constexpr uint8_t SPA06_SPI_WRITE = 0x7F; namespace esphome::spa06_spi { -static const char *const TAG = "spa06_spi"; +ESPHOME_LOG_TAG(TAG, "spa06_spi"); void SPA06SPIComponent::dump_config() { SPA06Component::dump_config(); diff --git a/esphome/components/speaker/media_player/audio_pipeline.cpp b/esphome/components/speaker/media_player/audio_pipeline.cpp index f150a48573..a39a1ecbbe 100644 --- a/esphome/components/speaker/media_player/audio_pipeline.cpp +++ b/esphome/components/speaker/media_player/audio_pipeline.cpp @@ -21,7 +21,7 @@ static const uint32_t DECODE_TASK_STACK_SIZE = 3 * 1024; static const uint32_t INFO_ERROR_QUEUE_COUNT = 5; -static const char *const TAG = "speaker_media_player.pipeline"; +ESPHOME_LOG_TAG(TAG, "speaker_media_player.pipeline"); enum EventGroupBits : uint32_t { // MESSAGE_* bits are only set by their respective tasks diff --git a/esphome/components/speaker/media_player/speaker_media_player.cpp b/esphome/components/speaker/media_player/speaker_media_player.cpp index ab98935bda..e4aa78d10d 100644 --- a/esphome/components/speaker/media_player/speaker_media_player.cpp +++ b/esphome/components/speaker/media_player/speaker_media_player.cpp @@ -50,7 +50,7 @@ static const uint32_t MEDIA_CONTROLS_QUEUE_LENGTH = 20; static const UBaseType_t MEDIA_PIPELINE_TASK_PRIORITY = 1; static const UBaseType_t ANNOUNCEMENT_PIPELINE_TASK_PRIORITY = 1; -static const char *const TAG = "speaker_media_player"; +ESPHOME_LOG_TAG(TAG, "speaker_media_player"); void SpeakerMediaPlayer::setup() { #ifdef USE_SPEAKER_MEDIA_PLAYER_ON_OFF diff --git a/esphome/components/speaker_source/speaker_source_media_player.cpp b/esphome/components/speaker_source/speaker_source_media_player.cpp index 6a000b8f21..657c26af80 100644 --- a/esphome/components/speaker_source/speaker_source_media_player.cpp +++ b/esphome/components/speaker_source/speaker_source_media_player.cpp @@ -11,7 +11,7 @@ namespace esphome::speaker_source { static constexpr uint32_t MEDIA_CONTROLS_QUEUE_LENGTH = 20; -static const char *const TAG = "speaker_source_media_player"; +ESPHOME_LOG_TAG(TAG, "speaker_source_media_player"); // SourceBinding method implementations (defined here because SpeakerSourceMediaPlayer is forward-declared in the // header) diff --git a/esphome/components/speed/fan/speed_fan.cpp b/esphome/components/speed/fan/speed_fan.cpp index af46ef52e1..322c638d4b 100644 --- a/esphome/components/speed/fan/speed_fan.cpp +++ b/esphome/components/speed/fan/speed_fan.cpp @@ -3,7 +3,7 @@ namespace esphome::speed { -static const char *const TAG = "speed.fan"; +ESPHOME_LOG_TAG(TAG, "speed.fan"); void SpeedFan::setup() { // Construct traits before restore so preset modes can be looked up by index diff --git a/esphome/components/spi/spi.cpp b/esphome/components/spi/spi.cpp index dfdc9fa624..343fcd5488 100644 --- a/esphome/components/spi/spi.cpp +++ b/esphome/components/spi/spi.cpp @@ -4,7 +4,7 @@ namespace esphome::spi { -const char *const TAG = "spi"; +ESPHOME_LOG_TAG(TAG, "spi"); SPIDelegate *const SPIDelegate::NULL_DELEGATE = // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) new SPIDelegateDummy(); diff --git a/esphome/components/spi/spi_arduino.cpp b/esphome/components/spi/spi_arduino.cpp index ae2d2906ed..8ad868ad2e 100644 --- a/esphome/components/spi/spi_arduino.cpp +++ b/esphome/components/spi/spi_arduino.cpp @@ -4,7 +4,7 @@ namespace esphome::spi { #if defined(USE_ARDUINO) && !defined(USE_ESP32) -static const char *const TAG = "spi"; +ESPHOME_LOG_TAG(TAG, "spi"); class SPIDelegateHw : public SPIDelegate { public: SPIDelegateHw(SPIInterface channel, uint32_t data_rate, SPIBitOrder bit_order, SPIMode mode, GPIOPin *cs_pin) diff --git a/esphome/components/spi/spi_esp_idf.cpp b/esphome/components/spi/spi_esp_idf.cpp index 95b5e4f14b..7b51bfaa69 100644 --- a/esphome/components/spi/spi_esp_idf.cpp +++ b/esphome/components/spi/spi_esp_idf.cpp @@ -8,7 +8,7 @@ namespace esphome::spi { #ifdef USE_ESP32 -static const char *const TAG = "spi"; +ESPHOME_LOG_TAG(TAG, "spi"); static const size_t MAX_TRANSFER_SIZE = 4092; // dictated by ESP-IDF API. #ifdef USE_SPI_PSRAM_DMA diff --git a/esphome/components/spi_device/spi_device.cpp b/esphome/components/spi_device/spi_device.cpp index bdf5978bc7..f89b9f624f 100644 --- a/esphome/components/spi_device/spi_device.cpp +++ b/esphome/components/spi_device/spi_device.cpp @@ -5,7 +5,7 @@ namespace esphome::spi_device { -static const char *const TAG = "spi_device"; +ESPHOME_LOG_TAG(TAG, "spi_device"); void SPIDeviceComponent::setup() { this->spi_setup(); } diff --git a/esphome/components/split_buffer/split_buffer.cpp b/esphome/components/split_buffer/split_buffer.cpp index 63a0f0d919..56b1d326a3 100644 --- a/esphome/components/split_buffer/split_buffer.cpp +++ b/esphome/components/split_buffer/split_buffer.cpp @@ -7,7 +7,7 @@ #include "esphome/core/log.h" namespace esphome::split_buffer { -static constexpr const char *const TAG = "split_buffer"; +ESPHOME_LOG_TAG(TAG, "split_buffer"); SplitBuffer::~SplitBuffer() { this->free(); } diff --git a/esphome/components/sprinkler/sprinkler.cpp b/esphome/components/sprinkler/sprinkler.cpp index cdec158126..a3c264da58 100644 --- a/esphome/components/sprinkler/sprinkler.cpp +++ b/esphome/components/sprinkler/sprinkler.cpp @@ -10,7 +10,7 @@ namespace esphome::sprinkler { -static const char *const TAG = "sprinkler"; +ESPHOME_LOG_TAG(TAG, "sprinkler"); void SprinklerControllerNumber::setup() { float value; diff --git a/esphome/components/sps30/sps30.cpp b/esphome/components/sps30/sps30.cpp index 73fa4ef463..3a2ebb14c3 100644 --- a/esphome/components/sps30/sps30.cpp +++ b/esphome/components/sps30/sps30.cpp @@ -6,7 +6,7 @@ namespace esphome::sps30 { -static const char *const TAG = "sps30"; +ESPHOME_LOG_TAG(TAG, "sps30"); static const uint16_t SPS30_CMD_GET_ARTICLE_CODE = 0xD025; static const uint16_t SPS30_CMD_GET_SERIAL_NUMBER = 0xD033; diff --git a/esphome/components/ssd1306_base/ssd1306_base.cpp b/esphome/components/ssd1306_base/ssd1306_base.cpp index 5f1c6fca8f..ef7fa46e73 100644 --- a/esphome/components/ssd1306_base/ssd1306_base.cpp +++ b/esphome/components/ssd1306_base/ssd1306_base.cpp @@ -5,7 +5,7 @@ namespace esphome::ssd1306_base { -static const char *const TAG = "ssd1306"; +ESPHOME_LOG_TAG(TAG, "ssd1306"); static const uint8_t SSD1306_MAX_CONTRAST = 255; static const uint8_t SSD1305_MAX_BRIGHTNESS = 255; diff --git a/esphome/components/ssd1306_i2c/ssd1306_i2c.cpp b/esphome/components/ssd1306_i2c/ssd1306_i2c.cpp index 00c864a217..1cdfed9f50 100644 --- a/esphome/components/ssd1306_i2c/ssd1306_i2c.cpp +++ b/esphome/components/ssd1306_i2c/ssd1306_i2c.cpp @@ -3,7 +3,7 @@ namespace esphome::ssd1306_i2c { -static const char *const TAG = "ssd1306_i2c"; +ESPHOME_LOG_TAG(TAG, "ssd1306_i2c"); void I2CSSD1306::setup() { this->init_reset_(); diff --git a/esphome/components/ssd1306_spi/ssd1306_spi.cpp b/esphome/components/ssd1306_spi/ssd1306_spi.cpp index 0534deeb03..8e2dcebc0b 100644 --- a/esphome/components/ssd1306_spi/ssd1306_spi.cpp +++ b/esphome/components/ssd1306_spi/ssd1306_spi.cpp @@ -4,7 +4,7 @@ namespace esphome::ssd1306_spi { -static const char *const TAG = "ssd1306_spi"; +ESPHOME_LOG_TAG(TAG, "ssd1306_spi"); void SPISSD1306::setup() { this->spi_setup(); diff --git a/esphome/components/ssd1322_base/ssd1322_base.cpp b/esphome/components/ssd1322_base/ssd1322_base.cpp index a8a39b9ab0..30ca4109ef 100644 --- a/esphome/components/ssd1322_base/ssd1322_base.cpp +++ b/esphome/components/ssd1322_base/ssd1322_base.cpp @@ -4,7 +4,7 @@ namespace esphome::ssd1322_base { -static const char *const TAG = "ssd1322"; +ESPHOME_LOG_TAG(TAG, "ssd1322"); static const uint8_t SSD1322_MAX_CONTRAST = 255; static const uint8_t SSD1322_COLORMASK = 0x0f; diff --git a/esphome/components/ssd1322_spi/ssd1322_spi.cpp b/esphome/components/ssd1322_spi/ssd1322_spi.cpp index 79f15508c3..38426b9eaf 100644 --- a/esphome/components/ssd1322_spi/ssd1322_spi.cpp +++ b/esphome/components/ssd1322_spi/ssd1322_spi.cpp @@ -4,7 +4,7 @@ namespace esphome::ssd1322_spi { -static const char *const TAG = "ssd1322_spi"; +ESPHOME_LOG_TAG(TAG, "ssd1322_spi"); void SPISSD1322::setup() { this->spi_setup(); diff --git a/esphome/components/ssd1325_base/ssd1325_base.cpp b/esphome/components/ssd1325_base/ssd1325_base.cpp index b8d8f99999..17175447d9 100644 --- a/esphome/components/ssd1325_base/ssd1325_base.cpp +++ b/esphome/components/ssd1325_base/ssd1325_base.cpp @@ -4,7 +4,7 @@ namespace esphome::ssd1325_base { -static const char *const TAG = "ssd1325"; +ESPHOME_LOG_TAG(TAG, "ssd1325"); static const uint8_t SSD1325_MAX_CONTRAST = 127; static const uint8_t SSD1325_COLORMASK = 0x0f; diff --git a/esphome/components/ssd1325_spi/ssd1325_spi.cpp b/esphome/components/ssd1325_spi/ssd1325_spi.cpp index af6a01c7f3..cb21eb09fe 100644 --- a/esphome/components/ssd1325_spi/ssd1325_spi.cpp +++ b/esphome/components/ssd1325_spi/ssd1325_spi.cpp @@ -4,7 +4,7 @@ namespace esphome::ssd1325_spi { -static const char *const TAG = "ssd1325_spi"; +ESPHOME_LOG_TAG(TAG, "ssd1325_spi"); void SPISSD1325::setup() { this->spi_setup(); diff --git a/esphome/components/ssd1327_base/ssd1327_base.cpp b/esphome/components/ssd1327_base/ssd1327_base.cpp index ae02b836bf..7c8b490f61 100644 --- a/esphome/components/ssd1327_base/ssd1327_base.cpp +++ b/esphome/components/ssd1327_base/ssd1327_base.cpp @@ -4,7 +4,7 @@ namespace esphome::ssd1327_base { -static const char *const TAG = "ssd1327"; +ESPHOME_LOG_TAG(TAG, "ssd1327"); static const uint8_t SSD1327_MAX_CONTRAST = 127; static const uint8_t SSD1327_COLORMASK = 0x0f; diff --git a/esphome/components/ssd1327_i2c/ssd1327_i2c.cpp b/esphome/components/ssd1327_i2c/ssd1327_i2c.cpp index 90fbcbd05c..98328c800c 100644 --- a/esphome/components/ssd1327_i2c/ssd1327_i2c.cpp +++ b/esphome/components/ssd1327_i2c/ssd1327_i2c.cpp @@ -3,7 +3,7 @@ namespace esphome::ssd1327_i2c { -static const char *const TAG = "ssd1327_i2c"; +ESPHOME_LOG_TAG(TAG, "ssd1327_i2c"); void I2CSSD1327::setup() { this->init_reset_(); diff --git a/esphome/components/ssd1327_spi/ssd1327_spi.cpp b/esphome/components/ssd1327_spi/ssd1327_spi.cpp index c6a64227fc..8816aadf6d 100644 --- a/esphome/components/ssd1327_spi/ssd1327_spi.cpp +++ b/esphome/components/ssd1327_spi/ssd1327_spi.cpp @@ -4,7 +4,7 @@ namespace esphome::ssd1327_spi { -static const char *const TAG = "ssd1327_spi"; +ESPHOME_LOG_TAG(TAG, "ssd1327_spi"); void SPISSD1327::setup() { this->spi_setup(); diff --git a/esphome/components/ssd1331_base/ssd1331_base.cpp b/esphome/components/ssd1331_base/ssd1331_base.cpp index 7755e5a2a0..8d5ebb4dbb 100644 --- a/esphome/components/ssd1331_base/ssd1331_base.cpp +++ b/esphome/components/ssd1331_base/ssd1331_base.cpp @@ -4,7 +4,7 @@ namespace esphome::ssd1331_base { -static const char *const TAG = "ssd1331"; +ESPHOME_LOG_TAG(TAG, "ssd1331"); static const uint16_t SSD1331_COLORMASK = 0xffff; static const uint8_t SSD1331_MAX_CONTRASTA = 0x91; diff --git a/esphome/components/ssd1331_spi/ssd1331_spi.cpp b/esphome/components/ssd1331_spi/ssd1331_spi.cpp index a5118cdfbe..d36f9b75af 100644 --- a/esphome/components/ssd1331_spi/ssd1331_spi.cpp +++ b/esphome/components/ssd1331_spi/ssd1331_spi.cpp @@ -4,7 +4,7 @@ namespace esphome::ssd1331_spi { -static const char *const TAG = "ssd1331_spi"; +ESPHOME_LOG_TAG(TAG, "ssd1331_spi"); void SPISSD1331::setup() { this->spi_setup(); diff --git a/esphome/components/ssd1351_base/ssd1351_base.cpp b/esphome/components/ssd1351_base/ssd1351_base.cpp index 3df575499d..7ab3a64ea8 100644 --- a/esphome/components/ssd1351_base/ssd1351_base.cpp +++ b/esphome/components/ssd1351_base/ssd1351_base.cpp @@ -4,7 +4,7 @@ namespace esphome::ssd1351_base { -static const char *const TAG = "ssd1351"; +ESPHOME_LOG_TAG(TAG, "ssd1351"); static const uint16_t SSD1351_COLORMASK = 0xffff; static const uint8_t SSD1351_MAX_CONTRAST = 15; diff --git a/esphome/components/ssd1351_spi/ssd1351_spi.cpp b/esphome/components/ssd1351_spi/ssd1351_spi.cpp index f6d2323e9c..06d95e74a4 100644 --- a/esphome/components/ssd1351_spi/ssd1351_spi.cpp +++ b/esphome/components/ssd1351_spi/ssd1351_spi.cpp @@ -4,7 +4,7 @@ namespace esphome::ssd1351_spi { -static const char *const TAG = "ssd1351_spi"; +ESPHOME_LOG_TAG(TAG, "ssd1351_spi"); void SPISSD1351::setup() { this->spi_setup(); diff --git a/esphome/components/st7123/touchscreen/st7123_touchscreen.cpp b/esphome/components/st7123/touchscreen/st7123_touchscreen.cpp index 117f975264..5cd986f697 100644 --- a/esphome/components/st7123/touchscreen/st7123_touchscreen.cpp +++ b/esphome/components/st7123/touchscreen/st7123_touchscreen.cpp @@ -5,7 +5,7 @@ namespace esphome::st7123 { -static const char *const TAG = "st7123.touchscreen"; +ESPHOME_LOG_TAG(TAG, "st7123.touchscreen"); void ST7123Touchscreen::setup() { if (this->reset_pin_ != nullptr) { diff --git a/esphome/components/st7567_base/st7567_base.cpp b/esphome/components/st7567_base/st7567_base.cpp index fff3aa7e03..aa83de6a8c 100644 --- a/esphome/components/st7567_base/st7567_base.cpp +++ b/esphome/components/st7567_base/st7567_base.cpp @@ -4,7 +4,7 @@ namespace esphome::st7567_base { -static const char *const TAG = "st7567"; +ESPHOME_LOG_TAG(TAG, "st7567"); void ST7567::setup() { this->init_internal_(this->get_buffer_length_()); diff --git a/esphome/components/st7567_i2c/st7567_i2c.cpp b/esphome/components/st7567_i2c/st7567_i2c.cpp index c99815ecd6..657a60f954 100644 --- a/esphome/components/st7567_i2c/st7567_i2c.cpp +++ b/esphome/components/st7567_i2c/st7567_i2c.cpp @@ -3,7 +3,7 @@ namespace esphome::st7567_i2c { -static const char *const TAG = "st7567_i2c"; +ESPHOME_LOG_TAG(TAG, "st7567_i2c"); void I2CST7567::setup() { this->init_reset_(); diff --git a/esphome/components/st7567_spi/st7567_spi.cpp b/esphome/components/st7567_spi/st7567_spi.cpp index fae8c31381..fa9fb792dd 100644 --- a/esphome/components/st7567_spi/st7567_spi.cpp +++ b/esphome/components/st7567_spi/st7567_spi.cpp @@ -3,7 +3,7 @@ namespace esphome::st7567_spi { -static const char *const TAG = "st7567_spi"; +ESPHOME_LOG_TAG(TAG, "st7567_spi"); void SPIST7567::setup() { this->spi_setup(); diff --git a/esphome/components/st7920/st7920.cpp b/esphome/components/st7920/st7920.cpp index 429ed9e57b..19a96aad60 100644 --- a/esphome/components/st7920/st7920.cpp +++ b/esphome/components/st7920/st7920.cpp @@ -5,7 +5,7 @@ namespace esphome::st7920 { -static const char *const TAG = "st7920"; +ESPHOME_LOG_TAG(TAG, "st7920"); // ST7920 COMMANDS static const uint8_t LCD_DATA = 0xFA; diff --git a/esphome/components/statsd/statsd.cpp b/esphome/components/statsd/statsd.cpp index 2a56551255..12af8345f1 100644 --- a/esphome/components/statsd/statsd.cpp +++ b/esphome/components/statsd/statsd.cpp @@ -10,7 +10,7 @@ namespace esphome::statsd { // this is needed since statsD does not support fragmented UDP packets static const uint16_t SEND_THRESHOLD = 1024; -static const char *const TAG = "statsD"; +ESPHOME_LOG_TAG(TAG, "statsD"); void StatsdComponent::setup() { #ifndef USE_ESP8266 diff --git a/esphome/components/status/status_binary_sensor.cpp b/esphome/components/status/status_binary_sensor.cpp index 2c95be8569..192c03219f 100644 --- a/esphome/components/status/status_binary_sensor.cpp +++ b/esphome/components/status/status_binary_sensor.cpp @@ -12,7 +12,7 @@ namespace esphome::status { -static const char *const TAG = "status"; +ESPHOME_LOG_TAG(TAG, "status"); void StatusBinarySensor::update() { bool status = network::is_connected(); diff --git a/esphome/components/status_led/light/status_led_light.cpp b/esphome/components/status_led/light/status_led_light.cpp index 341d3bfce5..6eeb9732a4 100644 --- a/esphome/components/status_led/light/status_led_light.cpp +++ b/esphome/components/status_led/light/status_led_light.cpp @@ -5,7 +5,7 @@ namespace esphome::status_led { -static const char *const TAG = "status_led"; +ESPHOME_LOG_TAG(TAG, "status_led"); void StatusLEDLightOutput::loop() { uint8_t new_state = App.get_app_state() & STATUS_LED_MASK; diff --git a/esphome/components/status_led/status_led.cpp b/esphome/components/status_led/status_led.cpp index ae37b3fae7..81b3b9e3af 100644 --- a/esphome/components/status_led/status_led.cpp +++ b/esphome/components/status_led/status_led.cpp @@ -4,7 +4,7 @@ namespace esphome::status_led { -static const char *const TAG = "status_led"; +ESPHOME_LOG_TAG(TAG, "status_led"); static constexpr uint32_t ERROR_PERIOD_MS = 250; static constexpr uint32_t ERROR_ON_MS = 150; diff --git a/esphome/components/stcc4/stcc4.cpp b/esphome/components/stcc4/stcc4.cpp index efc7a2b8ee..ac7a998e5d 100644 --- a/esphome/components/stcc4/stcc4.cpp +++ b/esphome/components/stcc4/stcc4.cpp @@ -6,7 +6,7 @@ namespace esphome::stcc4 { -static const char *const TAG = "stcc4"; +ESPHOME_LOG_TAG(TAG, "stcc4"); // I2C Commands static constexpr uint16_t STCC4_CMD_START_CONTINUOUS_MEASUREMENT = 0x218b; diff --git a/esphome/components/stepper/stepper.cpp b/esphome/components/stepper/stepper.cpp index 54df83782e..dd3040d898 100644 --- a/esphome/components/stepper/stepper.cpp +++ b/esphome/components/stepper/stepper.cpp @@ -4,7 +4,7 @@ namespace esphome::stepper { -static const char *const TAG = "stepper"; +ESPHOME_LOG_TAG(TAG, "stepper"); void Stepper::calculate_speed_(uint32_t now) { // delta t since last calculation in seconds diff --git a/esphome/components/sts3x/sts3x.cpp b/esphome/components/sts3x/sts3x.cpp index ff2a7748bf..8b97b2f499 100644 --- a/esphome/components/sts3x/sts3x.cpp +++ b/esphome/components/sts3x/sts3x.cpp @@ -3,7 +3,7 @@ namespace esphome::sts3x { -static const char *const TAG = "sts3x"; +ESPHOME_LOG_TAG(TAG, "sts3x"); static const uint16_t STS3X_COMMAND_READ_SERIAL_NUMBER = 0x3780; static const uint16_t STS3X_COMMAND_READ_STATUS = 0xF32D; diff --git a/esphome/components/stts22h/stts22h.cpp b/esphome/components/stts22h/stts22h.cpp index 2b2559c843..7d66dd0a18 100644 --- a/esphome/components/stts22h/stts22h.cpp +++ b/esphome/components/stts22h/stts22h.cpp @@ -3,7 +3,7 @@ namespace esphome::stts22h { -static const char *const TAG = "stts22h"; +ESPHOME_LOG_TAG(TAG, "stts22h"); static const uint8_t WHOAMI_REG = 0x01; static const uint8_t CTRL_REG = 0x04; diff --git a/esphome/components/sun/sensor/sun_sensor.cpp b/esphome/components/sun/sensor/sun_sensor.cpp index d788e19ea4..b3cdacddae 100644 --- a/esphome/components/sun/sensor/sun_sensor.cpp +++ b/esphome/components/sun/sensor/sun_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::sun { -static const char *const TAG = "sun.sensor"; +ESPHOME_LOG_TAG(TAG, "sun.sensor"); void SunSensor::dump_config() { LOG_SENSOR("", "Sun Sensor", this); } diff --git a/esphome/components/sun/sun.cpp b/esphome/components/sun/sun.cpp index d03ff07981..f4c9d830b4 100644 --- a/esphome/components/sun/sun.cpp +++ b/esphome/components/sun/sun.cpp @@ -16,7 +16,7 @@ namespace esphome::sun { using namespace esphome::sun::internal; -static const char *const TAG = "sun"; +ESPHOME_LOG_TAG(TAG, "sun"); #undef degrees #undef radians diff --git a/esphome/components/sun/text_sensor/sun_text_sensor.cpp b/esphome/components/sun/text_sensor/sun_text_sensor.cpp index 21aa4b86e0..15a3fc21be 100644 --- a/esphome/components/sun/text_sensor/sun_text_sensor.cpp +++ b/esphome/components/sun/text_sensor/sun_text_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::sun { -static const char *const TAG = "sun.text_sensor"; +ESPHOME_LOG_TAG(TAG, "sun.text_sensor"); void SunTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Sun Text Sensor", this); } diff --git a/esphome/components/sun_gtil2/sun_gtil2.cpp b/esphome/components/sun_gtil2/sun_gtil2.cpp index 78e398d086..f89797cc10 100644 --- a/esphome/components/sun_gtil2/sun_gtil2.cpp +++ b/esphome/components/sun_gtil2/sun_gtil2.cpp @@ -3,7 +3,7 @@ namespace esphome::sun_gtil2 { -static const char *const TAG = "sun_gtil2"; +ESPHOME_LOG_TAG(TAG, "sun_gtil2"); static const double NTC_A = 0.0011591051055979914; static const double NTC_B = 0.00022878183547845582; diff --git a/esphome/components/switch/binary_sensor/switch_binary_sensor.cpp b/esphome/components/switch/binary_sensor/switch_binary_sensor.cpp index 19995fb1ae..c5b93e1dbb 100644 --- a/esphome/components/switch/binary_sensor/switch_binary_sensor.cpp +++ b/esphome/components/switch/binary_sensor/switch_binary_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::switch_ { -static const char *const TAG = "switch.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "switch.binary_sensor"); void SwitchBinarySensor::setup() { source_->add_on_state_callback([this](bool value) { this->publish_state(value); }); diff --git a/esphome/components/switch/switch.cpp b/esphome/components/switch/switch.cpp index 2cc8ad782d..179ef2ce35 100644 --- a/esphome/components/switch/switch.cpp +++ b/esphome/components/switch/switch.cpp @@ -5,7 +5,7 @@ namespace esphome::switch_ { -static const char *const TAG = "switch"; +ESPHOME_LOG_TAG(TAG, "switch"); Switch::Switch() : state(false) {} diff --git a/esphome/components/sx126x/packet_transport/sx126x_transport.cpp b/esphome/components/sx126x/packet_transport/sx126x_transport.cpp index 5e992cc731..70dc818495 100644 --- a/esphome/components/sx126x/packet_transport/sx126x_transport.cpp +++ b/esphome/components/sx126x/packet_transport/sx126x_transport.cpp @@ -4,7 +4,7 @@ namespace esphome::sx126x { -static const char *const TAG = "sx126x_transport"; +ESPHOME_LOG_TAG(TAG, "sx126x_transport"); void SX126xTransport::setup() { PacketTransport::setup(); diff --git a/esphome/components/sx126x/sx126x.cpp b/esphome/components/sx126x/sx126x.cpp index 673464d5eb..6c1281c89b 100644 --- a/esphome/components/sx126x/sx126x.cpp +++ b/esphome/components/sx126x/sx126x.cpp @@ -4,7 +4,7 @@ namespace esphome::sx126x { -static const char *const TAG = "sx126x"; +ESPHOME_LOG_TAG(TAG, "sx126x"); static const uint16_t RAMP[8] = {10, 20, 40, 80, 200, 800, 1700, 3400}; static const uint32_t BW_HZ[31] = {4800, 5800, 7300, 9700, 11700, 14600, 19500, 23400, 29300, 39000, 46900, 58600, 78200, 93800, 117300, 156200, 187200, 234300, 312000, 373600, 467000, 7810, diff --git a/esphome/components/sx127x/packet_transport/sx127x_transport.cpp b/esphome/components/sx127x/packet_transport/sx127x_transport.cpp index 52d5631791..77d1ea2880 100644 --- a/esphome/components/sx127x/packet_transport/sx127x_transport.cpp +++ b/esphome/components/sx127x/packet_transport/sx127x_transport.cpp @@ -4,7 +4,7 @@ namespace esphome::sx127x { -static const char *const TAG = "sx127x_transport"; +ESPHOME_LOG_TAG(TAG, "sx127x_transport"); void SX127xTransport::setup() { PacketTransport::setup(); diff --git a/esphome/components/sx127x/sx127x.cpp b/esphome/components/sx127x/sx127x.cpp index 9af30400a7..16c3d1dd21 100644 --- a/esphome/components/sx127x/sx127x.cpp +++ b/esphome/components/sx127x/sx127x.cpp @@ -4,7 +4,7 @@ namespace esphome::sx127x { -static const char *const TAG = "sx127x"; +ESPHOME_LOG_TAG(TAG, "sx127x"); static const uint32_t FXOSC = 32000000u; static const uint16_t RAMP[16] = {3400, 2000, 1000, 500, 250, 125, 100, 62, 50, 40, 31, 25, 20, 15, 12, 10}; static const uint32_t BW_HZ[22] = {2604, 3125, 3906, 5208, 6250, 7812, 10416, 12500, 15625, 20833, 25000, diff --git a/esphome/components/sx1509/output/sx1509_float_output.cpp b/esphome/components/sx1509/output/sx1509_float_output.cpp index 528de1fde5..5bf47e97bd 100644 --- a/esphome/components/sx1509/output/sx1509_float_output.cpp +++ b/esphome/components/sx1509/output/sx1509_float_output.cpp @@ -4,7 +4,7 @@ namespace esphome::sx1509 { -static const char *const TAG = "sx1509_float_channel"; +ESPHOME_LOG_TAG(TAG, "sx1509_float_channel"); void SX1509FloatOutputChannel::write_state(float state) { const uint16_t max_duty = 255; diff --git a/esphome/components/sx1509/sx1509.cpp b/esphome/components/sx1509/sx1509.cpp index ee8606db96..169d35331f 100644 --- a/esphome/components/sx1509/sx1509.cpp +++ b/esphome/components/sx1509/sx1509.cpp @@ -4,7 +4,7 @@ namespace esphome::sx1509 { -static const char *const TAG = "sx1509"; +ESPHOME_LOG_TAG(TAG, "sx1509"); void SX1509Component::setup() { ESP_LOGV(TAG, " Resetting devices"); diff --git a/esphome/components/sx1509/sx1509_gpio_pin.cpp b/esphome/components/sx1509/sx1509_gpio_pin.cpp index 28ef1c5830..41f967b667 100644 --- a/esphome/components/sx1509/sx1509_gpio_pin.cpp +++ b/esphome/components/sx1509/sx1509_gpio_pin.cpp @@ -5,7 +5,7 @@ namespace esphome::sx1509 { -static const char *const TAG = "sx1509_gpio_pin"; +ESPHOME_LOG_TAG(TAG, "sx1509_gpio_pin"); void SX1509GPIOPin::setup() { pin_mode(flags_); } void SX1509GPIOPin::pin_mode(gpio::Flags flags) { this->parent_->pin_mode(this->pin_, flags); } diff --git a/esphome/components/sy6970/sy6970.cpp b/esphome/components/sy6970/sy6970.cpp index 1f1648cfa7..3f381002cb 100644 --- a/esphome/components/sy6970/sy6970.cpp +++ b/esphome/components/sy6970/sy6970.cpp @@ -4,7 +4,7 @@ namespace esphome::sy6970 { -static const char *const TAG = "sy6970"; +ESPHOME_LOG_TAG(TAG, "sy6970"); bool SY6970Component::read_all_registers_() { // Read all registers from 0x00 to 0x14 in one transaction (21 bytes) diff --git a/esphome/components/systa_bus/sensor/systa_bus_sensor.cpp b/esphome/components/systa_bus/sensor/systa_bus_sensor.cpp index 08a4677180..5d9890eca5 100644 --- a/esphome/components/systa_bus/sensor/systa_bus_sensor.cpp +++ b/esphome/components/systa_bus/sensor/systa_bus_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::systa_bus { -static const char *const TAG = "systa_bus.sensor"; +ESPHOME_LOG_TAG(TAG, "systa_bus.sensor"); static int16_t get_i16be(std::span message, size_t start) { return static_cast(encode_uint16(message[start], message[start + 1])); diff --git a/esphome/components/systa_bus/systa_bus.cpp b/esphome/components/systa_bus/systa_bus.cpp index 3a2f6717e9..4c537b75cb 100644 --- a/esphome/components/systa_bus/systa_bus.cpp +++ b/esphome/components/systa_bus/systa_bus.cpp @@ -6,7 +6,7 @@ namespace esphome::systa_bus { -static const char *const TAG = "systa_bus"; +ESPHOME_LOG_TAG(TAG, "systa_bus"); void SystaBus::dump_config() { ESP_LOGCONFIG(TAG, "SystaBus:"); } diff --git a/esphome/components/t6615/t6615.cpp b/esphome/components/t6615/t6615.cpp index 982cc181b7..d399752889 100644 --- a/esphome/components/t6615/t6615.cpp +++ b/esphome/components/t6615/t6615.cpp @@ -4,7 +4,7 @@ namespace esphome::t6615 { -static const char *const TAG = "t6615"; +ESPHOME_LOG_TAG(TAG, "t6615"); static const uint32_t T6615_TIMEOUT = 1000; static const uint8_t T6615_MAGIC = 0xFF; diff --git a/esphome/components/tas2780/tas2780.cpp b/esphome/components/tas2780/tas2780.cpp index 191dbf823c..d69bd4dca1 100644 --- a/esphome/components/tas2780/tas2780.cpp +++ b/esphome/components/tas2780/tas2780.cpp @@ -8,7 +8,7 @@ namespace esphome::tas2780 { -static const char *const TAG = "tas2780"; +ESPHOME_LOG_TAG(TAG, "tas2780"); static constexpr uint8_t TAS2780_PAGE_SELECT = 0x00; // Page Select static constexpr uint8_t TAS2780_PAGE_0 = 0x00; // Page 0 diff --git a/esphome/components/tas58xx/tas58xx.cpp b/esphome/components/tas58xx/tas58xx.cpp index d042d42e24..3addbfda00 100644 --- a/esphome/components/tas58xx/tas58xx.cpp +++ b/esphome/components/tas58xx/tas58xx.cpp @@ -8,7 +8,7 @@ namespace esphome::tas58xx { -static const char *const TAG = "tas58xx"; +ESPHOME_LOG_TAG(TAG, "tas58xx"); static constexpr uint8_t TAS58XX_PAGE_SELECT = 0x00; // Page Select, in every book static constexpr uint8_t TAS58XX_BOOK_SELECT = 0x7F; // Book Select, on page 0 of every book diff --git a/esphome/components/tc74/tc74.cpp b/esphome/components/tc74/tc74.cpp index bc522d1b74..98428cd122 100644 --- a/esphome/components/tc74/tc74.cpp +++ b/esphome/components/tc74/tc74.cpp @@ -5,7 +5,7 @@ namespace esphome::tc74 { -static const char *const TAG = "tc74"; +ESPHOME_LOG_TAG(TAG, "tc74"); static const uint8_t TC74_REGISTER_TEMPERATURE = 0x00; static const uint8_t TC74_REGISTER_CONFIGURATION = 0x01; diff --git a/esphome/components/tca9548a/tca9548a.cpp b/esphome/components/tca9548a/tca9548a.cpp index 3fc91a3bbb..f10578c97c 100644 --- a/esphome/components/tca9548a/tca9548a.cpp +++ b/esphome/components/tca9548a/tca9548a.cpp @@ -3,7 +3,7 @@ namespace esphome::tca9548a { -static const char *const TAG = "tca9548a"; +ESPHOME_LOG_TAG(TAG, "tca9548a"); i2c::ErrorCode TCA9548AChannel::write_readv(uint8_t address, const uint8_t *write_buffer, size_t write_count, uint8_t *read_buffer, size_t read_count) { diff --git a/esphome/components/tca9555/tca9555.cpp b/esphome/components/tca9555/tca9555.cpp index b210c082dd..7a59c403f3 100644 --- a/esphome/components/tca9555/tca9555.cpp +++ b/esphome/components/tca9555/tca9555.cpp @@ -12,7 +12,7 @@ static const uint8_t TCA9555_CONFIGURATION_PORT_1 = 0x07; namespace esphome::tca9555 { -static const char *const TAG = "tca9555"; +ESPHOME_LOG_TAG(TAG, "tca9555"); void TCA9555Component::setup() { if (!this->read_gpio_modes_()) { diff --git a/esphome/components/tcl112/tcl112.cpp b/esphome/components/tcl112/tcl112.cpp index cd819e5b16..5e7f0ef29c 100644 --- a/esphome/components/tcl112/tcl112.cpp +++ b/esphome/components/tcl112/tcl112.cpp @@ -3,7 +3,7 @@ namespace esphome::tcl112 { -static const char *const TAG = "tcl112.climate"; +ESPHOME_LOG_TAG(TAG, "tcl112.climate"); const uint16_t TCL112_STATE_LENGTH = 14; const uint16_t TCL112_BITS = TCL112_STATE_LENGTH * 8; diff --git a/esphome/components/tcp_uart/tcp_uart.cpp b/esphome/components/tcp_uart/tcp_uart.cpp index efc85804e9..3dead1fb65 100644 --- a/esphome/components/tcp_uart/tcp_uart.cpp +++ b/esphome/components/tcp_uart/tcp_uart.cpp @@ -8,7 +8,7 @@ namespace esphome::tcp_uart { -static const char *const TAG = "tcp_uart"; +ESPHOME_LOG_TAG(TAG, "tcp_uart"); static constexpr uint32_t DROP_LOG_INTERVAL_MS = 5000; diff --git a/esphome/components/tcs34725/tcs34725.cpp b/esphome/components/tcs34725/tcs34725.cpp index b585392790..8e79ac1c16 100644 --- a/esphome/components/tcs34725/tcs34725.cpp +++ b/esphome/components/tcs34725/tcs34725.cpp @@ -6,7 +6,7 @@ namespace esphome::tcs34725 { -static const char *const TAG = "tcs34725"; +ESPHOME_LOG_TAG(TAG, "tcs34725"); static const uint8_t TCS34725_ADDRESS = 0x29; static const uint8_t TCS34725_COMMAND_BIT = 0x80; diff --git a/esphome/components/tee501/tee501.cpp b/esphome/components/tee501/tee501.cpp index c198ff1081..74906ba5c4 100644 --- a/esphome/components/tee501/tee501.cpp +++ b/esphome/components/tee501/tee501.cpp @@ -4,7 +4,7 @@ namespace esphome::tee501 { -static const char *const TAG = "tee501"; +ESPHOME_LOG_TAG(TAG, "tee501"); static constexpr size_t TEE501_SERIAL_NUMBER_SIZE = 7; diff --git a/esphome/components/teleinfo/sensor/teleinfo_sensor.cpp b/esphome/components/teleinfo/sensor/teleinfo_sensor.cpp index 3878a3967b..443d4be8a1 100644 --- a/esphome/components/teleinfo/sensor/teleinfo_sensor.cpp +++ b/esphome/components/teleinfo/sensor/teleinfo_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::teleinfo { -static const char *const TAG = "teleinfo_sensor"; +ESPHOME_LOG_TAG(TAG, "teleinfo_sensor"); TeleInfoSensor::TeleInfoSensor(const char *tag) { this->tag = std::string(tag); } void TeleInfoSensor::publish_val(const std::string &val) { auto newval = parse_number(val).value_or(0.0f); diff --git a/esphome/components/teleinfo/teleinfo.cpp b/esphome/components/teleinfo/teleinfo.cpp index 17d3d6c099..6b68dacd31 100644 --- a/esphome/components/teleinfo/teleinfo.cpp +++ b/esphome/components/teleinfo/teleinfo.cpp @@ -3,7 +3,7 @@ namespace esphome::teleinfo { -static const char *const TAG = "teleinfo"; +ESPHOME_LOG_TAG(TAG, "teleinfo"); /* Helpers */ static int get_field(char *dest, char *buf_start, char *buf_end, int sep, int max_len) { diff --git a/esphome/components/teleinfo/text_sensor/teleinfo_text_sensor.cpp b/esphome/components/teleinfo/text_sensor/teleinfo_text_sensor.cpp index 7c638d8545..a2646e5bb7 100644 --- a/esphome/components/teleinfo/text_sensor/teleinfo_text_sensor.cpp +++ b/esphome/components/teleinfo/text_sensor/teleinfo_text_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::teleinfo { -static const char *const TAG = "teleinfo_text_sensor"; +ESPHOME_LOG_TAG(TAG, "teleinfo_text_sensor"); TeleInfoTextSensor::TeleInfoTextSensor(const char *tag) { this->tag = std::string(tag); } void TeleInfoTextSensor::publish_val(const std::string &val) { publish_state(val); } void TeleInfoTextSensor::dump_config() { LOG_TEXT_SENSOR(" ", "Teleinfo Text Sensor", this); } diff --git a/esphome/components/tem3200/tem3200.cpp b/esphome/components/tem3200/tem3200.cpp index 72cf31e0a6..e964814bbb 100644 --- a/esphome/components/tem3200/tem3200.cpp +++ b/esphome/components/tem3200/tem3200.cpp @@ -5,7 +5,7 @@ namespace esphome::tem3200 { -static const char *const TAG = "tem3200"; +ESPHOME_LOG_TAG(TAG, "tem3200"); enum ErrorCode { NONE = 0, diff --git a/esphome/components/template/alarm_control_panel/template_alarm_control_panel.cpp b/esphome/components/template/alarm_control_panel/template_alarm_control_panel.cpp index a224ab8459..293f025527 100644 --- a/esphome/components/template/alarm_control_panel/template_alarm_control_panel.cpp +++ b/esphome/components/template/alarm_control_panel/template_alarm_control_panel.cpp @@ -11,7 +11,7 @@ namespace esphome::template_ { using namespace esphome::alarm_control_panel; -static const char *const TAG = "template.alarm_control_panel"; +ESPHOME_LOG_TAG(TAG, "template.alarm_control_panel"); TemplateAlarmControlPanel::TemplateAlarmControlPanel(){}; diff --git a/esphome/components/template/binary_sensor/template_binary_sensor.cpp b/esphome/components/template/binary_sensor/template_binary_sensor.cpp index b63121d2db..8ce51aa4ca 100644 --- a/esphome/components/template/binary_sensor/template_binary_sensor.cpp +++ b/esphome/components/template/binary_sensor/template_binary_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "template.binary_sensor"); void TemplateBinarySensor::setup() { if (!this->f_.has_value()) { diff --git a/esphome/components/template/climate/template_climate.cpp b/esphome/components/template/climate/template_climate.cpp index a7a4d2ccab..a731f037e3 100644 --- a/esphome/components/template/climate/template_climate.cpp +++ b/esphome/components/template/climate/template_climate.cpp @@ -3,7 +3,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.climate"; +ESPHOME_LOG_TAG(TAG, "template.climate"); void TemplateClimate::setup() { if (this->restore_mode_ == TemplateClimateRestoreMode::TEMPLATE_CLIMATE_RESTORE_MODE_RESTORE) { diff --git a/esphome/components/template/cover/template_cover.cpp b/esphome/components/template/cover/template_cover.cpp index 1bf057da5b..88a0af10b5 100644 --- a/esphome/components/template/cover/template_cover.cpp +++ b/esphome/components/template/cover/template_cover.cpp @@ -5,7 +5,7 @@ namespace esphome::template_ { using namespace esphome::cover; -static const char *const TAG = "template.cover"; +ESPHOME_LOG_TAG(TAG, "template.cover"); TemplateCover::TemplateCover() = default; void TemplateCover::setup() { diff --git a/esphome/components/template/datetime/template_date.cpp b/esphome/components/template/datetime/template_date.cpp index c0f5d96c3d..4ae7429e96 100644 --- a/esphome/components/template/datetime/template_date.cpp +++ b/esphome/components/template/datetime/template_date.cpp @@ -6,7 +6,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.date"; +ESPHOME_LOG_TAG(TAG, "template.date"); void TemplateDate::setup() { if (this->f_.has_value()) diff --git a/esphome/components/template/datetime/template_datetime.cpp b/esphome/components/template/datetime/template_datetime.cpp index 5b8b308c00..0776a6968a 100644 --- a/esphome/components/template/datetime/template_datetime.cpp +++ b/esphome/components/template/datetime/template_datetime.cpp @@ -6,7 +6,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.datetime"; +ESPHOME_LOG_TAG(TAG, "template.datetime"); void TemplateDateTime::setup() { if (this->f_.has_value()) diff --git a/esphome/components/template/datetime/template_time.cpp b/esphome/components/template/datetime/template_time.cpp index b5efa62ae7..fd676e66a6 100644 --- a/esphome/components/template/datetime/template_time.cpp +++ b/esphome/components/template/datetime/template_time.cpp @@ -6,7 +6,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.time"; +ESPHOME_LOG_TAG(TAG, "template.time"); void TemplateTime::setup() { if (this->f_.has_value()) diff --git a/esphome/components/template/fan/template_fan.cpp b/esphome/components/template/fan/template_fan.cpp index 431be84654..93b02f1245 100644 --- a/esphome/components/template/fan/template_fan.cpp +++ b/esphome/components/template/fan/template_fan.cpp @@ -3,7 +3,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.fan"; +ESPHOME_LOG_TAG(TAG, "template.fan"); void TemplateFan::setup() { // Construct traits before restore so preset modes can be looked up by index diff --git a/esphome/components/template/lock/template_lock.cpp b/esphome/components/template/lock/template_lock.cpp index 4a293aab85..54e4e49ce9 100644 --- a/esphome/components/template/lock/template_lock.cpp +++ b/esphome/components/template/lock/template_lock.cpp @@ -5,7 +5,7 @@ namespace esphome::template_ { using namespace esphome::lock; -static const char *const TAG = "template.lock"; +ESPHOME_LOG_TAG(TAG, "template.lock"); TemplateLock::TemplateLock() = default; diff --git a/esphome/components/template/number/template_number.cpp b/esphome/components/template/number/template_number.cpp index 64c2deb281..93eb42708e 100644 --- a/esphome/components/template/number/template_number.cpp +++ b/esphome/components/template/number/template_number.cpp @@ -3,7 +3,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.number"; +ESPHOME_LOG_TAG(TAG, "template.number"); void TemplateNumber::setup() { if (this->f_.has_value()) diff --git a/esphome/components/template/select/template_select.cpp b/esphome/components/template/select/template_select.cpp index e68729c2d4..8c46b3a58c 100644 --- a/esphome/components/template/select/template_select.cpp +++ b/esphome/components/template/select/template_select.cpp @@ -3,7 +3,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.select"; +ESPHOME_LOG_TAG(TAG, "template.select"); void dump_config_helper(BaseTemplateSelect *sel_comp, bool optimistic, bool has_lambda, const size_t initial_option_index, bool restore_value) { diff --git a/esphome/components/template/sensor/template_sensor.cpp b/esphome/components/template/sensor/template_sensor.cpp index 313a163e38..cc12d7bbec 100644 --- a/esphome/components/template/sensor/template_sensor.cpp +++ b/esphome/components/template/sensor/template_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.sensor"; +ESPHOME_LOG_TAG(TAG, "template.sensor"); void TemplateSensor::update() { if (!this->f_.has_value()) diff --git a/esphome/components/template/switch/template_switch.cpp b/esphome/components/template/switch/template_switch.cpp index 729db37053..456e93d13d 100644 --- a/esphome/components/template/switch/template_switch.cpp +++ b/esphome/components/template/switch/template_switch.cpp @@ -3,7 +3,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.switch"; +ESPHOME_LOG_TAG(TAG, "template.switch"); TemplateSwitch::TemplateSwitch() = default; diff --git a/esphome/components/template/text/template_text.cpp b/esphome/components/template/text/template_text.cpp index af134e6ed4..d892afade4 100644 --- a/esphome/components/template/text/template_text.cpp +++ b/esphome/components/template/text/template_text.cpp @@ -3,7 +3,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.text"; +ESPHOME_LOG_TAG(TAG, "template.text"); void TemplateText::setup() { if (this->f_.has_value()) diff --git a/esphome/components/template/text_sensor/template_text_sensor.cpp b/esphome/components/template/text_sensor/template_text_sensor.cpp index 89a15b6081..38de4ea8de 100644 --- a/esphome/components/template/text_sensor/template_text_sensor.cpp +++ b/esphome/components/template/text_sensor/template_text_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.text_sensor"; +ESPHOME_LOG_TAG(TAG, "template.text_sensor"); void TemplateTextSensor::update() { if (!this->f_.has_value()) diff --git a/esphome/components/template/time/template_real_time_clock.cpp b/esphome/components/template/time/template_real_time_clock.cpp index 4b523def25..4e8a272285 100644 --- a/esphome/components/template/time/template_real_time_clock.cpp +++ b/esphome/components/template/time/template_real_time_clock.cpp @@ -2,7 +2,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.time"; +ESPHOME_LOG_TAG(TAG, "template.time"); time_t TemplateRealTimeClock::timestamp_now() { auto val = this->f_.call(); diff --git a/esphome/components/template/valve/template_valve.cpp b/esphome/components/template/valve/template_valve.cpp index 5090687639..77e65f0457 100644 --- a/esphome/components/template/valve/template_valve.cpp +++ b/esphome/components/template/valve/template_valve.cpp @@ -5,7 +5,7 @@ namespace esphome::template_ { using namespace esphome::valve; -static const char *const TAG = "template.valve"; +ESPHOME_LOG_TAG(TAG, "template.valve"); TemplateValve::TemplateValve() = default; diff --git a/esphome/components/template/water_heater/template_water_heater.cpp b/esphome/components/template/water_heater/template_water_heater.cpp index 7718688d68..0a71225de3 100644 --- a/esphome/components/template/water_heater/template_water_heater.cpp +++ b/esphome/components/template/water_heater/template_water_heater.cpp @@ -5,7 +5,7 @@ namespace esphome::template_ { -static const char *const TAG = "template.water_heater"; +ESPHOME_LOG_TAG(TAG, "template.water_heater"); TemplateWaterHeater::TemplateWaterHeater() = default; diff --git a/esphome/components/text/text.cpp b/esphome/components/text/text.cpp index a1df6286c7..58ab300b90 100644 --- a/esphome/components/text/text.cpp +++ b/esphome/components/text/text.cpp @@ -6,7 +6,7 @@ namespace esphome::text { -static const char *const TAG = "text"; +ESPHOME_LOG_TAG(TAG, "text"); void Text::publish_state(const char *state, size_t len) { this->set_has_state(true); diff --git a/esphome/components/text/text_call.cpp b/esphome/components/text/text_call.cpp index b7692658af..93f0610d7d 100644 --- a/esphome/components/text/text_call.cpp +++ b/esphome/components/text/text_call.cpp @@ -4,7 +4,7 @@ namespace esphome::text { -static const char *const TAG = "text"; +ESPHOME_LOG_TAG(TAG, "text"); TextCall &TextCall::set_value(const std::string &value) { this->value_ = value; diff --git a/esphome/components/text/text_sensor/text_text_sensor.cpp b/esphome/components/text/text_sensor/text_text_sensor.cpp index 50504c605e..6574141e9f 100644 --- a/esphome/components/text/text_sensor/text_text_sensor.cpp +++ b/esphome/components/text/text_sensor/text_text_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::text { -static const char *const TAG = "text.text_sensor"; +ESPHOME_LOG_TAG(TAG, "text.text_sensor"); void TextTextSensor::setup() { this->source_->add_on_state_callback([this](const std::string &value) { this->publish_state(value); }); diff --git a/esphome/components/text_sensor/filter.cpp b/esphome/components/text_sensor/filter.cpp index d4e6b5b9bb..9d18fb9b1a 100644 --- a/esphome/components/text_sensor/filter.cpp +++ b/esphome/components/text_sensor/filter.cpp @@ -8,7 +8,7 @@ namespace esphome::text_sensor { -static const char *const TAG = "text_sensor.filter"; +ESPHOME_LOG_TAG(TAG, "text_sensor.filter"); // Filter void Filter::input(std::string value) { diff --git a/esphome/components/text_sensor/text_sensor.cpp b/esphome/components/text_sensor/text_sensor.cpp index 17c606d253..af4c5fd081 100644 --- a/esphome/components/text_sensor/text_sensor.cpp +++ b/esphome/components/text_sensor/text_sensor.cpp @@ -6,7 +6,7 @@ namespace esphome::text_sensor { -static const char *const TAG = "text_sensor"; +ESPHOME_LOG_TAG(TAG, "text_sensor"); void log_text_sensor(const char *tag, const char *prefix, const char *type, TextSensor *obj) { if (obj == nullptr) { diff --git a/esphome/components/tfluna/tfluna.cpp b/esphome/components/tfluna/tfluna.cpp index 1466ba8947..0936a07f49 100644 --- a/esphome/components/tfluna/tfluna.cpp +++ b/esphome/components/tfluna/tfluna.cpp @@ -16,7 +16,7 @@ static constexpr uint8_t MODE_TRIGGER = 0x01; static constexpr uint8_t TRIGGER_ONESHOT_REGISTER = 0x24; static constexpr uint8_t MAX_READ_ATTEMPTS = 5; static constexpr uint8_t READ_RETRY_MS = 5; -static const char *const TAG = "tfluna"; +ESPHOME_LOG_TAG(TAG, "tfluna"); static const char *const READ_RETRY_TIMEOUT = "read_retry"; void TFLuna::dump_config() { diff --git a/esphome/components/thermopro_ble/thermopro_ble.cpp b/esphome/components/thermopro_ble/thermopro_ble.cpp index d10a6c33cd..38a58137ae 100644 --- a/esphome/components/thermopro_ble/thermopro_ble.cpp +++ b/esphome/components/thermopro_ble/thermopro_ble.cpp @@ -19,7 +19,7 @@ static optional parse_tp972(const uint8_t *data, std::size_t data_s static optional parse_tp96(const uint8_t *data, std::size_t data_size); static optional parse_tp3(const uint8_t *data, std::size_t data_size); -static const char *const TAG = "thermopro_ble"; +ESPHOME_LOG_TAG(TAG, "thermopro_ble"); static const struct DeviceParserMapping DEVICE_PARSER_MAP[] = { {"TP972", parse_tp972}, {"TP970", parse_tp96}, {"TP96", parse_tp96}, {"TP3", parse_tp3}}; diff --git a/esphome/components/thermostat/thermostat_climate.cpp b/esphome/components/thermostat/thermostat_climate.cpp index f64673e13f..abfe1b027a 100644 --- a/esphome/components/thermostat/thermostat_climate.cpp +++ b/esphome/components/thermostat/thermostat_climate.cpp @@ -6,7 +6,7 @@ namespace esphome::thermostat { -static const char *const TAG = "thermostat.climate"; +ESPHOME_LOG_TAG(TAG, "thermostat.climate"); void ThermostatClimate::setup() { if (this->use_startup_delay_) { diff --git a/esphome/components/time/automation.cpp b/esphome/components/time/automation.cpp index b91f8b0360..26956703e7 100644 --- a/esphome/components/time/automation.cpp +++ b/esphome/components/time/automation.cpp @@ -7,7 +7,7 @@ namespace esphome::time { -static const char *const TAG = "automation"; +ESPHOME_LOG_TAG(TAG, "automation"); static const int MAX_TIMESTAMP_DRIFT = 900; // how far can the clock drift before we consider // there has been a drastic time synchronization diff --git a/esphome/components/time/real_time_clock.cpp b/esphome/components/time/real_time_clock.cpp index 4f32560525..5f6b7d150f 100644 --- a/esphome/components/time/real_time_clock.cpp +++ b/esphome/components/time/real_time_clock.cpp @@ -19,7 +19,7 @@ namespace esphome::time { -static const char *const TAG = "time"; +ESPHOME_LOG_TAG(TAG, "time"); RealTimeClock::RealTimeClock() = default; diff --git a/esphome/components/time_based/cover/time_based_cover.cpp b/esphome/components/time_based/cover/time_based_cover.cpp index 613b190cf3..4be933dd46 100644 --- a/esphome/components/time_based/cover/time_based_cover.cpp +++ b/esphome/components/time_based/cover/time_based_cover.cpp @@ -5,7 +5,7 @@ namespace esphome::time_based { -static const char *const TAG = "time_based.cover"; +ESPHOME_LOG_TAG(TAG, "time_based.cover"); using namespace esphome::cover; diff --git a/esphome/components/tinyusb/tinyusb_component.cpp b/esphome/components/tinyusb/tinyusb_component.cpp index 3fab9de008..14291fb328 100644 --- a/esphome/components/tinyusb/tinyusb_component.cpp +++ b/esphome/components/tinyusb/tinyusb_component.cpp @@ -7,7 +7,7 @@ namespace esphome::tinyusb { -static const char *const TAG = "tinyusb"; +ESPHOME_LOG_TAG(TAG, "tinyusb"); // Runs on the TinyUSB task: only wake the main loop, which reads the state and runs // the automations. diff --git a/esphome/components/tlc59208f/tlc59208f_output.cpp b/esphome/components/tlc59208f/tlc59208f_output.cpp index def337befc..d76845b4f0 100644 --- a/esphome/components/tlc59208f/tlc59208f_output.cpp +++ b/esphome/components/tlc59208f/tlc59208f_output.cpp @@ -5,7 +5,7 @@ namespace esphome::tlc59208f { -static const char *const TAG = "tlc59208f"; +ESPHOME_LOG_TAG(TAG, "tlc59208f"); // * marks register defaults // 0*: Register auto increment disabled, 1: Register auto increment enabled diff --git a/esphome/components/tlc5947/tlc5947.cpp b/esphome/components/tlc5947/tlc5947.cpp index f886118a08..5502679c9d 100644 --- a/esphome/components/tlc5947/tlc5947.cpp +++ b/esphome/components/tlc5947/tlc5947.cpp @@ -3,7 +3,7 @@ namespace esphome::tlc5947 { -static const char *const TAG = "tlc5947"; +ESPHOME_LOG_TAG(TAG, "tlc5947"); void TLC5947::setup() { this->data_pin_->setup(); diff --git a/esphome/components/tlc5971/tlc5971.cpp b/esphome/components/tlc5971/tlc5971.cpp index 5818eace67..2c4ec56732 100644 --- a/esphome/components/tlc5971/tlc5971.cpp +++ b/esphome/components/tlc5971/tlc5971.cpp @@ -3,7 +3,7 @@ namespace esphome::tlc5971 { -static const char *const TAG = "tlc5971"; +ESPHOME_LOG_TAG(TAG, "tlc5971"); void TLC5971::setup() { this->data_pin_->setup(); diff --git a/esphome/components/tm1621/tm1621.cpp b/esphome/components/tm1621/tm1621.cpp index 68d16e3811..5ca1c83c48 100644 --- a/esphome/components/tm1621/tm1621.cpp +++ b/esphome/components/tm1621/tm1621.cpp @@ -5,7 +5,7 @@ namespace esphome::tm1621 { -static const char *const TAG = "tm1621"; +ESPHOME_LOG_TAG(TAG, "tm1621"); const uint8_t TM1621_PULSE_WIDTH = 10; // microseconds (Sonoff = 100) diff --git a/esphome/components/tm1637/tm1637.cpp b/esphome/components/tm1637/tm1637.cpp index a1604fa60e..03eb427e76 100644 --- a/esphome/components/tm1637/tm1637.cpp +++ b/esphome/components/tm1637/tm1637.cpp @@ -5,7 +5,7 @@ namespace esphome::tm1637 { -static const char *const TAG = "display.tm1637"; +ESPHOME_LOG_TAG(TAG, "display.tm1637"); const uint8_t TM1637_CMD_DATA = 0x40; //!< Display data command const uint8_t TM1637_CMD_CTRL = 0x80; //!< Display control command const uint8_t TM1637_CMD_ADDR = 0xc0; //!< Display address command diff --git a/esphome/components/tm1638/output/tm1638_output_led.cpp b/esphome/components/tm1638/output/tm1638_output_led.cpp index e32826fa93..8e2020459c 100644 --- a/esphome/components/tm1638/output/tm1638_output_led.cpp +++ b/esphome/components/tm1638/output/tm1638_output_led.cpp @@ -3,7 +3,7 @@ namespace esphome::tm1638 { -static const char *const TAG = "tm1638.led"; +ESPHOME_LOG_TAG(TAG, "tm1638.led"); void TM1638OutputLed::write_state(bool state) { tm1638_->set_led(led_, state); } diff --git a/esphome/components/tm1638/switch/tm1638_switch_led.cpp b/esphome/components/tm1638/switch/tm1638_switch_led.cpp index 743d0af507..f5573a3592 100644 --- a/esphome/components/tm1638/switch/tm1638_switch_led.cpp +++ b/esphome/components/tm1638/switch/tm1638_switch_led.cpp @@ -3,7 +3,7 @@ namespace esphome::tm1638 { -static const char *const TAG = "tm1638.led"; +ESPHOME_LOG_TAG(TAG, "tm1638.led"); void TM1638SwitchLed::write_state(bool state) { tm1638_->set_led(led_, state); diff --git a/esphome/components/tm1638/tm1638.cpp b/esphome/components/tm1638/tm1638.cpp index 1f0692479c..ffb0ead0cd 100644 --- a/esphome/components/tm1638/tm1638.cpp +++ b/esphome/components/tm1638/tm1638.cpp @@ -6,7 +6,7 @@ namespace esphome::tm1638 { -static const char *const TAG = "display.tm1638"; +ESPHOME_LOG_TAG(TAG, "display.tm1638"); static const uint8_t TM1638_REGISTER_FIXEDADDRESS = 0x44; static const uint8_t TM1638_REGISTER_AUTOADDRESS = 0x40; static const uint8_t TM1638_REGISTER_READBUTTONS = 0x42; diff --git a/esphome/components/tm1651/tm1651.cpp b/esphome/components/tm1651/tm1651.cpp index 282b0dcf76..467695b4b4 100644 --- a/esphome/components/tm1651/tm1651.cpp +++ b/esphome/components/tm1651/tm1651.cpp @@ -53,7 +53,7 @@ namespace esphome::tm1651 { -static const char *const TAG = "tm1651.display"; +ESPHOME_LOG_TAG(TAG, "tm1651.display"); static const bool LINE_HIGH = true; static const bool LINE_LOW = false; diff --git a/esphome/components/tmp102/tmp102.cpp b/esphome/components/tmp102/tmp102.cpp index cb2462858b..4f10555324 100644 --- a/esphome/components/tmp102/tmp102.cpp +++ b/esphome/components/tmp102/tmp102.cpp @@ -4,7 +4,7 @@ namespace esphome::tmp102 { -static const char *const TAG = "tmp102"; +ESPHOME_LOG_TAG(TAG, "tmp102"); static const uint8_t TMP102_ADDRESS = 0x48; static const uint8_t TMP102_REGISTER_TEMPERATURE = 0x00; diff --git a/esphome/components/tmp1075/tmp1075.cpp b/esphome/components/tmp1075/tmp1075.cpp index 681603d113..9b152c1ad3 100644 --- a/esphome/components/tmp1075/tmp1075.cpp +++ b/esphome/components/tmp1075/tmp1075.cpp @@ -3,7 +3,7 @@ namespace esphome::tmp1075 { -static const char *const TAG = "tmp1075"; +ESPHOME_LOG_TAG(TAG, "tmp1075"); constexpr uint8_t REG_TEMP = 0x0; // Temperature result constexpr uint8_t REG_CFGR = 0x1; // Configuration diff --git a/esphome/components/tmp117/tmp117.cpp b/esphome/components/tmp117/tmp117.cpp index b3e900f5b6..5925b297c2 100644 --- a/esphome/components/tmp117/tmp117.cpp +++ b/esphome/components/tmp117/tmp117.cpp @@ -6,7 +6,7 @@ namespace esphome::tmp117 { -static const char *const TAG = "tmp117"; +ESPHOME_LOG_TAG(TAG, "tmp117"); void TMP117Component::update() { int16_t data; diff --git a/esphome/components/tof10120/tof10120_sensor.cpp b/esphome/components/tof10120/tof10120_sensor.cpp index 290bc76a52..3943b37150 100644 --- a/esphome/components/tof10120/tof10120_sensor.cpp +++ b/esphome/components/tof10120/tof10120_sensor.cpp @@ -7,7 +7,7 @@ namespace esphome::tof10120 { -static const char *const TAG = "tof10120"; +ESPHOME_LOG_TAG(TAG, "tof10120"); static const uint8_t TOF10120_READ_DISTANCE_CMD[] = {0x00}; static const uint8_t TOF10120_DEFAULT_DELAY = 30; diff --git a/esphome/components/tormatic/tormatic_cover.cpp b/esphome/components/tormatic/tormatic_cover.cpp index 5c8d6623b6..fe7b4cf112 100644 --- a/esphome/components/tormatic/tormatic_cover.cpp +++ b/esphome/components/tormatic/tormatic_cover.cpp @@ -7,7 +7,7 @@ using namespace std; namespace esphome::tormatic { -static const char *const TAG = "tormatic.cover"; +ESPHOME_LOG_TAG(TAG, "tormatic.cover"); // Time to poll the UART when flushing after desync. At 9600 baud, a full // 12-byte message takes ~12.5ms, so 15ms guarantees all bytes have arrived. diff --git a/esphome/components/toshiba/toshiba.cpp b/esphome/components/toshiba/toshiba.cpp index 19950bbd15..f9f09a98bc 100644 --- a/esphome/components/toshiba/toshiba.cpp +++ b/esphome/components/toshiba/toshiba.cpp @@ -11,7 +11,7 @@ struct RacPt1411hwruFanSpeed { uint8_t code2; }; -static const char *const TAG = "toshiba.climate"; +ESPHOME_LOG_TAG(TAG, "toshiba.climate"); // Timings for IR bits/data const uint16_t TOSHIBA_HEADER_MARK = 4380; const uint16_t TOSHIBA_HEADER_SPACE = 4370; diff --git a/esphome/components/total_daily_energy/total_daily_energy.cpp b/esphome/components/total_daily_energy/total_daily_energy.cpp index 7c9dbb604f..c8e6bdd04a 100644 --- a/esphome/components/total_daily_energy/total_daily_energy.cpp +++ b/esphome/components/total_daily_energy/total_daily_energy.cpp @@ -4,7 +4,7 @@ namespace esphome::total_daily_energy { -static const char *const TAG = "total_daily_energy"; +ESPHOME_LOG_TAG(TAG, "total_daily_energy"); static constexpr uint32_t TIMEOUT_ID_MIDNIGHT = 1; static constexpr uint8_t SECONDS_PER_MINUTE = 60; static constexpr uint8_t MINUTES_PER_HOUR = 60; diff --git a/esphome/components/touchscreen/touchscreen.cpp b/esphome/components/touchscreen/touchscreen.cpp index cb36733e2f..7072b88d55 100644 --- a/esphome/components/touchscreen/touchscreen.cpp +++ b/esphome/components/touchscreen/touchscreen.cpp @@ -4,7 +4,7 @@ namespace esphome::touchscreen { -static const char *const TAG = "touchscreen"; +ESPHOME_LOG_TAG(TAG, "touchscreen"); static constexpr uint32_t TOUCH_TIMEOUT_ID = 0; void TouchscreenInterrupt::gpio_intr(TouchscreenInterrupt *store) { store->touched = true; } diff --git a/esphome/components/tsl2561/tsl2561.cpp b/esphome/components/tsl2561/tsl2561.cpp index 4e4d403488..989a15f054 100644 --- a/esphome/components/tsl2561/tsl2561.cpp +++ b/esphome/components/tsl2561/tsl2561.cpp @@ -3,7 +3,7 @@ namespace esphome::tsl2561 { -static const char *const TAG = "tsl2561"; +ESPHOME_LOG_TAG(TAG, "tsl2561"); static const uint8_t TSL2561_COMMAND_BIT = 0x80; static const uint8_t TSL2561_WORD_BIT = 0x20; diff --git a/esphome/components/tsl2591/tsl2591.cpp b/esphome/components/tsl2591/tsl2591.cpp index d147aae88a..dfc0dfedf4 100644 --- a/esphome/components/tsl2591/tsl2591.cpp +++ b/esphome/components/tsl2591/tsl2591.cpp @@ -4,7 +4,7 @@ namespace esphome::tsl2591 { -static const char *const TAG = "tsl2591.sensor"; +ESPHOME_LOG_TAG(TAG, "tsl2591.sensor"); // Various constants used in TSL2591 register manipulation #define TSL2591_COMMAND_BIT (0xA0) // 1010 0000: bits 7 and 5 for 'command, normal' diff --git a/esphome/components/tt21100/binary_sensor/tt21100_button.cpp b/esphome/components/tt21100/binary_sensor/tt21100_button.cpp index ccf6e53d66..ea388703e0 100644 --- a/esphome/components/tt21100/binary_sensor/tt21100_button.cpp +++ b/esphome/components/tt21100/binary_sensor/tt21100_button.cpp @@ -3,7 +3,7 @@ namespace esphome::tt21100 { -static const char *const TAG = "tt21100.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "tt21100.binary_sensor"); void TT21100Button::setup() { this->parent_->register_button_listener(this); diff --git a/esphome/components/tt21100/touchscreen/tt21100.cpp b/esphome/components/tt21100/touchscreen/tt21100.cpp index 018094df73..b850dbc696 100644 --- a/esphome/components/tt21100/touchscreen/tt21100.cpp +++ b/esphome/components/tt21100/touchscreen/tt21100.cpp @@ -3,7 +3,7 @@ namespace esphome::tt21100 { -static const char *const TAG = "tt21100"; +ESPHOME_LOG_TAG(TAG, "tt21100"); static const uint8_t MAX_BUTTONS = 4; static const uint8_t MAX_TOUCH_POINTS = 5; diff --git a/esphome/components/ttp229_bsf/ttp229_bsf.cpp b/esphome/components/ttp229_bsf/ttp229_bsf.cpp index 1c7fa3531f..807d736557 100644 --- a/esphome/components/ttp229_bsf/ttp229_bsf.cpp +++ b/esphome/components/ttp229_bsf/ttp229_bsf.cpp @@ -3,7 +3,7 @@ namespace esphome::ttp229_bsf { -static const char *const TAG = "ttp229_bsf"; +ESPHOME_LOG_TAG(TAG, "ttp229_bsf"); void TTP229BSFComponent::setup() { this->sdo_pin_->setup(); diff --git a/esphome/components/ttp229_lsf/ttp229_lsf.cpp b/esphome/components/ttp229_lsf/ttp229_lsf.cpp index eaef33d793..7ed06c6d6f 100644 --- a/esphome/components/ttp229_lsf/ttp229_lsf.cpp +++ b/esphome/components/ttp229_lsf/ttp229_lsf.cpp @@ -3,7 +3,7 @@ namespace esphome::ttp229_lsf { -static const char *const TAG = "ttp229_lsf"; +ESPHOME_LOG_TAG(TAG, "ttp229_lsf"); void TTP229LSFComponent::setup() { uint8_t data[2]; diff --git a/esphome/components/tuya/automation.cpp b/esphome/components/tuya/automation.cpp index 5c84f36b83..a7eacf8e9a 100644 --- a/esphome/components/tuya/automation.cpp +++ b/esphome/components/tuya/automation.cpp @@ -2,7 +2,7 @@ #include "automation.h" -static const char *const TAG = "tuya.automation"; +ESPHOME_LOG_TAG(TAG, "tuya.automation"); namespace esphome::tuya { diff --git a/esphome/components/tuya/binary_sensor/tuya_binary_sensor.cpp b/esphome/components/tuya/binary_sensor/tuya_binary_sensor.cpp index f93bd31b9d..9d0589305e 100644 --- a/esphome/components/tuya/binary_sensor/tuya_binary_sensor.cpp +++ b/esphome/components/tuya/binary_sensor/tuya_binary_sensor.cpp @@ -3,7 +3,7 @@ namespace esphome::tuya { -static const char *const TAG = "tuya.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "tuya.binary_sensor"); void TuyaBinarySensor::setup() { this->parent_->register_listener(this->sensor_id_, [this](const TuyaDatapoint &datapoint) { diff --git a/esphome/components/tuya/climate/tuya_climate.cpp b/esphome/components/tuya/climate/tuya_climate.cpp index 111d090c3e..e07806326c 100644 --- a/esphome/components/tuya/climate/tuya_climate.cpp +++ b/esphome/components/tuya/climate/tuya_climate.cpp @@ -3,7 +3,7 @@ namespace esphome::tuya { -static const char *const TAG = "tuya.climate"; +ESPHOME_LOG_TAG(TAG, "tuya.climate"); void TuyaClimate::setup() { auto switch_id = this->switch_id_; diff --git a/esphome/components/tuya/cover/tuya_cover.cpp b/esphome/components/tuya/cover/tuya_cover.cpp index dd268388d0..b23dde75db 100644 --- a/esphome/components/tuya/cover/tuya_cover.cpp +++ b/esphome/components/tuya/cover/tuya_cover.cpp @@ -9,7 +9,7 @@ const uint8_t COMMAND_STOP = 0x01; using namespace esphome::cover; -static const char *const TAG = "tuya.cover"; +ESPHOME_LOG_TAG(TAG, "tuya.cover"); void TuyaCover::setup() { this->value_range_ = this->max_value_ - this->min_value_; diff --git a/esphome/components/tuya/fan/tuya_fan.cpp b/esphome/components/tuya/fan/tuya_fan.cpp index 0b5fc19038..8e4694baed 100644 --- a/esphome/components/tuya/fan/tuya_fan.cpp +++ b/esphome/components/tuya/fan/tuya_fan.cpp @@ -3,7 +3,7 @@ namespace esphome::tuya { -static const char *const TAG = "tuya.fan"; +ESPHOME_LOG_TAG(TAG, "tuya.fan"); void TuyaFan::setup() { auto speed_id = this->speed_id_; diff --git a/esphome/components/tuya/light/tuya_light.cpp b/esphome/components/tuya/light/tuya_light.cpp index 32cbca9a39..4852e5ff44 100644 --- a/esphome/components/tuya/light/tuya_light.cpp +++ b/esphome/components/tuya/light/tuya_light.cpp @@ -4,7 +4,7 @@ namespace esphome::tuya { -static const char *const TAG = "tuya.light"; +ESPHOME_LOG_TAG(TAG, "tuya.light"); void TuyaLight::setup() { if (this->color_temperature_id_.has_value()) { diff --git a/esphome/components/tuya/number/tuya_number.cpp b/esphome/components/tuya/number/tuya_number.cpp index b0bbfce649..538021bca2 100644 --- a/esphome/components/tuya/number/tuya_number.cpp +++ b/esphome/components/tuya/number/tuya_number.cpp @@ -5,7 +5,7 @@ namespace esphome::tuya { -static const char *const TAG = "tuya.number"; +ESPHOME_LOG_TAG(TAG, "tuya.number"); void TuyaNumber::setup() { if (this->restore_value_) { diff --git a/esphome/components/tuya/select/tuya_select.cpp b/esphome/components/tuya/select/tuya_select.cpp index 057f7f8ea6..7c00c7c0f9 100644 --- a/esphome/components/tuya/select/tuya_select.cpp +++ b/esphome/components/tuya/select/tuya_select.cpp @@ -3,7 +3,7 @@ namespace esphome::tuya { -static const char *const TAG = "tuya.select"; +ESPHOME_LOG_TAG(TAG, "tuya.select"); void TuyaSelect::setup() { this->parent_->register_listener(this->select_id_, [this](const TuyaDatapoint &datapoint) { diff --git a/esphome/components/tuya/sensor/tuya_sensor.cpp b/esphome/components/tuya/sensor/tuya_sensor.cpp index c948984786..6b16d93080 100644 --- a/esphome/components/tuya/sensor/tuya_sensor.cpp +++ b/esphome/components/tuya/sensor/tuya_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::tuya { -static const char *const TAG = "tuya.sensor"; +ESPHOME_LOG_TAG(TAG, "tuya.sensor"); void TuyaSensor::setup() { this->parent_->register_listener(this->sensor_id_, [this](const TuyaDatapoint &datapoint) { diff --git a/esphome/components/tuya/switch/tuya_switch.cpp b/esphome/components/tuya/switch/tuya_switch.cpp index 8d4d183d5b..204ee84170 100644 --- a/esphome/components/tuya/switch/tuya_switch.cpp +++ b/esphome/components/tuya/switch/tuya_switch.cpp @@ -3,7 +3,7 @@ namespace esphome::tuya { -static const char *const TAG = "tuya.switch"; +ESPHOME_LOG_TAG(TAG, "tuya.switch"); void TuyaSwitch::setup() { this->parent_->register_listener(this->switch_id_, [this](const TuyaDatapoint &datapoint) { diff --git a/esphome/components/tuya/text_sensor/tuya_text_sensor.cpp b/esphome/components/tuya/text_sensor/tuya_text_sensor.cpp index ebb35cead7..2e64fb1dea 100644 --- a/esphome/components/tuya/text_sensor/tuya_text_sensor.cpp +++ b/esphome/components/tuya/text_sensor/tuya_text_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::tuya { -static const char *const TAG = "tuya.text_sensor"; +ESPHOME_LOG_TAG(TAG, "tuya.text_sensor"); void TuyaTextSensor::setup() { this->parent_->register_listener(this->sensor_id_, [this](const TuyaDatapoint &datapoint) { diff --git a/esphome/components/tuya/tuya.cpp b/esphome/components/tuya/tuya.cpp index f9b4fe2453..992dde1533 100644 --- a/esphome/components/tuya/tuya.cpp +++ b/esphome/components/tuya/tuya.cpp @@ -18,7 +18,7 @@ namespace esphome::tuya { -static const char *const TAG = "tuya"; +ESPHOME_LOG_TAG(TAG, "tuya"); static const int COMMAND_DELAY = 10; static const int RECEIVE_TIMEOUT = 300; static const int MAX_RETRIES = 5; diff --git a/esphome/components/tuya/water_heater/tuya_water_heater.cpp b/esphome/components/tuya/water_heater/tuya_water_heater.cpp index e1c78530e3..4ece2b0a03 100644 --- a/esphome/components/tuya/water_heater/tuya_water_heater.cpp +++ b/esphome/components/tuya/water_heater/tuya_water_heater.cpp @@ -3,7 +3,7 @@ namespace esphome::tuya { -static const char *const TAG = "tuya.water_heater"; +ESPHOME_LOG_TAG(TAG, "tuya.water_heater"); void TuyaWaterHeater::setup() { if (this->switch_id_.has_value()) { diff --git a/esphome/components/tx20/tx20.cpp b/esphome/components/tx20/tx20.cpp index 3574bd7c2d..ce4c20ede4 100644 --- a/esphome/components/tx20/tx20.cpp +++ b/esphome/components/tx20/tx20.cpp @@ -6,7 +6,7 @@ namespace esphome::tx20 { -static const char *const TAG = "tx20"; +ESPHOME_LOG_TAG(TAG, "tx20"); static const uint8_t MAX_BUFFER_SIZE = 41; static const uint16_t TX20_MAX_TIME = MAX_BUFFER_SIZE * 1200 + 5000; static const uint16_t TX20_BIT_TIME = 1200; diff --git a/esphome/components/uart/button/uart_button.cpp b/esphome/components/uart/button/uart_button.cpp index 809ceaabb0..b55207cb46 100644 --- a/esphome/components/uart/button/uart_button.cpp +++ b/esphome/components/uart/button/uart_button.cpp @@ -3,7 +3,7 @@ namespace esphome::uart { -static const char *const TAG = "uart.button"; +ESPHOME_LOG_TAG(TAG, "uart.button"); void UARTButton::press_action() { ESP_LOGD(TAG, "'%s': Sending data", this->get_name().c_str()); diff --git a/esphome/components/uart/event/uart_event.cpp b/esphome/components/uart/event/uart_event.cpp index 02c5f2e631..22bcee9c83 100644 --- a/esphome/components/uart/event/uart_event.cpp +++ b/esphome/components/uart/event/uart_event.cpp @@ -4,7 +4,7 @@ namespace esphome::uart { -static const char *const TAG = "uart.event"; +ESPHOME_LOG_TAG(TAG, "uart.event"); void UARTEvent::setup() {} diff --git a/esphome/components/uart/packet_transport/uart_transport.cpp b/esphome/components/uart/packet_transport/uart_transport.cpp index 6b8eae611c..215cdded99 100644 --- a/esphome/components/uart/packet_transport/uart_transport.cpp +++ b/esphome/components/uart/packet_transport/uart_transport.cpp @@ -4,7 +4,7 @@ namespace esphome::uart { -static const char *const TAG = "uart_transport"; +ESPHOME_LOG_TAG(TAG, "uart_transport"); void UARTTransport::loop() { PacketTransport::loop(); diff --git a/esphome/components/uart/switch/uart_switch.cpp b/esphome/components/uart/switch/uart_switch.cpp index 642bd19772..6b6aa273f7 100644 --- a/esphome/components/uart/switch/uart_switch.cpp +++ b/esphome/components/uart/switch/uart_switch.cpp @@ -4,7 +4,7 @@ namespace esphome::uart { -static const char *const TAG = "uart.switch"; +ESPHOME_LOG_TAG(TAG, "uart.switch"); void UARTSwitch::loop() { if (this->send_every_) { diff --git a/esphome/components/uart/uart.cpp b/esphome/components/uart/uart.cpp index 337fa352c1..20f6385b6a 100644 --- a/esphome/components/uart/uart.cpp +++ b/esphome/components/uart/uart.cpp @@ -8,7 +8,7 @@ namespace esphome::uart { -static const char *const TAG = "uart"; +ESPHOME_LOG_TAG(TAG, "uart"); // UART parity strings indexed by UARTParityOptions enum (0-2): NONE, EVEN, ODD PROGMEM_STRING_TABLE(UARTParityStrings, "NONE", "EVEN", "ODD", "UNKNOWN"); diff --git a/esphome/components/uart/uart_component.cpp b/esphome/components/uart/uart_component.cpp index 762e56c399..6516174635 100644 --- a/esphome/components/uart/uart_component.cpp +++ b/esphome/components/uart/uart_component.cpp @@ -2,7 +2,7 @@ namespace esphome::uart { -static const char *const TAG = "uart"; +ESPHOME_LOG_TAG(TAG, "uart"); bool UARTComponent::check_read_timeout_(size_t len) { if (this->available() >= len) diff --git a/esphome/components/uart/uart_component_esp8266.cpp b/esphome/components/uart/uart_component_esp8266.cpp index 0f6d7f6577..a32677b3da 100644 --- a/esphome/components/uart/uart_component_esp8266.cpp +++ b/esphome/components/uart/uart_component_esp8266.cpp @@ -15,7 +15,7 @@ namespace esphome::uart { -static const char *const TAG = "uart"; +ESPHOME_LOG_TAG(TAG, "uart"); bool ESP8266UartComponent::serial0_in_use = false; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) uint32_t ESP8266UartComponent::get_config() { diff --git a/esphome/components/uart/uart_component_esp_idf.cpp b/esphome/components/uart/uart_component_esp_idf.cpp index 5d90fc1c8a..41fae283b4 100644 --- a/esphome/components/uart/uart_component_esp_idf.cpp +++ b/esphome/components/uart/uart_component_esp_idf.cpp @@ -23,7 +23,7 @@ namespace esphome::uart { -static const char *const TAG = "uart"; +ESPHOME_LOG_TAG(TAG, "uart"); /// Check if a pin number matches one of the default UART0 GPIO pins. /// These pins may have residual IOMUX state from the ROM bootloader that diff --git a/esphome/components/uart/uart_component_host.cpp b/esphome/components/uart/uart_component_host.cpp index 63b5631564..9e2f273f47 100644 --- a/esphome/components/uart/uart_component_host.cpp +++ b/esphome/components/uart/uart_component_host.cpp @@ -98,7 +98,7 @@ speed_t get_baud(int baud) { namespace esphome::uart { -static const char *const TAG = "uart"; +ESPHOME_LOG_TAG(TAG, "uart"); HostUartComponent::~HostUartComponent() { if (this->file_descriptor_ != -1) { diff --git a/esphome/components/uart/uart_component_libretiny.cpp b/esphome/components/uart/uart_component_libretiny.cpp index 293cb9e786..5a77bf26d9 100644 --- a/esphome/components/uart/uart_component_libretiny.cpp +++ b/esphome/components/uart/uart_component_libretiny.cpp @@ -18,7 +18,7 @@ namespace esphome::uart { -static const char *const TAG = "uart"; +ESPHOME_LOG_TAG(TAG, "uart"); static const char *const UART_TYPE[] = { "hardware", diff --git a/esphome/components/uart/uart_component_rp2.cpp b/esphome/components/uart/uart_component_rp2.cpp index ffb9bc0f2d..07245bc230 100644 --- a/esphome/components/uart/uart_component_rp2.cpp +++ b/esphome/components/uart/uart_component_rp2.cpp @@ -13,7 +13,7 @@ namespace esphome::uart { -static const char *const TAG = "uart"; +ESPHOME_LOG_TAG(TAG, "uart"); uint16_t RP2UartComponent::get_config() { uint16_t config = 0; diff --git a/esphome/components/uart/uart_debugger.cpp b/esphome/components/uart/uart_debugger.cpp index e0be599d8d..53c6c0406a 100644 --- a/esphome/components/uart/uart_debugger.cpp +++ b/esphome/components/uart/uart_debugger.cpp @@ -8,7 +8,7 @@ namespace esphome::uart { -static const char *const TAG = "uart_debug"; +ESPHOME_LOG_TAG(TAG, "uart_debug"); UARTDebugger::UARTDebugger(UARTComponent *parent) { parent->add_debug_callback([this](UARTDirection direction, uint8_t byte) { diff --git a/esphome/components/uart_mux/uart_mux.cpp b/esphome/components/uart_mux/uart_mux.cpp index 953e81d533..11057ac078 100644 --- a/esphome/components/uart_mux/uart_mux.cpp +++ b/esphome/components/uart_mux/uart_mux.cpp @@ -4,7 +4,7 @@ namespace esphome::uart_mux { -static const char *const TAG = "uart_mux"; +ESPHOME_LOG_TAG(TAG, "uart_mux"); void UARTMux::setup() { // A failed UART never assigned its port; nothing behind the mux can work. diff --git a/esphome/components/uart_tcp/uart_tcp.cpp b/esphome/components/uart_tcp/uart_tcp.cpp index 4f241f8567..bc75eb04c7 100644 --- a/esphome/components/uart_tcp/uart_tcp.cpp +++ b/esphome/components/uart_tcp/uart_tcp.cpp @@ -9,7 +9,7 @@ namespace esphome::uart_tcp { -static const char *const TAG = "uart_tcp"; +ESPHOME_LOG_TAG(TAG, "uart_tcp"); // Keeps the pacing product in 32 bits up to about 10 Mbaud. static constexpr uint32_t MAX_PACE_SPAN_MS = 4000; diff --git a/esphome/components/udp/packet_transport/udp_transport.cpp b/esphome/components/udp/packet_transport/udp_transport.cpp index 40ce46d74e..2e49b676ce 100644 --- a/esphome/components/udp/packet_transport/udp_transport.cpp +++ b/esphome/components/udp/packet_transport/udp_transport.cpp @@ -5,7 +5,7 @@ namespace esphome::udp { -static const char *const TAG = "udp_transport"; +ESPHOME_LOG_TAG(TAG, "udp_transport"); bool UDPTransport::should_send() { return network::is_connected(); } void UDPTransport::setup() { diff --git a/esphome/components/udp/udp_component.cpp b/esphome/components/udp/udp_component.cpp index 904ed97dc0..3918ddc1fa 100644 --- a/esphome/components/udp/udp_component.cpp +++ b/esphome/components/udp/udp_component.cpp @@ -7,7 +7,7 @@ namespace esphome::udp { -static const char *const TAG = "udp"; +ESPHOME_LOG_TAG(TAG, "udp"); void UDPComponent::setup() { #if defined(USE_SOCKET_IMPL_BSD_SOCKETS) || defined(USE_SOCKET_IMPL_LWIP_SOCKETS) diff --git a/esphome/components/ufire_ec/ufire_ec.cpp b/esphome/components/ufire_ec/ufire_ec.cpp index 72bf837409..afa806d246 100644 --- a/esphome/components/ufire_ec/ufire_ec.cpp +++ b/esphome/components/ufire_ec/ufire_ec.cpp @@ -4,7 +4,7 @@ namespace esphome::ufire_ec { -static const char *const TAG = "ufire_ec"; +ESPHOME_LOG_TAG(TAG, "ufire_ec"); void UFireECComponent::setup() { uint8_t version; diff --git a/esphome/components/ufire_ise/ufire_ise.cpp b/esphome/components/ufire_ise/ufire_ise.cpp index d595b37a83..c0fa715485 100644 --- a/esphome/components/ufire_ise/ufire_ise.cpp +++ b/esphome/components/ufire_ise/ufire_ise.cpp @@ -5,7 +5,7 @@ namespace esphome::ufire_ise { -static const char *const TAG = "ufire_ise"; +ESPHOME_LOG_TAG(TAG, "ufire_ise"); void UFireISEComponent::setup() { uint8_t version; diff --git a/esphome/components/ufm01/ufm01.cpp b/esphome/components/ufm01/ufm01.cpp index fbacd84db0..cd4388372c 100644 --- a/esphome/components/ufm01/ufm01.cpp +++ b/esphome/components/ufm01/ufm01.cpp @@ -9,7 +9,7 @@ namespace esphome::ufm01 { -static const char *const TAG = "ufm01"; +ESPHOME_LOG_TAG(TAG, "ufm01"); static constexpr uint8_t COMMAND_ACK = 0xE5; static constexpr uint32_t COMMAND_ACK_TIMEOUT_MS = 500; diff --git a/esphome/components/uln2003/uln2003.cpp b/esphome/components/uln2003/uln2003.cpp index a2244eadaa..64db28a530 100644 --- a/esphome/components/uln2003/uln2003.cpp +++ b/esphome/components/uln2003/uln2003.cpp @@ -3,7 +3,7 @@ namespace esphome::uln2003 { -static const char *const TAG = "uln2003.stepper"; +ESPHOME_LOG_TAG(TAG, "uln2003.stepper"); static const LogString *step_mode_to_log_string(ULN2003StepMode mode) { switch (mode) { diff --git a/esphome/components/ultrasonic/ultrasonic_sensor.cpp b/esphome/components/ultrasonic/ultrasonic_sensor.cpp index a354b198b4..039d08eaae 100644 --- a/esphome/components/ultrasonic/ultrasonic_sensor.cpp +++ b/esphome/components/ultrasonic/ultrasonic_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::ultrasonic { -static const char *const TAG = "ultrasonic.sensor"; +ESPHOME_LOG_TAG(TAG, "ultrasonic.sensor"); static constexpr uint32_t DEBOUNCE_US = 50; // Ignore edges within 50us of each other (noise filtering) static constexpr uint32_t START_DELAY_US = 100; // Ignore edges within 100us of trigger (filters bleed-through) diff --git a/esphome/components/update/update_entity.cpp b/esphome/components/update/update_entity.cpp index b0d4c01cc9..33c33ccb62 100644 --- a/esphome/components/update/update_entity.cpp +++ b/esphome/components/update/update_entity.cpp @@ -6,7 +6,7 @@ namespace esphome::update { -static const char *const TAG = "update"; +ESPHOME_LOG_TAG(TAG, "update"); // Update state strings indexed by UpdateState enum (0-3): UNKNOWN, NO UPDATE, UPDATE AVAILABLE, INSTALLING PROGMEM_STRING_TABLE(UpdateStateStrings, "UNKNOWN", "NO UPDATE", "UPDATE AVAILABLE", "INSTALLING"); diff --git a/esphome/components/uponor_smatrix/climate/uponor_smatrix_climate.cpp b/esphome/components/uponor_smatrix/climate/uponor_smatrix_climate.cpp index 0400888511..7b6717c682 100644 --- a/esphome/components/uponor_smatrix/climate/uponor_smatrix_climate.cpp +++ b/esphome/components/uponor_smatrix/climate/uponor_smatrix_climate.cpp @@ -7,7 +7,7 @@ namespace esphome::uponor_smatrix { -static const char *const TAG = "uponor_smatrix.climate"; +ESPHOME_LOG_TAG(TAG, "uponor_smatrix.climate"); void UponorSmatrixClimate::dump_config() { LOG_CLIMATE("", "Uponor Smatrix Climate", this); diff --git a/esphome/components/uponor_smatrix/sensor/uponor_smatrix_sensor.cpp b/esphome/components/uponor_smatrix/sensor/uponor_smatrix_sensor.cpp index 97e9c27570..9b5f7df87a 100644 --- a/esphome/components/uponor_smatrix/sensor/uponor_smatrix_sensor.cpp +++ b/esphome/components/uponor_smatrix/sensor/uponor_smatrix_sensor.cpp @@ -5,7 +5,7 @@ namespace esphome::uponor_smatrix { -static const char *const TAG = "uponor_smatrix.sensor"; +ESPHOME_LOG_TAG(TAG, "uponor_smatrix.sensor"); void UponorSmatrixSensor::dump_config() { ESP_LOGCONFIG(TAG, diff --git a/esphome/components/uponor_smatrix/uponor_smatrix.cpp b/esphome/components/uponor_smatrix/uponor_smatrix.cpp index 74974548af..fd6eda73a0 100644 --- a/esphome/components/uponor_smatrix/uponor_smatrix.cpp +++ b/esphome/components/uponor_smatrix/uponor_smatrix.cpp @@ -7,7 +7,7 @@ namespace esphome::uponor_smatrix { -static const char *const TAG = "uponor_smatrix"; +ESPHOME_LOG_TAG(TAG, "uponor_smatrix"); // Maximum bytes to log in verbose hex output static constexpr size_t UPONOR_MAX_LOG_BYTES = 36; diff --git a/esphome/components/uptime/sensor/uptime_seconds_sensor.cpp b/esphome/components/uptime/sensor/uptime_seconds_sensor.cpp index 552e4e5da4..c5dbf742a1 100644 --- a/esphome/components/uptime/sensor/uptime_seconds_sensor.cpp +++ b/esphome/components/uptime/sensor/uptime_seconds_sensor.cpp @@ -5,7 +5,7 @@ namespace esphome::uptime { -static const char *const TAG = "uptime.sensor"; +ESPHOME_LOG_TAG(TAG, "uptime.sensor"); void UptimeSecondsSensor::update() { const uint64_t uptime = millis_64(); diff --git a/esphome/components/uptime/sensor/uptime_timestamp_sensor.cpp b/esphome/components/uptime/sensor/uptime_timestamp_sensor.cpp index e8b8a21562..43c8d1cf75 100644 --- a/esphome/components/uptime/sensor/uptime_timestamp_sensor.cpp +++ b/esphome/components/uptime/sensor/uptime_timestamp_sensor.cpp @@ -8,7 +8,7 @@ namespace esphome::uptime { -static const char *const TAG = "uptime.sensor"; +ESPHOME_LOG_TAG(TAG, "uptime.sensor"); void UptimeTimestampSensor::setup() { this->time_->add_on_time_sync_callback([this]() { diff --git a/esphome/components/uptime/text_sensor/uptime_text_sensor.cpp b/esphome/components/uptime/text_sensor/uptime_text_sensor.cpp index 7a56654804..33cde23b94 100644 --- a/esphome/components/uptime/text_sensor/uptime_text_sensor.cpp +++ b/esphome/components/uptime/text_sensor/uptime_text_sensor.cpp @@ -6,7 +6,7 @@ namespace esphome::uptime { -static const char *const TAG = "uptime.sensor"; +ESPHOME_LOG_TAG(TAG, "uptime.sensor"); static void append_unit(char *buf, size_t buf_size, size_t &pos, const char *separator, unsigned value, const char *label) { diff --git a/esphome/components/usb_cdc_acm/usb_cdc_acm.cpp b/esphome/components/usb_cdc_acm/usb_cdc_acm.cpp index 454c049da3..f24339b4bf 100644 --- a/esphome/components/usb_cdc_acm/usb_cdc_acm.cpp +++ b/esphome/components/usb_cdc_acm/usb_cdc_acm.cpp @@ -6,7 +6,7 @@ #include "esphome/core/log.h" namespace esphome::usb_cdc_acm { -static const char *const TAG = "usb_cdc_acm"; +ESPHOME_LOG_TAG(TAG, "usb_cdc_acm"); // Global component instance for managing USB device USBCDCACMComponent *global_usb_cdc_component = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/components/usb_cdc_acm/usb_cdc_acm_esp32.cpp b/esphome/components/usb_cdc_acm/usb_cdc_acm_esp32.cpp index 7aa7b46b7b..9ac94802e1 100644 --- a/esphome/components/usb_cdc_acm/usb_cdc_acm_esp32.cpp +++ b/esphome/components/usb_cdc_acm/usb_cdc_acm_esp32.cpp @@ -17,7 +17,7 @@ namespace esphome::usb_cdc_acm { -static const char *const TAG = "usb_cdc_acm"; +ESPHOME_LOG_TAG(TAG, "usb_cdc_acm"); // Maximum bytes to log in very verbose hex output (168 * 3 = 504, under TX buffer size of 512) static constexpr size_t USB_CDC_MAX_LOG_BYTES = 168; diff --git a/esphome/components/valve/valve.cpp b/esphome/components/valve/valve.cpp index d8fb18b1b7..a5ad9817df 100644 --- a/esphome/components/valve/valve.cpp +++ b/esphome/components/valve/valve.cpp @@ -8,7 +8,7 @@ namespace esphome::valve { -static const char *const TAG = "valve"; +ESPHOME_LOG_TAG(TAG, "valve"); const float VALVE_OPEN = 1.0f; const float VALVE_CLOSED = 0.0f; diff --git a/esphome/components/vbus/binary_sensor/vbus_binary_sensor.cpp b/esphome/components/vbus/binary_sensor/vbus_binary_sensor.cpp index ddb6b53068..60822c5283 100644 --- a/esphome/components/vbus/binary_sensor/vbus_binary_sensor.cpp +++ b/esphome/components/vbus/binary_sensor/vbus_binary_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::vbus { -static const char *const TAG = "vbus.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "vbus.binary_sensor"); void DeltaSolBSPlusBSensor::dump_config() { ESP_LOGCONFIG(TAG, "Deltasol BS Plus:"); diff --git a/esphome/components/vbus/sensor/vbus_sensor.cpp b/esphome/components/vbus/sensor/vbus_sensor.cpp index 773e1435e2..5c111c2294 100644 --- a/esphome/components/vbus/sensor/vbus_sensor.cpp +++ b/esphome/components/vbus/sensor/vbus_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::vbus { -static const char *const TAG = "vbus.sensor"; +ESPHOME_LOG_TAG(TAG, "vbus.sensor"); static inline uint16_t get_u16(std::vector &message, int start) { return (message[start + 1] << 8) + message[start]; diff --git a/esphome/components/vbus/vbus.cpp b/esphome/components/vbus/vbus.cpp index 080567e7f9..6b6a3393ee 100644 --- a/esphome/components/vbus/vbus.cpp +++ b/esphome/components/vbus/vbus.cpp @@ -6,7 +6,7 @@ namespace esphome::vbus { -static const char *const TAG = "vbus"; +ESPHOME_LOG_TAG(TAG, "vbus"); // Maximum bytes to log in verbose hex output (16 frames * 4 bytes = 64 bytes typical) static constexpr size_t VBUS_MAX_LOG_BYTES = 64; diff --git a/esphome/components/veml3235/veml3235.cpp b/esphome/components/veml3235/veml3235.cpp index b3170469b9..3d555bc469 100644 --- a/esphome/components/veml3235/veml3235.cpp +++ b/esphome/components/veml3235/veml3235.cpp @@ -4,7 +4,7 @@ namespace esphome::veml3235 { -static const char *const TAG = "veml3235.sensor"; +ESPHOME_LOG_TAG(TAG, "veml3235.sensor"); // ADC counts at or above this value (98% of full scale) are treated as clipped: the true light level cannot // be estimated from such a reading, so auto-gain restarts from minimum sensitivity instead diff --git a/esphome/components/veml7700/veml7700.cpp b/esphome/components/veml7700/veml7700.cpp index 6c609f4fe7..236b4bb2a9 100644 --- a/esphome/components/veml7700/veml7700.cpp +++ b/esphome/components/veml7700/veml7700.cpp @@ -5,7 +5,7 @@ namespace esphome::veml7700 { -static const char *const TAG = "veml7700"; +ESPHOME_LOG_TAG(TAG, "veml7700"); static const size_t VEML_REG_SIZE = 2; static float reduce_to_zero(float a, float b) { return (a > b) ? (a - b) : 0; } diff --git a/esphome/components/version/version_text_sensor.cpp b/esphome/components/version/version_text_sensor.cpp index 15e6b0d088..1be7920a4c 100644 --- a/esphome/components/version/version_text_sensor.cpp +++ b/esphome/components/version/version_text_sensor.cpp @@ -7,7 +7,7 @@ namespace esphome::version { -static const char *const TAG = "version.text_sensor"; +ESPHOME_LOG_TAG(TAG, "version.text_sensor"); void VersionTextSensor::setup() { static const char HASH_PREFIX[] PROGMEM = ESPHOME_VERSION " (config hash 0x"; diff --git a/esphome/components/vl53l0x/vl53l0x_sensor.cpp b/esphome/components/vl53l0x/vl53l0x_sensor.cpp index 49eb3d00a1..68cb98b053 100644 --- a/esphome/components/vl53l0x/vl53l0x_sensor.cpp +++ b/esphome/components/vl53l0x/vl53l0x_sensor.cpp @@ -14,7 +14,7 @@ namespace esphome::vl53l0x { -static const char *const TAG = "vl53l0x"; +ESPHOME_LOG_TAG(TAG, "vl53l0x"); std::list VL53L0XSensor::vl53_sensors; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) bool VL53L0XSensor::enable_pin_setup_complete = false; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/components/voice_assistant/voice_assistant.cpp b/esphome/components/voice_assistant/voice_assistant.cpp index dba9b925d0..e952308437 100644 --- a/esphome/components/voice_assistant/voice_assistant.cpp +++ b/esphome/components/voice_assistant/voice_assistant.cpp @@ -12,7 +12,7 @@ namespace esphome::voice_assistant { -static const char *const TAG = "voice_assistant"; +ESPHOME_LOG_TAG(TAG, "voice_assistant"); #ifdef SAMPLE_RATE_HZ #undef SAMPLE_RATE_HZ diff --git a/esphome/components/wake_on_lan/wake_on_lan.cpp b/esphome/components/wake_on_lan/wake_on_lan.cpp index fd94f56b75..52dfe98aad 100644 --- a/esphome/components/wake_on_lan/wake_on_lan.cpp +++ b/esphome/components/wake_on_lan/wake_on_lan.cpp @@ -6,7 +6,7 @@ namespace esphome::wake_on_lan { -static const char *const TAG = "wake_on_lan.button"; +ESPHOME_LOG_TAG(TAG, "wake_on_lan.button"); static const uint8_t PREFIX[6] = {255, 255, 255, 255, 255, 255}; void WakeOnLanButton::set_macaddr(uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f) { diff --git a/esphome/components/watchdog/watchdog.cpp b/esphome/components/watchdog/watchdog.cpp index 2063faeb91..61c0baf686 100644 --- a/esphome/components/watchdog/watchdog.cpp +++ b/esphome/components/watchdog/watchdog.cpp @@ -16,7 +16,7 @@ namespace esphome::watchdog { -static const char *const TAG = "http_request.watchdog"; +ESPHOME_LOG_TAG(TAG, "http_request.watchdog"); WatchdogManager::WatchdogManager(uint32_t timeout_ms) : timeout_ms_(timeout_ms) { if (timeout_ms == 0) { diff --git a/esphome/components/water_heater/water_heater.cpp b/esphome/components/water_heater/water_heater.cpp index 4b65e907de..e5236a0491 100644 --- a/esphome/components/water_heater/water_heater.cpp +++ b/esphome/components/water_heater/water_heater.cpp @@ -11,7 +11,7 @@ namespace esphome::water_heater { -static const char *const TAG = "water_heater"; +ESPHOME_LOG_TAG(TAG, "water_heater"); void log_water_heater(const char *tag, const char *prefix, const char *type, WaterHeater *obj) { if (obj != nullptr) { diff --git a/esphome/components/waveshare_io_ch32v003/output/waveshare_io_ch32v003_output.cpp b/esphome/components/waveshare_io_ch32v003/output/waveshare_io_ch32v003_output.cpp index 30458310ce..cef569b905 100644 --- a/esphome/components/waveshare_io_ch32v003/output/waveshare_io_ch32v003_output.cpp +++ b/esphome/components/waveshare_io_ch32v003/output/waveshare_io_ch32v003_output.cpp @@ -4,7 +4,7 @@ namespace esphome::waveshare_io_ch32v003 { -static const char *const TAG = "waveshare_io_ch32v003.output"; +ESPHOME_LOG_TAG(TAG, "waveshare_io_ch32v003.output"); void WaveshareIOCH32V003Output::write_state(float state) { uint8_t pwm_value = static_cast(state * 255.0f); diff --git a/esphome/components/waveshare_io_ch32v003/sensor/waveshare_io_ch32v003_sensor.cpp b/esphome/components/waveshare_io_ch32v003/sensor/waveshare_io_ch32v003_sensor.cpp index 82da7451f9..71cb9ba79f 100644 --- a/esphome/components/waveshare_io_ch32v003/sensor/waveshare_io_ch32v003_sensor.cpp +++ b/esphome/components/waveshare_io_ch32v003/sensor/waveshare_io_ch32v003_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::waveshare_io_ch32v003 { -static const char *const TAG = "waveshare_io_ch32v003.sensor"; +ESPHOME_LOG_TAG(TAG, "waveshare_io_ch32v003.sensor"); float WaveshareIOCH32V003Sensor::get_setup_priority() const { return setup_priority::DATA; } diff --git a/esphome/components/waveshare_io_ch32v003/waveshare_io_ch32v003.cpp b/esphome/components/waveshare_io_ch32v003/waveshare_io_ch32v003.cpp index 8a58c7e7bb..159390086f 100644 --- a/esphome/components/waveshare_io_ch32v003/waveshare_io_ch32v003.cpp +++ b/esphome/components/waveshare_io_ch32v003/waveshare_io_ch32v003.cpp @@ -10,7 +10,7 @@ static const uint8_t IO_EXTENSION_PWM_ADDR = 0x05; static const uint8_t IO_EXTENSION_ADC_ADDR = 0x06; static const uint8_t IO_EXTENSION_RTC_INT_ADDR = 0x07; -static const char *const TAG = "waveshare_io_ch32v003"; +ESPHOME_LOG_TAG(TAG, "waveshare_io_ch32v003"); void WaveshareIOCH32V003Component::setup() { this->mode_mask_ = 0xFF; // Set all pins to output mode diff --git a/esphome/components/web_server/ota/ota_web_server.cpp b/esphome/components/web_server/ota/ota_web_server.cpp index 95763e2daf..3cf1d9802e 100644 --- a/esphome/components/web_server/ota/ota_web_server.cpp +++ b/esphome/components/web_server/ota/ota_web_server.cpp @@ -23,7 +23,7 @@ using PlatformString = String; namespace esphome::web_server { -static const char *const TAG = "web_server.ota"; +ESPHOME_LOG_TAG(TAG, "web_server.ota"); class OTARequestHandler : public AsyncWebHandler { public: diff --git a/esphome/components/web_server/web_server.cpp b/esphome/components/web_server/web_server.cpp index fde86502d4..062007b02e 100644 --- a/esphome/components/web_server/web_server.cpp +++ b/esphome/components/web_server/web_server.cpp @@ -55,7 +55,7 @@ namespace esphome::web_server { -static const char *const TAG = "web_server"; +ESPHOME_LOG_TAG(TAG, "web_server"); // View a state LogString as a ProgmemStr so ArduinoJson serializes it PROGMEM-aware on ESP8266. [[maybe_unused]] static ProgmemStr json_state_str(const LogString *s) { return reinterpret_cast(s); } diff --git a/esphome/components/web_server_idf/multipart.cpp b/esphome/components/web_server_idf/multipart.cpp index 7744272a5c..3b0da4fb56 100644 --- a/esphome/components/web_server_idf/multipart.cpp +++ b/esphome/components/web_server_idf/multipart.cpp @@ -8,7 +8,7 @@ namespace esphome::web_server_idf { -static const char *const TAG = "multipart"; +ESPHOME_LOG_TAG(TAG, "multipart"); // ========== MultipartReader Implementation ========== diff --git a/esphome/components/web_server_idf/web_server_idf.cpp b/esphome/components/web_server_idf/web_server_idf.cpp index a35ad65214..9a6e419e43 100644 --- a/esphome/components/web_server_idf/web_server_idf.cpp +++ b/esphome/components/web_server_idf/web_server_idf.cpp @@ -55,7 +55,7 @@ namespace esphome::web_server_idf { #define CRLF_STR "\r\n" #define CRLF_LEN (sizeof(CRLF_STR) - 1) -static const char *const TAG = "web_server_idf"; +ESPHOME_LOG_TAG(TAG, "web_server_idf"); // Only send_json_() may hold the JSON arena: every other frame in this file is capped below one // arena. Measured at -Os on GCC 14; newer toolchains stay checked on purpose, older ones skip it. diff --git a/esphome/components/weikai/weikai.cpp b/esphome/components/weikai/weikai.cpp index b95d474fd3..2576856e2f 100644 --- a/esphome/components/weikai/weikai.cpp +++ b/esphome/components/weikai/weikai.cpp @@ -8,7 +8,7 @@ namespace esphome::weikai { -static const char *const TAG = "weikai"; +ESPHOME_LOG_TAG(TAG, "weikai"); /// @brief measure the time elapsed between two calls /// @param last_time time of the previous call diff --git a/esphome/components/weikai_i2c/weikai_i2c.cpp b/esphome/components/weikai_i2c/weikai_i2c.cpp index af5bd7f313..bafa6c4e03 100644 --- a/esphome/components/weikai_i2c/weikai_i2c.cpp +++ b/esphome/components/weikai_i2c/weikai_i2c.cpp @@ -6,7 +6,7 @@ #include "weikai_i2c.h" namespace esphome::weikai_i2c { -static const char *const TAG = "weikai_i2c"; +ESPHOME_LOG_TAG(TAG, "weikai_i2c"); /// @brief Display a buffer in hexadecimal format (32 hex values / line). void print_buffer(const uint8_t *data, size_t length) { diff --git a/esphome/components/weikai_spi/weikai_spi.cpp b/esphome/components/weikai_spi/weikai_spi.cpp index 03bf66e07b..6a44fad6f3 100644 --- a/esphome/components/weikai_spi/weikai_spi.cpp +++ b/esphome/components/weikai_spi/weikai_spi.cpp @@ -7,7 +7,7 @@ namespace esphome::weikai_spi { using namespace weikai; -static const char *const TAG = "weikai_spi"; +ESPHOME_LOG_TAG(TAG, "weikai_spi"); /// @brief measure the time elapsed between two calls /// @param last_time time of the previous call diff --git a/esphome/components/whirlpool/whirlpool.cpp b/esphome/components/whirlpool/whirlpool.cpp index f560917f41..73fab843fc 100644 --- a/esphome/components/whirlpool/whirlpool.cpp +++ b/esphome/components/whirlpool/whirlpool.cpp @@ -3,7 +3,7 @@ namespace esphome::whirlpool { -static const char *const TAG = "whirlpool.climate"; +ESPHOME_LOG_TAG(TAG, "whirlpool.climate"); const uint16_t WHIRLPOOL_HEADER_MARK = 9000; const uint16_t WHIRLPOOL_HEADER_SPACE = 4494; diff --git a/esphome/components/whynter/whynter.cpp b/esphome/components/whynter/whynter.cpp index f5f304aa17..5aee703feb 100644 --- a/esphome/components/whynter/whynter.cpp +++ b/esphome/components/whynter/whynter.cpp @@ -3,7 +3,7 @@ namespace esphome::whynter { -static const char *const TAG = "climate.whynter"; +ESPHOME_LOG_TAG(TAG, "climate.whynter"); const uint16_t BITS = 32; diff --git a/esphome/components/wiegand/wiegand.cpp b/esphome/components/wiegand/wiegand.cpp index df64cd48aa..4f576e4c9d 100644 --- a/esphome/components/wiegand/wiegand.cpp +++ b/esphome/components/wiegand/wiegand.cpp @@ -5,7 +5,7 @@ namespace esphome::wiegand { -static const char *const TAG = "wiegand"; +ESPHOME_LOG_TAG(TAG, "wiegand"); static const char *const KEYS = "0123456789*#"; void IRAM_ATTR HOT WiegandStore::d0_gpio_intr(WiegandStore *arg) { diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index fd982c0d31..ef8b22d239 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -51,7 +51,7 @@ namespace esphome::wifi { -static const char *const TAG = "wifi"; +ESPHOME_LOG_TAG(TAG, "wifi"); // CompactString implementation CompactString::CompactString(const char *str, size_t len) { diff --git a/esphome/components/wifi/wifi_component_esp8266.cpp b/esphome/components/wifi/wifi_component_esp8266.cpp index aa1fa67b7b..41b5146000 100644 --- a/esphome/components/wifi/wifi_component_esp8266.cpp +++ b/esphome/components/wifi/wifi_component_esp8266.cpp @@ -40,7 +40,7 @@ extern "C" { namespace esphome::wifi { -static const char *const TAG = "wifi_esp8266"; +ESPHOME_LOG_TAG(TAG, "wifi_esp8266"); enum class ESP8266WiFiSTAState : uint8_t { IDLE, // Not connecting diff --git a/esphome/components/wifi/wifi_component_esp_idf.cpp b/esphome/components/wifi/wifi_component_esp_idf.cpp index c44ee5b1de..3769e26831 100644 --- a/esphome/components/wifi/wifi_component_esp_idf.cpp +++ b/esphome/components/wifi/wifi_component_esp_idf.cpp @@ -44,7 +44,7 @@ namespace esphome::wifi { -static const char *const TAG = "wifi_esp32"; +ESPHOME_LOG_TAG(TAG, "wifi_esp32"); static EventGroupHandle_t s_wifi_event_group; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) static esp_netif_t *s_sta_netif = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/components/wifi/wifi_component_libretiny.cpp b/esphome/components/wifi/wifi_component_libretiny.cpp index 28b30628fd..2a9e682440 100644 --- a/esphome/components/wifi/wifi_component_libretiny.cpp +++ b/esphome/components/wifi/wifi_component_libretiny.cpp @@ -52,7 +52,7 @@ extern "C" int __wrap_wifi_sta_connect(wifi_sta_connect_t *connect, wifi_scan_cf namespace esphome::wifi { -static const char *const TAG = "wifi_lt"; +ESPHOME_LOG_TAG(TAG, "wifi_lt"); // Thread-safe event handling for LibreTiny WiFi // diff --git a/esphome/components/wifi/wifi_component_pico_w.cpp b/esphome/components/wifi/wifi_component_pico_w.cpp index 325bcf2652..5b05132f4f 100644 --- a/esphome/components/wifi/wifi_component_pico_w.cpp +++ b/esphome/components/wifi/wifi_component_pico_w.cpp @@ -18,7 +18,7 @@ namespace esphome::wifi { -static const char *const TAG = "wifi_pico_w"; +ESPHOME_LOG_TAG(TAG, "wifi_pico_w"); // Check if STA is fully connected (WiFi joined + has IP address). // Do NOT use WiFi.status() or WiFi.connected() for this — in AP-only mode they diff --git a/esphome/components/wifi_info/wifi_info_text_sensor.cpp b/esphome/components/wifi_info/wifi_info_text_sensor.cpp index 5d4e77eaad..98b0cc4814 100644 --- a/esphome/components/wifi_info/wifi_info_text_sensor.cpp +++ b/esphome/components/wifi_info/wifi_info_text_sensor.cpp @@ -9,7 +9,7 @@ namespace esphome::wifi_info { -static const char *const TAG = "wifi_info"; +ESPHOME_LOG_TAG(TAG, "wifi_info"); #ifdef USE_WIFI_IP_STATE_LISTENERS diff --git a/esphome/components/wifi_signal/wifi_signal_sensor.cpp b/esphome/components/wifi_signal/wifi_signal_sensor.cpp index 11d816a909..57cbf9ae9b 100644 --- a/esphome/components/wifi_signal/wifi_signal_sensor.cpp +++ b/esphome/components/wifi_signal/wifi_signal_sensor.cpp @@ -4,7 +4,7 @@ namespace esphome::wifi_signal { -static const char *const TAG = "wifi_signal.sensor"; +ESPHOME_LOG_TAG(TAG, "wifi_signal.sensor"); void WiFiSignalSensor::dump_config() { LOG_SENSOR("", "WiFi Signal", this); } diff --git a/esphome/components/wireguard/wireguard.cpp b/esphome/components/wireguard/wireguard.cpp index 1fd610f4e8..73e34b6592 100644 --- a/esphome/components/wireguard/wireguard.cpp +++ b/esphome/components/wireguard/wireguard.cpp @@ -14,7 +14,7 @@ namespace esphome::wireguard { -static const char *const TAG = "wireguard"; +ESPHOME_LOG_TAG(TAG, "wireguard"); /* * Cannot use `static const char*` for LOGMSG_PEER_STATUS on esp8266 platform diff --git a/esphome/components/wl_134/wl_134.cpp b/esphome/components/wl_134/wl_134.cpp index 858f974f2b..745f9ea3e6 100644 --- a/esphome/components/wl_134/wl_134.cpp +++ b/esphome/components/wl_134/wl_134.cpp @@ -6,7 +6,7 @@ namespace esphome::wl_134 { -static const char *const TAG = "wl_134.sensor"; +ESPHOME_LOG_TAG(TAG, "wl_134.sensor"); static const uint8_t ASCII_CR = 0x0D; static const uint8_t ASCII_NBSP = 0xFF; static const int MAX_DATA_LENGTH_BYTES = 6; diff --git a/esphome/components/wled/wled_light_effect.cpp b/esphome/components/wled/wled_light_effect.cpp index 5150cda2a5..da0accc9a9 100644 --- a/esphome/components/wled/wled_light_effect.cpp +++ b/esphome/components/wled/wled_light_effect.cpp @@ -25,7 +25,7 @@ enum Protocol { WLED_NOTIFIER = 0, WARLS = 1, DRGB = 2, DRGBW = 3, DNRGB = 4 }; constexpr uint32_t DEFAULT_BLANK_TIME = 1000; -static const char *const TAG = "wled_light_effect"; +ESPHOME_LOG_TAG(TAG, "wled_light_effect"); WLEDLightEffect::WLEDLightEffect(const char *name) : AddressableLightEffect(name) {} diff --git a/esphome/components/wts01/wts01.cpp b/esphome/components/wts01/wts01.cpp index cc7ee98079..2888fc0abb 100644 --- a/esphome/components/wts01/wts01.cpp +++ b/esphome/components/wts01/wts01.cpp @@ -9,7 +9,7 @@ constexpr uint8_t HEADER_2 = 0x01; constexpr uint8_t HEADER_3 = 0x01; constexpr uint8_t HEADER_4 = 0x04; -static const char *const TAG = "wts01"; +ESPHOME_LOG_TAG(TAG, "wts01"); void WTS01Sensor::loop() { // Process all available data at once diff --git a/esphome/components/x9c/x9c.cpp b/esphome/components/x9c/x9c.cpp index b0ad79e51c..a9e9e9cdae 100644 --- a/esphome/components/x9c/x9c.cpp +++ b/esphome/components/x9c/x9c.cpp @@ -3,7 +3,7 @@ namespace esphome::x9c { -static const char *const TAG = "x9c.output"; +ESPHOME_LOG_TAG(TAG, "x9c.output"); void X9cOutput::trim_value(int32_t change_amount) { if (change_amount == 0) { diff --git a/esphome/components/xdb401/xdb401.cpp b/esphome/components/xdb401/xdb401.cpp index 6deab23828..5539a1318f 100644 --- a/esphome/components/xdb401/xdb401.cpp +++ b/esphome/components/xdb401/xdb401.cpp @@ -4,7 +4,7 @@ namespace esphome::xdb401 { -static const char *const TAG = "xdb401"; +ESPHOME_LOG_TAG(TAG, "xdb401"); static const uint8_t REG_PRESSURE = 0x06; static const uint8_t REG_TEMPERATURE = 0x09; diff --git a/esphome/components/xgzp68xx/xgzp68xx.cpp b/esphome/components/xgzp68xx/xgzp68xx.cpp index 0eefd594d0..35e1ed950b 100644 --- a/esphome/components/xgzp68xx/xgzp68xx.cpp +++ b/esphome/components/xgzp68xx/xgzp68xx.cpp @@ -8,7 +8,7 @@ namespace esphome::xgzp68xx { -static const char *const TAG = "xgzp68xx.sensor"; +ESPHOME_LOG_TAG(TAG, "xgzp68xx.sensor"); static const uint8_t CMD_ADDRESS = 0x30; static const uint8_t SYSCONFIG_ADDRESS = 0xA5; diff --git a/esphome/components/xiaomi_ble/xiaomi_ble.cpp b/esphome/components/xiaomi_ble/xiaomi_ble.cpp index 06c3a7ab7a..57f26b6acc 100644 --- a/esphome/components/xiaomi_ble/xiaomi_ble.cpp +++ b/esphome/components/xiaomi_ble/xiaomi_ble.cpp @@ -21,7 +21,7 @@ namespace esphome::xiaomi_ble { -static const char *const TAG = "xiaomi_ble"; +ESPHOME_LOG_TAG(TAG, "xiaomi_ble"); // Maximum bytes to log in very verbose hex output (covers largest packet of ~24 bytes) static constexpr size_t XIAOMI_MAX_LOG_BYTES = 32; diff --git a/esphome/components/xiaomi_body_scale/xiaomi_body_scale.cpp b/esphome/components/xiaomi_body_scale/xiaomi_body_scale.cpp index 7f9cd17d1f..b59c662e80 100644 --- a/esphome/components/xiaomi_body_scale/xiaomi_body_scale.cpp +++ b/esphome/components/xiaomi_body_scale/xiaomi_body_scale.cpp @@ -7,7 +7,7 @@ namespace esphome::xiaomi_body_scale { -static const char *const TAG = "xiaomi_body_scale"; +ESPHOME_LOG_TAG(TAG, "xiaomi_body_scale"); // Encrypted MiBeacon frame without a MAC: frame control, device id, frame count, cipher, counter, tag static constexpr size_t DEVICE_ID_POS = 2; diff --git a/esphome/components/xiaomi_cgd1/xiaomi_cgd1.cpp b/esphome/components/xiaomi_cgd1/xiaomi_cgd1.cpp index 0159314f4d..d64e66e660 100644 --- a/esphome/components/xiaomi_cgd1/xiaomi_cgd1.cpp +++ b/esphome/components/xiaomi_cgd1/xiaomi_cgd1.cpp @@ -4,7 +4,7 @@ namespace esphome::xiaomi_cgd1 { -static const char *const TAG = "xiaomi_cgd1"; +ESPHOME_LOG_TAG(TAG, "xiaomi_cgd1"); static constexpr size_t CGD1_BINDKEY_SIZE = 16; diff --git a/esphome/components/xiaomi_cgdk2/xiaomi_cgdk2.cpp b/esphome/components/xiaomi_cgdk2/xiaomi_cgdk2.cpp index 01912c3778..7ac6d50e16 100644 --- a/esphome/components/xiaomi_cgdk2/xiaomi_cgdk2.cpp +++ b/esphome/components/xiaomi_cgdk2/xiaomi_cgdk2.cpp @@ -4,7 +4,7 @@ namespace esphome::xiaomi_cgdk2 { -static const char *const TAG = "xiaomi_cgdk2"; +ESPHOME_LOG_TAG(TAG, "xiaomi_cgdk2"); static constexpr size_t CGDK2_BINDKEY_SIZE = 16; diff --git a/esphome/components/xiaomi_cgg1/xiaomi_cgg1.cpp b/esphome/components/xiaomi_cgg1/xiaomi_cgg1.cpp index 679cb76198..64207868b7 100644 --- a/esphome/components/xiaomi_cgg1/xiaomi_cgg1.cpp +++ b/esphome/components/xiaomi_cgg1/xiaomi_cgg1.cpp @@ -4,7 +4,7 @@ namespace esphome::xiaomi_cgg1 { -static const char *const TAG = "xiaomi_cgg1"; +ESPHOME_LOG_TAG(TAG, "xiaomi_cgg1"); static constexpr size_t CGG1_BINDKEY_SIZE = 16; diff --git a/esphome/components/xiaomi_cgpr1/xiaomi_cgpr1.cpp b/esphome/components/xiaomi_cgpr1/xiaomi_cgpr1.cpp index 019de54ad8..1515e43dea 100644 --- a/esphome/components/xiaomi_cgpr1/xiaomi_cgpr1.cpp +++ b/esphome/components/xiaomi_cgpr1/xiaomi_cgpr1.cpp @@ -4,7 +4,7 @@ namespace esphome::xiaomi_cgpr1 { -static const char *const TAG = "xiaomi_cgpr1"; +ESPHOME_LOG_TAG(TAG, "xiaomi_cgpr1"); void XiaomiCGPR1::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi CGPR1"); diff --git a/esphome/components/xiaomi_gcls002/xiaomi_gcls002.cpp b/esphome/components/xiaomi_gcls002/xiaomi_gcls002.cpp index 27effd64bb..11cb3a98d3 100644 --- a/esphome/components/xiaomi_gcls002/xiaomi_gcls002.cpp +++ b/esphome/components/xiaomi_gcls002/xiaomi_gcls002.cpp @@ -3,7 +3,7 @@ namespace esphome::xiaomi_gcls002 { -static const char *const TAG = "xiaomi_gcls002"; +ESPHOME_LOG_TAG(TAG, "xiaomi_gcls002"); void XiaomiGCLS002::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi GCLS002"); diff --git a/esphome/components/xiaomi_hhccjcy01/xiaomi_hhccjcy01.cpp b/esphome/components/xiaomi_hhccjcy01/xiaomi_hhccjcy01.cpp index 5e2369a6d9..80de9a6cbc 100644 --- a/esphome/components/xiaomi_hhccjcy01/xiaomi_hhccjcy01.cpp +++ b/esphome/components/xiaomi_hhccjcy01/xiaomi_hhccjcy01.cpp @@ -3,7 +3,7 @@ namespace esphome::xiaomi_hhccjcy01 { -static const char *const TAG = "xiaomi_hhccjcy01"; +ESPHOME_LOG_TAG(TAG, "xiaomi_hhccjcy01"); void XiaomiHHCCJCY01::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi HHCCJCY01"); diff --git a/esphome/components/xiaomi_hhccjcy10/xiaomi_hhccjcy10.cpp b/esphome/components/xiaomi_hhccjcy10/xiaomi_hhccjcy10.cpp index 680eb04e77..ac1541c386 100644 --- a/esphome/components/xiaomi_hhccjcy10/xiaomi_hhccjcy10.cpp +++ b/esphome/components/xiaomi_hhccjcy10/xiaomi_hhccjcy10.cpp @@ -4,7 +4,7 @@ namespace esphome::xiaomi_hhccjcy10 { -static const char *const TAG = "xiaomi_hhccjcy10"; +ESPHOME_LOG_TAG(TAG, "xiaomi_hhccjcy10"); void XiaomiHHCCJCY10::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi HHCCJCY10"); diff --git a/esphome/components/xiaomi_hhccpot002/xiaomi_hhccpot002.cpp b/esphome/components/xiaomi_hhccpot002/xiaomi_hhccpot002.cpp index fc8d15228d..f502cb1f66 100644 --- a/esphome/components/xiaomi_hhccpot002/xiaomi_hhccpot002.cpp +++ b/esphome/components/xiaomi_hhccpot002/xiaomi_hhccpot002.cpp @@ -3,7 +3,7 @@ namespace esphome::xiaomi_hhccpot002 { -static const char *const TAG = "xiaomi_hhccpot002"; +ESPHOME_LOG_TAG(TAG, "xiaomi_hhccpot002"); void XiaomiHHCCPOT002 ::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi HHCCPOT002"); diff --git a/esphome/components/xiaomi_jqjcy01ym/xiaomi_jqjcy01ym.cpp b/esphome/components/xiaomi_jqjcy01ym/xiaomi_jqjcy01ym.cpp index f7a1318d7c..ad2383f107 100644 --- a/esphome/components/xiaomi_jqjcy01ym/xiaomi_jqjcy01ym.cpp +++ b/esphome/components/xiaomi_jqjcy01ym/xiaomi_jqjcy01ym.cpp @@ -3,7 +3,7 @@ namespace esphome::xiaomi_jqjcy01ym { -static const char *const TAG = "xiaomi_jqjcy01ym"; +ESPHOME_LOG_TAG(TAG, "xiaomi_jqjcy01ym"); void XiaomiJQJCY01YM::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi JQJCY01YM"); diff --git a/esphome/components/xiaomi_lywsd02/xiaomi_lywsd02.cpp b/esphome/components/xiaomi_lywsd02/xiaomi_lywsd02.cpp index d465f2fec0..0762d97eb0 100644 --- a/esphome/components/xiaomi_lywsd02/xiaomi_lywsd02.cpp +++ b/esphome/components/xiaomi_lywsd02/xiaomi_lywsd02.cpp @@ -3,7 +3,7 @@ namespace esphome::xiaomi_lywsd02 { -static const char *const TAG = "xiaomi_lywsd02"; +ESPHOME_LOG_TAG(TAG, "xiaomi_lywsd02"); void XiaomiLYWSD02::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi LYWSD02"); diff --git a/esphome/components/xiaomi_lywsd02mmc/xiaomi_lywsd02mmc.cpp b/esphome/components/xiaomi_lywsd02mmc/xiaomi_lywsd02mmc.cpp index dca5f73909..15d9f32bd5 100644 --- a/esphome/components/xiaomi_lywsd02mmc/xiaomi_lywsd02mmc.cpp +++ b/esphome/components/xiaomi_lywsd02mmc/xiaomi_lywsd02mmc.cpp @@ -4,7 +4,7 @@ namespace esphome::xiaomi_lywsd02mmc { -static const char *const TAG = "xiaomi_lywsd02mmc"; +ESPHOME_LOG_TAG(TAG, "xiaomi_lywsd02mmc"); static constexpr size_t LYWSD02MMC_BINDKEY_SIZE = 16; diff --git a/esphome/components/xiaomi_lywsd03mmc/xiaomi_lywsd03mmc.cpp b/esphome/components/xiaomi_lywsd03mmc/xiaomi_lywsd03mmc.cpp index 356a4ffd4e..3bf8b7328b 100644 --- a/esphome/components/xiaomi_lywsd03mmc/xiaomi_lywsd03mmc.cpp +++ b/esphome/components/xiaomi_lywsd03mmc/xiaomi_lywsd03mmc.cpp @@ -4,7 +4,7 @@ namespace esphome::xiaomi_lywsd03mmc { -static const char *const TAG = "xiaomi_lywsd03mmc"; +ESPHOME_LOG_TAG(TAG, "xiaomi_lywsd03mmc"); static constexpr size_t LYWSD03MMC_BINDKEY_SIZE = 16; diff --git a/esphome/components/xiaomi_lywsdcgq/xiaomi_lywsdcgq.cpp b/esphome/components/xiaomi_lywsdcgq/xiaomi_lywsdcgq.cpp index 1ddf7ec235..1c56ed34f6 100644 --- a/esphome/components/xiaomi_lywsdcgq/xiaomi_lywsdcgq.cpp +++ b/esphome/components/xiaomi_lywsdcgq/xiaomi_lywsdcgq.cpp @@ -3,7 +3,7 @@ namespace esphome::xiaomi_lywsdcgq { -static const char *const TAG = "xiaomi_lywsdcgq"; +ESPHOME_LOG_TAG(TAG, "xiaomi_lywsdcgq"); void XiaomiLYWSDCGQ::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi LYWSDCGQ"); diff --git a/esphome/components/xiaomi_mccgq02hl/xiaomi_mccgq02hl.cpp b/esphome/components/xiaomi_mccgq02hl/xiaomi_mccgq02hl.cpp index 88b9865e47..519358270d 100644 --- a/esphome/components/xiaomi_mccgq02hl/xiaomi_mccgq02hl.cpp +++ b/esphome/components/xiaomi_mccgq02hl/xiaomi_mccgq02hl.cpp @@ -7,7 +7,7 @@ namespace esphome::xiaomi_mccgq02hl { -static const char *const TAG = "xiaomi_mccgq02hl"; +ESPHOME_LOG_TAG(TAG, "xiaomi_mccgq02hl"); static constexpr uint16_t PRODUCT_ID = 0x098b; diff --git a/esphome/components/xiaomi_mhoc303/xiaomi_mhoc303.cpp b/esphome/components/xiaomi_mhoc303/xiaomi_mhoc303.cpp index 9706e50861..23f20f380a 100644 --- a/esphome/components/xiaomi_mhoc303/xiaomi_mhoc303.cpp +++ b/esphome/components/xiaomi_mhoc303/xiaomi_mhoc303.cpp @@ -3,7 +3,7 @@ namespace esphome::xiaomi_mhoc303 { -static const char *const TAG = "xiaomi_mhoc303"; +ESPHOME_LOG_TAG(TAG, "xiaomi_mhoc303"); void XiaomiMHOC303::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi MHOC303"); diff --git a/esphome/components/xiaomi_mhoc401/xiaomi_mhoc401.cpp b/esphome/components/xiaomi_mhoc401/xiaomi_mhoc401.cpp index d725978418..97266c86e7 100644 --- a/esphome/components/xiaomi_mhoc401/xiaomi_mhoc401.cpp +++ b/esphome/components/xiaomi_mhoc401/xiaomi_mhoc401.cpp @@ -4,7 +4,7 @@ namespace esphome::xiaomi_mhoc401 { -static const char *const TAG = "xiaomi_mhoc401"; +ESPHOME_LOG_TAG(TAG, "xiaomi_mhoc401"); static constexpr size_t MHOC401_BINDKEY_SIZE = 16; diff --git a/esphome/components/xiaomi_miscale/xiaomi_miscale.cpp b/esphome/components/xiaomi_miscale/xiaomi_miscale.cpp index 482c0ed395..438b9b5529 100644 --- a/esphome/components/xiaomi_miscale/xiaomi_miscale.cpp +++ b/esphome/components/xiaomi_miscale/xiaomi_miscale.cpp @@ -4,7 +4,7 @@ namespace esphome::xiaomi_miscale { -static const char *const TAG = "xiaomi_miscale"; +ESPHOME_LOG_TAG(TAG, "xiaomi_miscale"); void XiaomiMiscale::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi Miscale"); diff --git a/esphome/components/xiaomi_mjyd02yla/xiaomi_mjyd02yla.cpp b/esphome/components/xiaomi_mjyd02yla/xiaomi_mjyd02yla.cpp index 233f5f5783..767bcd8da0 100644 --- a/esphome/components/xiaomi_mjyd02yla/xiaomi_mjyd02yla.cpp +++ b/esphome/components/xiaomi_mjyd02yla/xiaomi_mjyd02yla.cpp @@ -4,7 +4,7 @@ namespace esphome::xiaomi_mjyd02yla { -static const char *const TAG = "xiaomi_mjyd02yla"; +ESPHOME_LOG_TAG(TAG, "xiaomi_mjyd02yla"); void XiaomiMJYD02YLA::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi MJYD02YL-A"); diff --git a/esphome/components/xiaomi_mue4094rt/xiaomi_mue4094rt.cpp b/esphome/components/xiaomi_mue4094rt/xiaomi_mue4094rt.cpp index eca83c0912..afd8715ec5 100644 --- a/esphome/components/xiaomi_mue4094rt/xiaomi_mue4094rt.cpp +++ b/esphome/components/xiaomi_mue4094rt/xiaomi_mue4094rt.cpp @@ -3,7 +3,7 @@ namespace esphome::xiaomi_mue4094rt { -static const char *const TAG = "xiaomi_mue4094rt"; +ESPHOME_LOG_TAG(TAG, "xiaomi_mue4094rt"); void XiaomiMUE4094RT::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi MUE4094RT"); diff --git a/esphome/components/xiaomi_rtcgq02lm/xiaomi_rtcgq02lm.cpp b/esphome/components/xiaomi_rtcgq02lm/xiaomi_rtcgq02lm.cpp index f349dfa797..8bf098a676 100644 --- a/esphome/components/xiaomi_rtcgq02lm/xiaomi_rtcgq02lm.cpp +++ b/esphome/components/xiaomi_rtcgq02lm/xiaomi_rtcgq02lm.cpp @@ -4,7 +4,7 @@ namespace esphome::xiaomi_rtcgq02lm { -static const char *const TAG = "xiaomi_rtcgq02lm"; +ESPHOME_LOG_TAG(TAG, "xiaomi_rtcgq02lm"); static constexpr size_t RTCGQ02LM_BINDKEY_SIZE = 16; diff --git a/esphome/components/xiaomi_wx08zm/xiaomi_wx08zm.cpp b/esphome/components/xiaomi_wx08zm/xiaomi_wx08zm.cpp index ae37d63096..420b67e788 100644 --- a/esphome/components/xiaomi_wx08zm/xiaomi_wx08zm.cpp +++ b/esphome/components/xiaomi_wx08zm/xiaomi_wx08zm.cpp @@ -3,7 +3,7 @@ namespace esphome::xiaomi_wx08zm { -static const char *const TAG = "xiaomi_wx08zm"; +ESPHOME_LOG_TAG(TAG, "xiaomi_wx08zm"); void XiaomiWX08ZM::dump_config() { ESP_LOGCONFIG(TAG, "Xiaomi WX08ZM"); diff --git a/esphome/components/xiaomi_xmwsdj04mmc/xiaomi_xmwsdj04mmc.cpp b/esphome/components/xiaomi_xmwsdj04mmc/xiaomi_xmwsdj04mmc.cpp index aba954fd91..65ab9e342d 100644 --- a/esphome/components/xiaomi_xmwsdj04mmc/xiaomi_xmwsdj04mmc.cpp +++ b/esphome/components/xiaomi_xmwsdj04mmc/xiaomi_xmwsdj04mmc.cpp @@ -4,7 +4,7 @@ namespace esphome::xiaomi_xmwsdj04mmc { -static const char *const TAG = "xiaomi_xmwsdj04mmc"; +ESPHOME_LOG_TAG(TAG, "xiaomi_xmwsdj04mmc"); static constexpr size_t XMWSDJ04MMC_BINDKEY_SIZE = 16; diff --git a/esphome/components/xl9535/xl9535.cpp b/esphome/components/xl9535/xl9535.cpp index d189d9b5c7..228274b321 100644 --- a/esphome/components/xl9535/xl9535.cpp +++ b/esphome/components/xl9535/xl9535.cpp @@ -3,7 +3,7 @@ namespace esphome::xl9535 { -static const char *const TAG = "xl9535"; +ESPHOME_LOG_TAG(TAG, "xl9535"); void XL9535Component::setup() { // Check to see if the device can read from the register diff --git a/esphome/components/xpt2046/touchscreen/xpt2046.cpp b/esphome/components/xpt2046/touchscreen/xpt2046.cpp index 83a7332005..afb8f6cd5c 100644 --- a/esphome/components/xpt2046/touchscreen/xpt2046.cpp +++ b/esphome/components/xpt2046/touchscreen/xpt2046.cpp @@ -13,7 +13,7 @@ static constexpr uint8_t XPT_READ_Y = 0x90; static constexpr uint8_t XPT_ADC_ON = 0x01; static constexpr uint8_t XPT_VREF_ON = 0x02; -static const char *const TAG = "xpt2046"; +ESPHOME_LOG_TAG(TAG, "xpt2046"); void XPT2046Component::setup() { if (this->irq_pin_ != nullptr) { diff --git a/esphome/components/yashima/yashima.cpp b/esphome/components/yashima/yashima.cpp index ba0a3a6404..986237b2d6 100644 --- a/esphome/components/yashima/yashima.cpp +++ b/esphome/components/yashima/yashima.cpp @@ -3,7 +3,7 @@ namespace esphome::yashima { -static const char *const TAG = "yashima.climate"; +ESPHOME_LOG_TAG(TAG, "yashima.climate"); const uint16_t YASHIMA_STATE_LENGTH = 9; const uint16_t YASHIMA_BITS = YASHIMA_STATE_LENGTH * 8; diff --git a/esphome/components/zephyr/gpio.cpp b/esphome/components/zephyr/gpio.cpp index 23da2cafac..4400f0a0c5 100644 --- a/esphome/components/zephyr/gpio.cpp +++ b/esphome/components/zephyr/gpio.cpp @@ -7,7 +7,7 @@ namespace esphome { namespace zephyr { -static const char *const TAG = "zephyr"; +ESPHOME_LOG_TAG(TAG, "zephyr"); static gpio_flags_t flags_to_mode(gpio::Flags flags, bool inverted, bool value) { gpio_flags_t ret = 0; diff --git a/esphome/components/zephyr/preferences.cpp b/esphome/components/zephyr/preferences.cpp index ed22613625..6be5f1ce4a 100644 --- a/esphome/components/zephyr/preferences.cpp +++ b/esphome/components/zephyr/preferences.cpp @@ -10,7 +10,7 @@ namespace esphome::zephyr { -static const char *const TAG = "preferences"; +ESPHOME_LOG_TAG(TAG, "preferences"); bool ZephyrPreferenceBackend::save(const uint8_t *data, size_t len) { this->data.resize(len); diff --git a/esphome/components/zephyr/reset_reason.cpp b/esphome/components/zephyr/reset_reason.cpp index 24b32196db..f3f126537d 100644 --- a/esphome/components/zephyr/reset_reason.cpp +++ b/esphome/components/zephyr/reset_reason.cpp @@ -7,7 +7,7 @@ namespace esphome::zephyr { -static const char *const TAG = "zephyr"; +ESPHOME_LOG_TAG(TAG, "zephyr"); static size_t append_reset_reason(char *buf, size_t size, size_t pos, bool set, const char *reason) { if (!set) { diff --git a/esphome/components/zephyr_ble_server/ble_server.cpp b/esphome/components/zephyr_ble_server/ble_server.cpp index 15993abcce..dd6ecd3b20 100644 --- a/esphome/components/zephyr_ble_server/ble_server.cpp +++ b/esphome/components/zephyr_ble_server/ble_server.cpp @@ -7,7 +7,7 @@ namespace esphome::zephyr_ble_server { -static const char *const TAG = "zephyr_ble_server"; +ESPHOME_LOG_TAG(TAG, "zephyr_ble_server"); static k_work advertise_work; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/components/zephyr_mcumgr/ota/ota_zephyr_mcumgr.cpp b/esphome/components/zephyr_mcumgr/ota/ota_zephyr_mcumgr.cpp index f1eac462bc..af126a29c7 100644 --- a/esphome/components/zephyr_mcumgr/ota/ota_zephyr_mcumgr.cpp +++ b/esphome/components/zephyr_mcumgr/ota/ota_zephyr_mcumgr.cpp @@ -27,7 +27,7 @@ static_assert(sizeof(struct img_mgmt_upload_req) == 8, "ABI mismatch"); static_assert(offsetof(struct img_mgmt_upload_req, image) == 0, "ABI mismatch"); static_assert(offsetof(struct img_mgmt_upload_req, off) == 4, "ABI mismatch"); -static const char *const TAG = "zephyr_mcumgr"; +ESPHOME_LOG_TAG(TAG, "zephyr_mcumgr"); static OTAComponent *global_ota_component; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) static enum mgmt_cb_return mcumgr_img_mgmt_cb(uint32_t event, enum mgmt_cb_return prev_status, int32_t *rc, diff --git a/esphome/components/zephyr_pwm/zephyr_pwm.cpp b/esphome/components/zephyr_pwm/zephyr_pwm.cpp index aa1393388a..71d54e8e48 100644 --- a/esphome/components/zephyr_pwm/zephyr_pwm.cpp +++ b/esphome/components/zephyr_pwm/zephyr_pwm.cpp @@ -6,7 +6,7 @@ namespace esphome::zephyr_pwm { -static const char *const TAG = "zephyr_pwm"; +ESPHOME_LOG_TAG(TAG, "zephyr_pwm"); void ZephyrPWMChannel::setup() { if (!device_is_ready(this->device_)) { diff --git a/esphome/components/zhlt01/zhlt01.cpp b/esphome/components/zhlt01/zhlt01.cpp index 2585ac1b57..afca7bf860 100644 --- a/esphome/components/zhlt01/zhlt01.cpp +++ b/esphome/components/zhlt01/zhlt01.cpp @@ -3,7 +3,7 @@ namespace esphome::zhlt01 { -static const char *const TAG = "zhlt01.climate"; +ESPHOME_LOG_TAG(TAG, "zhlt01.climate"); void ZHLT01Climate::transmit_state() { uint8_t ir_message[12] = {0}; diff --git a/esphome/components/zigbee/time/zigbee_time_esp32.cpp b/esphome/components/zigbee/time/zigbee_time_esp32.cpp index 5567295782..a6a25ef2f3 100644 --- a/esphome/components/zigbee/time/zigbee_time_esp32.cpp +++ b/esphome/components/zigbee/time/zigbee_time_esp32.cpp @@ -5,7 +5,7 @@ namespace esphome::zigbee { -static const char *const TAG = "zigbee.time"; +ESPHOME_LOG_TAG(TAG, "zigbee.time"); // This time standard is the number of // seconds since 0 hrs 0 mins 0 sec on 1st January 2000 UTC (Universal Coordinated Time). diff --git a/esphome/components/zigbee/time/zigbee_time_zephyr.cpp b/esphome/components/zigbee/time/zigbee_time_zephyr.cpp index 3f14d0a62d..f0ef3f2af2 100644 --- a/esphome/components/zigbee/time/zigbee_time_zephyr.cpp +++ b/esphome/components/zigbee/time/zigbee_time_zephyr.cpp @@ -5,7 +5,7 @@ namespace esphome::zigbee { -static const char *const TAG = "zigbee.time"; +ESPHOME_LOG_TAG(TAG, "zigbee.time"); // This time standard is the number of // seconds since 0 hrs 0 mins 0 sec on 1st January 2000 UTC (Universal Coordinated Time). diff --git a/esphome/components/zigbee/zigbee_attribute_esp32.cpp b/esphome/components/zigbee/zigbee_attribute_esp32.cpp index acf0321b12..b73c26a836 100644 --- a/esphome/components/zigbee/zigbee_attribute_esp32.cpp +++ b/esphome/components/zigbee/zigbee_attribute_esp32.cpp @@ -6,7 +6,7 @@ namespace esphome::zigbee { -static const char *const TAG = "zigbee.attribute"; +ESPHOME_LOG_TAG(TAG, "zigbee.attribute"); void ZigbeeAttribute::set_attr_() { if (!this->zb_->is_started()) { diff --git a/esphome/components/zigbee/zigbee_binary_sensor_zephyr.cpp b/esphome/components/zigbee/zigbee_binary_sensor_zephyr.cpp index 464cc04d62..911159d091 100644 --- a/esphome/components/zigbee/zigbee_binary_sensor_zephyr.cpp +++ b/esphome/components/zigbee/zigbee_binary_sensor_zephyr.cpp @@ -10,7 +10,7 @@ extern "C" { } namespace esphome::zigbee { -static const char *const TAG = "zigbee.binary_sensor"; +ESPHOME_LOG_TAG(TAG, "zigbee.binary_sensor"); ZigbeeBinarySensor::ZigbeeBinarySensor(binary_sensor::BinarySensor *binary_sensor) : binary_sensor_(binary_sensor) {} diff --git a/esphome/components/zigbee/zigbee_esp32.cpp b/esphome/components/zigbee/zigbee_esp32.cpp index c6597ebfd6..676407d751 100644 --- a/esphome/components/zigbee/zigbee_esp32.cpp +++ b/esphome/components/zigbee/zigbee_esp32.cpp @@ -17,7 +17,7 @@ namespace esphome::zigbee { -static const char *const TAG = "zigbee"; +ESPHOME_LOG_TAG(TAG, "zigbee"); static ZigbeeComponent *global_zigbee = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/components/zigbee/zigbee_number_zephyr.cpp b/esphome/components/zigbee/zigbee_number_zephyr.cpp index ceb318480c..49b03d3ec9 100644 --- a/esphome/components/zigbee/zigbee_number_zephyr.cpp +++ b/esphome/components/zigbee/zigbee_number_zephyr.cpp @@ -10,7 +10,7 @@ extern "C" { } namespace esphome::zigbee { -static const char *const TAG = "zigbee.number"; +ESPHOME_LOG_TAG(TAG, "zigbee.number"); void ZigbeeNumber::setup() { this->parent_->add_callback(this->endpoint_, [this](zb_bufid_t bufid) { this->zcl_device_cb_(bufid); }); diff --git a/esphome/components/zigbee/zigbee_sensor_zephyr.cpp b/esphome/components/zigbee/zigbee_sensor_zephyr.cpp index 25e1e083e0..9e16cb6a0c 100644 --- a/esphome/components/zigbee/zigbee_sensor_zephyr.cpp +++ b/esphome/components/zigbee/zigbee_sensor_zephyr.cpp @@ -10,7 +10,7 @@ extern "C" { } namespace esphome::zigbee { -static const char *const TAG = "zigbee.sensor"; +ESPHOME_LOG_TAG(TAG, "zigbee.sensor"); ZigbeeSensor::ZigbeeSensor(sensor::Sensor *sensor) : sensor_(sensor) {} diff --git a/esphome/components/zigbee/zigbee_switch_zephyr.cpp b/esphome/components/zigbee/zigbee_switch_zephyr.cpp index 935140e9df..286a036fc6 100644 --- a/esphome/components/zigbee/zigbee_switch_zephyr.cpp +++ b/esphome/components/zigbee/zigbee_switch_zephyr.cpp @@ -13,7 +13,7 @@ extern "C" { namespace esphome::zigbee { -static const char *const TAG = "zigbee_on_off.switch"; +ESPHOME_LOG_TAG(TAG, "zigbee_on_off.switch"); void ZigbeeSwitch::dump_config() { ESP_LOGCONFIG(TAG, diff --git a/esphome/components/zigbee/zigbee_zephyr.cpp b/esphome/components/zigbee/zigbee_zephyr.cpp index 286c83b8f5..f1eadbe6f0 100644 --- a/esphome/components/zigbee/zigbee_zephyr.cpp +++ b/esphome/components/zigbee/zigbee_zephyr.cpp @@ -16,7 +16,7 @@ extern "C" { namespace esphome::zigbee { -static const char *const TAG = "zigbee"; +ESPHOME_LOG_TAG(TAG, "zigbee"); ZigbeeComponent *global_zigbee = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/esphome/components/zio_ultrasonic/zio_ultrasonic.cpp b/esphome/components/zio_ultrasonic/zio_ultrasonic.cpp index 1fa995b3dc..e03f2c5d31 100644 --- a/esphome/components/zio_ultrasonic/zio_ultrasonic.cpp +++ b/esphome/components/zio_ultrasonic/zio_ultrasonic.cpp @@ -5,7 +5,7 @@ namespace esphome::zio_ultrasonic { -static const char *const TAG = "zio_ultrasonic"; +ESPHOME_LOG_TAG(TAG, "zio_ultrasonic"); void ZioUltrasonicComponent::dump_config() { ESP_LOGCONFIG(TAG, "Zio Ultrasonic Sensor:"); diff --git a/esphome/components/zwave_proxy/zwave_proxy.cpp b/esphome/components/zwave_proxy/zwave_proxy.cpp index b0d18a3e6a..bfa16f857a 100644 --- a/esphome/components/zwave_proxy/zwave_proxy.cpp +++ b/esphome/components/zwave_proxy/zwave_proxy.cpp @@ -12,7 +12,7 @@ namespace esphome::zwave_proxy { -static const char *const TAG = "zwave_proxy"; +ESPHOME_LOG_TAG(TAG, "zwave_proxy"); // Maximum bytes to log in very verbose hex output (168 * 3 = 504, under TX buffer size of 512) static constexpr size_t ZWAVE_MAX_LOG_BYTES = 168; diff --git a/esphome/components/zyaura/zyaura.cpp b/esphome/components/zyaura/zyaura.cpp index 0b834de90a..5f203b1893 100644 --- a/esphome/components/zyaura/zyaura.cpp +++ b/esphome/components/zyaura/zyaura.cpp @@ -3,7 +3,7 @@ namespace esphome::zyaura { -static const char *const TAG = "zyaura"; +ESPHOME_LOG_TAG(TAG, "zyaura"); bool IRAM_ATTR ZaDataProcessor::decode(uint32_t ms, bool data) { // check if a new message has started, based on time since previous bit diff --git a/script/api_protobuf/api_protobuf.py b/script/api_protobuf/api_protobuf.py index 701765bb41..a143a85032 100755 --- a/script/api_protobuf/api_protobuf.py +++ b/script/api_protobuf/api_protobuf.py @@ -3546,7 +3546,7 @@ namespace esphome::api { namespace esphome::api { -static const char *const TAG = "api.service"; +ESPHOME_LOG_TAG(TAG, "api.service"); """ diff --git a/script/build_language_schema.py b/script/build_language_schema.py index 91c1de00cd..d8f692de63 100755 --- a/script/build_language_schema.py +++ b/script/build_language_schema.py @@ -456,7 +456,10 @@ def fix_lvgl_widgets(): def get_logger_tags(): - pattern = re.compile(r'^static const char \*const TAG = "(\w.*)";', re.MULTILINE) + pattern = re.compile( + r'^(?:static const char \*const TAG = "|ESPHOME_LOG_TAG\(TAG, ")(\w[^"]*)"', + re.MULTILINE, + ) # tags not in components dir tags = [ "app", diff --git a/script/ci-custom.py b/script/ci-custom.py index 692393b221..d41d5b4302 100755 --- a/script/ci-custom.py +++ b/script/ci-custom.py @@ -1237,6 +1237,45 @@ def lint_no_std_nothrow(fname, match): ) +@lint_re_check( + r"^\s*(?:(?:static|constexpr|inline)\s+)*(?:const\s+)?char\s*(?:\*\s*(?:const\s+)?TAG|\s(?:const\s+)?TAG\s*\[\w*\])" + r"\s*(?:=\s*\{?|[{(])\s*\"", + prefilter="TAG", + include=["esphome/components/*.cpp", "esphome/components/**/*.cpp"], + # Deprecated components, converted in a follow-up PR + exclude=[ + "esphome/components/st7735/*", + "esphome/components/st7789v/*", + "esphome/components/waveshare_epaper/*", + ], +) +def lint_log_tag_macro(fname, match): + return ( + f"Declare log tags with {highlight('ESPHOME_LOG_TAG(TAG, "name");')}, which keeps the tag in flash on " + f"ESP8266.\n" + f" Before: {highlight('static const char *const TAG = "name";')}\n" + f" After: {highlight('ESPHOME_LOG_TAG(TAG, "name");')}\n" + f"Never pass such a TAG to set_timeout/set_interval names or string functions.\n" + f"(If strictly necessary, add `// NOLINT` to the end of the line)" + ) + + +@lint_re_check( + r"(?:\b(?:set_timeout|set_interval|set_retry|cancel_timeout|cancel_interval|cancel_retry|defer)" + r"|\b(?:strcmp|strncmp|strcasecmp|strlen|strcpy|strncpy)|std::string)\s*\((?:(?:[^();]|\([^()]*\))*,)?\s*TAG\b" + r"|\bstd::string\s+\w+\s*[={(]\s*TAG\b", + mask=True, + prefilter="TAG", + include=["esphome/components/*.cpp", "esphome/components/**/*.cpp"], +) +def lint_log_tag_as_string(fname, match): + return ( + f"{highlight('TAG')} is in flash on ESP8266 (ESPHOME_LOG_TAG), so it can only be used for logging.\n" + f"Use a separate name or a numeric id for scheduler calls, and do not pass it to string functions.\n" + f"(If strictly necessary, add `// NOLINT` to the end of the line)" + ) + + LOG_CALL_START_RE = re.compile(r"ESP_LOG\w+\s*\(") # Comments, raw/plain string literals and single char literals are consumed whole so ; ( ) ? : # inside them are never seen. A char literal is exactly one (escaped) char so a digit separator diff --git a/tests/script/test_ci_custom.py b/tests/script/test_ci_custom.py index 5a943cda08..4459631293 100644 --- a/tests/script/test_ci_custom.py +++ b/tests/script/test_ci_custom.py @@ -386,3 +386,59 @@ def test_ternary_error_message_names_the_literal() -> None: ) assert len(errs) == 1 assert 'LOG_STR_LITERAL("enabled")' in errs[0][2] + + +@pytest.mark.parametrize( + "line", + [ + 'static const char *const TAG = "x";', + 'static const char* const TAG = "x";', + 'static const char *TAG = "x";', + 'constexpr const char *TAG = "x";', + 'static const char *const TAG{"x"};', + 'static constexpr char TAG[] = "x";', + 'static constexpr char TAG[] = {"x"};', + 'static const char TAG[8] = "x";', + ' static const char *const TAG = "x";', + ], +) +def test_log_tag_macro_flags_plain_tags(line: str) -> None: + assert ci_custom.lint_log_tag_macro("test.cpp", line + "\n") + + +@pytest.mark.parametrize( + "line", + ['ESPHOME_LOG_TAG(TAG, "x");', 'static const char *const NAME = "x";'], +) +def test_log_tag_macro_ignores_macro_and_other_names(line: str) -> None: + assert not ci_custom.lint_log_tag_macro("test.cpp", line + "\n") + + +@pytest.mark.parametrize( + "line", + [ + "this->set_timeout(TAG, 100, cb);", + "strcmp(TAG, name);", + "strcmp(name, TAG);", + "strncpy(buf, TAG, sizeof(buf));", + "strcmp(get_name(), TAG);", + "this->set_timeout(make_id(x), TAG, cb);", + "std::string(TAG);", + "std::string name = TAG;", + "std::string name{TAG};", + ], +) +def test_log_tag_as_string_flags_string_uses(line: str) -> None: + assert ci_custom.lint_log_tag_as_string("test.cpp", line + "\n") + + +@pytest.mark.parametrize( + "line", + [ + 'ESP_LOGD(TAG, "x");', + 'this->set_timeout(100, [this]() { ESP_LOGD(TAG, "x"); });', + "strcmp(name, OTHER_TAG);", + ], +) +def test_log_tag_as_string_ignores_logging(line: str) -> None: + assert not ci_custom.lint_log_tag_as_string("test.cpp", line + "\n")