Compile error when adding sensor: platform: wifi_signal

When I add the sensor:
sensor:

  • platform: wifi_signal
    name: “ESP Wifi signal strength”
    update_interval: 60s

I get an error while linking:
<
Linking .pioenvs/irrcon04-4-02/firmware.elf
/data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/…/lib/gcc/xtensa-esp-elf/14.2.0/…/…/…/…/xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/esphome/components/api/api_connection.cpp.o:(.literal._ZN7esphome3api13APIConnection20try_send_sensor_infoEPNS_10EntityBaseEPS1_mb+0x4): undefined reference to _ZN7esphome6sensor6Sensor21get_accuracy_decimalsEv' /data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/esphome/components/api/api_connection.cpp.o:(.literal._ZN7esphome3api13APIConnection20try_send_sensor_infoEPNS_10EntityBaseEPS1_mb+0x8): undefined reference to _ZN7esphome6sensor6Sensor15get_state_classEv’
/data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/…/lib/gcc/xtensa-esp-elf/14.2.0/…/…/…/…/xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/esphome/components/api/api_connection.cpp.o: in function _ZN7esphome3api13APIConnection20try_send_sensor_infoEPNS_10EntityBaseEPS1_mb': /data/build/irrcon04-4-02/src/esphome/components/api/api_connection.cpp:545:(.text._ZN7esphome3api13APIConnection20try_send_sensor_infoEPNS_10EntityBaseEPS1_mb+0x44): undefined reference to _ZN7esphome6sensor6Sensor21get_accuracy_decimalsEv’
/data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/…/lib/gcc/xtensa-esp-elf/14.2.0/…/…/…/…/xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/esphome/components/api/api_connection.cpp.o: in function _ZN7esphome3api26ListEntitiesSensorResponse16set_device_classERKNS_9StringRefE': /data/build/irrcon04-4-02/src/esphome/components/api/api_pb2.h:889:(.text._ZN7esphome3api13APIConnection20try_send_sensor_infoEPNS_10EntityBaseEPS1_mb+0x63): undefined reference to _ZN7esphome6sensor6Sensor15get_state_classEv’
/data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/…/lib/gcc/xtensa-esp-elf/14.2.0/…/…/…/…/xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/main.cpp.o:(.literal._Z5setupv+0x118): undefined reference to _ZTVN7esphome11wifi_signal16WiFiSignalSensorE' /data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/main.cpp.o:(.literal._Z5setupv+0x11c): undefined reference to _ZTVN7esphome11wifi_signal16WiFiSignalSensorE’
/data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/…/lib/gcc/xtensa-esp-elf/14.2.0/…/…/…/…/xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/main.cpp.o:(.literal._Z5setupv+0x2dc): undefined reference to _ZN7esphome6sensor6SensorC2Ev' /data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/main.cpp.o:(.literal._Z5setupv+0x2e4): undefined reference to _ZN7esphome6sensor6Sensor15set_state_classENS0_10StateClassE’
/data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/…/lib/gcc/xtensa-esp-elf/14.2.0/…/…/…/…/xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/main.cpp.o:(.literal._Z5setupv+0x2ec): undefined reference to _ZN7esphome6sensor6Sensor21set_accuracy_decimalsEa' /data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/main.cpp.o: in function _Z5setupv’:
/data/build/irrcon04-4-02/src/main.cpp:567:(.text._Z5setupv+0x94c): undefined reference to _ZN7esphome6sensor6SensorC2Ev' /data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/main.cpp.o: in function _ZN7esphome10EntityBase23set_disabled_by_defaultEb’:
/data/build/irrcon04-4-02/src/esphome/core/entity_base.h:51:(.text._Z5setupv+0x9af): undefined reference to _ZN7esphome6sensor6Sensor15set_state_classENS0_10StateClassE' /data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/main.cpp.o: in function _ZN7esphome9Component20set_component_sourceEPKNS_9LogStringE’:
/data/build/irrcon04-4-02/src/esphome/core/component.h:227:(.text._Z5setupv+0x9c7): undefined reference to _ZN7esphome6sensor6Sensor21set_accuracy_decimalsEa' /data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/esphome/core/controller.cpp.o:(.literal._ZN7esphome10Controller16setup_controllerEb+0x20): undefined reference to _ZN7esphome6sensor6Sensor21add_on_state_callbackEOSt8functionIFvfEE’
/data/cache/platformio/packages/toolchain-xtensa-esp-elf/bin/…/lib/gcc/xtensa-esp-elf/14.2.0/…/…/…/…/xtensa-esp-elf/bin/ld: .pioenvs/irrcon04-4-02/src/esphome/core/controller.cpp.o: in function _ZN7esphome10Controller16setup_controllerEb': /data/cache/platformio/packages/toolchain-xtensa-esp-elf/xtensa-esp-elf/include/c++/14.2.0/bits/std_function.h:452:(.text._ZN7esphome10Controller16setup_controllerEb+0xb2): undefined reference to _ZN7esphome6sensor6Sensor21add_on_state_callbackEOSt8functionIFvfEE’
collect2: error: ld returned 1 exit status
*** [.pioenvs/irrcon04-4-02/firmware.elf] Error 1
========================= [FAILED] Took 18.71 seconds =========================

System config:
esp32:
board: esp32dev
framework:
type: arduino

Any ideas?

Post your code and you logs using code tags.

ok, will do, but after e new compilation the error is gone. Maybe it was caught in between the update of the sources.