Skip to content

Logging issue #31

@benwa

Description

@benwa

When attempting to compile, I get the following:

log
...
In file included from src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:4:
src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp: In member function 'void esphome::daikin_s21::DaikinS21Climate::set_s21_climate()':
src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:419:17: error: format '%s' expects argument of type 'char*', but argument 5 has type 'const esphome::LogString*' [-Werror=format=]
  419 |   ESP_LOGI(TAG, "  Mode: %s", climate::climate_mode_to_string(this->mode));
      |                 ^~~~~~~~~~~~
src/esphome/core/log.h:74:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
   74 | #define ESPHOME_LOG_FORMAT(format) format
      |                                    ^~~~~~
src/esphome/core/log.h:153:28: note: in expansion of macro 'esph_log_i'
  153 | #define ESP_LOGI(tag, ...) esph_log_i(tag, __VA_ARGS__)
      |                            ^~~~~~~~~~
src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:419:3: note: in expansion of macro 'ESP_LOGI'
  419 |   ESP_LOGI(TAG, "  Mode: %s", climate::climate_mode_to_string(this->mode));
      |   ^~~~~~~~
src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:419:27: note: format string is defined here
  419 |   ESP_LOGI(TAG, "  Mode: %s", climate::climate_mode_to_string(this->mode));
      |                          ~^
      |                           |
      |                           char*
Compiling .pioenvs\bedroom-3-ac\src\esphome\components\sntp\sntp_component.cpp.o
Compiling .pioenvs\bedroom-3-ac\src\esphome\components\socket\bsd_sockets_impl.cpp.o
Compiling .pioenvs\bedroom-3-ac\src\esphome\components\socket\lwip_raw_tcp_impl.cpp.o
Compiling .pioenvs\bedroom-3-ac\src\esphome\components\socket\lwip_sockets_impl.cpp.o
Compiling .pioenvs\bedroom-3-ac\src\esphome\components\socket\socket.cpp.o
Compiling .pioenvs\bedroom-3-ac\src\esphome\components\switch\automation.cpp.o
Compiling .pioenvs\bedroom-3-ac\src\esphome\components\switch\switch.cpp.o
cc1plus.exe: some warnings being treated as errors
*** [.pioenvs\bedroom-3-ac\src\esphome\components\daikin_s21\climate\daikin_s21_climate.cpp.o] Error 1
========================= [FAILED] Took 10.12 seconds =========================
Scrubbed config
esphome:
  name: bedroom-3-ac
  friendly_name: Bedroom 3 AC
  platformio_options:
    framework: espidf
    platform: https://github.com/lucaskatayama/platform-espressif32.git#feat/idf_only-seeed_xiao_esp32c6.json

esp32:
  board: seeed_xiao_esp32c6
  variant: ESP32C6
  framework:
    type: esp-idf
    version: "5.3.1"
    platform_version: 6.10.0

logger:
  level: DEBUG

# https://github.com/esphome/esphome/pull/7506
external_components:
  - source: github://pr#7506
    components: [ network, mdns, openthread ]
    refresh: always
  - source: github://joshbenner/esphome-daikin-s21@main
    components: [ daikin_s21 ]
    refresh: always

network:
  enable_ipv6: true

# openthread:
#   channel: !secret openthread_channel
#   network_name: !secret openthread_network_name
#   network_key: !secret openthread_network_key
#   panid: !secret openthread_panid
#   extpanid: !secret openthread_extpanid
#   pskc: !secret openthread_pskc

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  on_connect:
    - switch.turn_on: led1
  on_disconnect:
    - switch.turn_off: led1
  ap: {}

# Enable Home Assistant API
api:
  encryption:
    key: REDACTED
  reboot_timeout: 0s

ota:
  - platform: esphome
    password: REDACTED

# Enable ceramic antenna
output:
  - platform: gpio
    id: wifi_switch_enable
    pin: GPIO3

binary_sensor:
  - platform: gpio
    id: button1
    name: "Button"
    publish_initial_state: true
    pin:
      number: GPIO9
      mode: INPUT_PULLUP
      inverted: true
      ignore_strapping_warning: true

switch:
  - platform: gpio
    id: led1
    name: "On-board LED"
    pin:
      number: GPIO15 
      ignore_strapping_warning: true

sensor:
  - platform: daikin_s21
    inside_temperature:
      name: Inside Temperature
    outside_temperature:
      name: Outside Temperature
    coil_temperature:
      name: Coil Temperature
    fan_speed:
      name: Fan Speed
  - platform: uptime
    type: seconds
    name: Uptime Sensor
    entity_category: diagnostic
  - platform: internal_temperature
    entity_category: diagnostic
    name: "Internal Temperature"

time:
  - platform: sntp
    id: sntp_time
    timezone: America/New_York
    servers:
      - 0.pool.ntp.org
      - 1.pool.ntp.org

uart:
  - id: s21_uart
    tx_pin: GPIO16
    rx_pin: GPIO17
    baud_rate: 2400
    data_bits: 8
    parity: EVEN
    stop_bits: 2

daikin_s21:
  tx_uart: s21_uart
  rx_uart: s21_uart

climate:
  - name: My Daikin
    platform: daikin_s21
    visual:
      temperature_step: 1.0

ESPHome: 2025.2.2
esphome-daikin-s21: 1.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions