aronsky / esphome-components

Custom components for ESPHome
MIT License
31 stars 20 forks source link

I've got compilation error when tried to use the component #12

Open mak-42 opened 3 months ago

mak-42 commented 3 months ago

I've add the component into my config and it caused the compilation error:

INFO ESPHome 2024.3.0
INFO Reading configuration /config/maktestnode1.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing maktestnode1 (board: esp32-s3-devkitc-1; framework: arduino; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 2.1.3
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.1.0
|-- ESPmDNS @ 2.0.0
|-- ArduinoJson @ 6.18.5
Compiling .pioenvs/maktestnode1/src/main.cpp.o
Compiling .pioenvs/maktestnode1/lib18f/WiFi/WiFiUdp.cpp.o
In file included from src/esphome.h:3,
                 from src/main.cpp:3:
src/esphome/components/ble_adv_light/ble_adv_light.h:94:58: error: expected template-name before '<' token
 template<typename... Ts> class PairAction : public Action<Ts...> {
                                                          ^
src/esphome/components/ble_adv_light/ble_adv_light.h:94:58: error: expected '{' before '<' token
src/esphome/components/ble_adv_light/ble_adv_light.h:106:60: error: expected template-name before '<' token
 template<typename... Ts> class UnpairAction : public Action<Ts...> {
                                                            ^
src/esphome/components/ble_adv_light/ble_adv_light.h:106:60: error: expected '{' before '<' token
Compiling .pioenvs/maktestnode1/lib6ca/FS/FS.cpp.o
Compiling .pioenvs/maktestnode1/lib6ca/FS/vfs_api.cpp.o
Compiling .pioenvs/maktestnode1/libb83/Update/HttpsOTAUpdate.cpp.o
Compiling .pioenvs/maktestnode1/libb83/Update/Updater.cpp.o
Compiling .pioenvs/maktestnode1/libf30/ESPAsyncWebServer-esphome/AsyncEventSource.cpp.o
Compiling .pioenvs/maktestnode1/libf30/ESPAsyncWebServer-esphome/AsyncWebSocket.cpp.o
*** [.pioenvs/maktestnode1/src/main.cpp.o] Error 1
========================== [FAILED] Took 4.75 seconds ==========================

The config is very simple:

esphome:
  name: maktestnode1
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino
  flash_size: 16Mb
  variant: esp32s3

external_components:
  # shorthand
  source: github://aronsky/esphome-components

# Enable logging
logger:

ota:
  password: !secret TEST_NODE1_OTA_PSW

wifi:
  ssid: !secret WIFI_SSID
  password: !secret WIFI_PASSW

# Enable Web server.
web_server:
  port: 80
  auth:
    username: !secret TEST_NODE1_WEB_LOG
    password: !secret TEST_NODE1_WEB_PSW

switch:
  - platform: restart
    name: "Restart"

button:
  - platform: factory_reset
    name: Restart with Factory Default Settings

light:
  - platform: ble_adv_light
    type: lampsmart_pro
    name: Test Light
    duration: 750
    default_transition_length: 0s
aronsky commented 3 months ago

Framework type should be esp-idf. I should add it to the sample YAML...

mak-42 commented 3 months ago

It did not help: new errors :(

INFO ESPHome 2024.3.0
INFO Reading configuration /config/maktestnode1.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing maktestnode1 (board: esp32-s3-devkitc-1; framework: espidf; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
 - framework-espidf @ 3.40406.240122 (4.4.6) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
Dependency Graph
|-- ArduinoJson @ 6.18.5
Compiling .pioenvs/maktestnode1/src/esphome/components/ble_adv_light/lampsmart_pro.o
Compiling .pioenvs/maktestnode1/src/esphome/components/ble_adv_light/msc26a.o
src/esphome/components/ble_adv_light/msc26a.cpp: In function 'unsigned char* stage2(unsigned char*, unsigned int, unsigned int)':
src/esphome/components/ble_adv_light/msc26a.cpp:156:32: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
                         (uVar4 & 2 | (uVar4 & 1) << 2 | (uVar4 & 0xff) >> 2 & 1)
                          ~~~~~~^~~
src/esphome/components/ble_adv_light/msc26a.cpp:156:77: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
                         (uVar4 & 2 | (uVar4 & 1) << 2 | (uVar4 & 0xff) >> 2 & 1)
                                                         ~~~~~~~~~~~~~~~~~~~~^~~
src/esphome/components/ble_adv_light/msc26a.cpp:155:36: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
                        (uVar4 >> 3 & 1 |
                         ~~~~~~~~~~~^~~
src/esphome/components/ble_adv_light/msc26a.cpp:154:44: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
                       ((uVar4 & 0xff) >> 4 & 1 |
                        ~~~~~~~~~~~~~~~~~~~~^~~
src/esphome/components/ble_adv_light/msc26a.cpp:153:34: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
                      (uVar4 >> 5 & 1 |
                       ~~~~~~~~~~~^~~
src/esphome/components/ble_adv_light/msc26a.cpp:152:33: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
           (uint8_t)((uVar4 >> 6 & 1 |
                      ~~~~~~~~~~~^~~
src/esphome/components/ble_adv_light/msc26a.cpp:151:33: error: suggest parentheses around arithmetic in operand of '|' [-Werror=parentheses]
           (uint8_t)(uVar4 >> 7) & 1 |
           ~~~~~~~~~~~~~~~~~~~~~~^~~
src/esphome/components/ble_adv_light/msc26a.cpp: In function 'void whitening_encode(unsigned char*, int, unsigned int*)':
src/esphome/components/ble_adv_light/msc26a.cpp:232:49: error: suggest parentheses around arithmetic in operand of '^' [-Werror=parentheses]
       iVar4 += (uVar2 ^ bVar1 >> (uVar3 & 0xff) & 1) << (uVar3 & 0xff);
                         ~~~~~~~~~~~~~~~~~~~~~~~~^~~
Compiling .pioenvs/maktestnode1/src/esphome/components/esp32_ble/ble.o
Compiling .pioenvs/maktestnode1/src/esphome/components/esp32_ble/ble_advertising.o
Compiling .pioenvs/maktestnode1/src/esphome/components/esp32_ble/ble_uuid.o
cc1plus: some warnings being treated as errors
Compiling .pioenvs/maktestnode1/src/esphome/components/factory_reset/button/factory_reset_button.o
Compiling .pioenvs/maktestnode1/src/esphome/components/json/json_util.o
*** [.pioenvs/maktestnode1/src/esphome/components/ble_adv_light/msc26a.o] Error 1
Compiling .pioenvs/maktestnode1/src/esphome/components/light/addressable_light.o
src/esphome/components/ble_adv_light/lampsmart_pro.cpp: In function 'void esphome::bleadvlight::ble_whiten(uint8_t*, uint8_t, uint8_t, uint8_t)':
src/esphome/components/ble_adv_light/lampsmart_pro.cpp:68:44: error: suggest parentheses around '+' in operand of '&' [-Werror=parentheses]
     buf[i] ^= XBOXES[(seed + i + 9) & 0x1f + (salt & 0x3) * 0x20];
                                       ~~~~~^~~~~~~~~~~~~~~~~~~~~
src/esphome/components/ble_adv_light/lampsmart_pro.cpp: In member function 'virtual void esphome::bleadvlight::LampSmartProLight::send_packet(uint8_t, uint8_t*)':
src/esphome/components/ble_adv_light/lampsmart_pro.cpp:104:4: warning: missing initializer for member 'esphome::bleadvlight::adv_data_t::<unnamed struct>::crc16' [-Wmissing-field-initializers]
   }};
    ^
cc1plus: some warnings being treated as errors
*** [.pioenvs/maktestnode1/src/esphome/components/ble_adv_light/lampsmart_pro.o] Error 1
========================== [FAILED] Took 4.47 seconds ==========================
aronsky commented 3 months ago

OK, scratch that. The platform should've been arduino. But I'm not sure what caused the compilation errors in the first message. Can you try limiting your configuration to the bare minimum and gradually add back the additional settings? Specifically, can you try removing everything but the board field under esp32, and the platformio_options under esphome? They are my immediate suspects.

mak-42 commented 3 months ago

I created minimal config for my board and cleaned build files :

esphome:
  name: maktestnode1
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino
  flash_size: 16Mb
  variant: esp32s3

external_components:
  # shorthand
  source: github://aronsky/esphome-components

light:
  - platform: ble_adv_light
    type: lampsmart_pro
    name: Test Light
    duration: 750
    default_transition_length: 0s

Same compilation error:

INFO ESPHome 2024.3.0
INFO Reading configuration /config/maktestnode1.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing maktestnode1 (board: esp32-s3-devkitc-1; framework: arduino; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
No dependencies
Compiling .pioenvs/maktestnode1/src/main.cpp.o
Compiling .pioenvs/maktestnode1/FrameworkArduino/Print.cpp.o
Compiling .pioenvs/maktestnode1/FrameworkArduino/Stream.cpp.o
Compiling .pioenvs/maktestnode1/FrameworkArduino/StreamString.cpp.o
Compiling .pioenvs/maktestnode1/FrameworkArduino/Tone.cpp.o
Compiling .pioenvs/maktestnode1/FrameworkArduino/USB.cpp.o
Compiling .pioenvs/maktestnode1/FrameworkArduino/USBCDC.cpp.o
Compiling .pioenvs/maktestnode1/FrameworkArduino/USBMSC.cpp.o
In file included from src/esphome.h:3,
                 from src/main.cpp:3:
src/esphome/components/ble_adv_light/ble_adv_light.h:94:58: error: expected template-name before '<' token
 template<typename... Ts> class PairAction : public Action<Ts...> {
                                                          ^
src/esphome/components/ble_adv_light/ble_adv_light.h:94:58: error: expected '{' before '<' token
src/esphome/components/ble_adv_light/ble_adv_light.h:106:60: error: expected template-name before '<' token
 template<typename... Ts> class UnpairAction : public Action<Ts...> {
                                                            ^
src/esphome/components/ble_adv_light/ble_adv_light.h:106:60: error: expected '{' before '<' token
Compiling .pioenvs/maktestnode1/FrameworkArduino/WMath.cpp.o
Compiling .pioenvs/maktestnode1/FrameworkArduino/WString.cpp.o
Compiling .pioenvs/maktestnode1/FrameworkArduino/base64.cpp.o
*** [.pioenvs/maktestnode1/src/main.cpp.o] Error 1
========================== [FAILED] Took 2.80 seconds ==========================
aronsky commented 3 months ago

Like I said - try to remove platformio_options under esp home, and everything under esp32 except board.

On Mon, 25 Mar 2024, 23:03 Dmitry, @.***> wrote:

I created minimal config for my board and cleaned build files :

esphome: name: maktestnode1 platformio_options: board_build.flash_mode: dio

esp32: board: esp32-s3-devkitc-1 framework: type: arduino flash_size: 16Mb variant: esp32s3

external_components:

shorthand

source: github://aronsky/esphome-components

light:

  • platform: ble_adv_light type: lampsmart_pro name: Test Light duration: 750 default_transition_length: 0s

Same compilation error:

INFO ESPHome 2024.3.0 INFO Reading configuration /config/maktestnode1.yaml... INFO Generating C++ source... INFO Compiling app... Processing maktestnode1 (board: esp32-s3-devkitc-1; framework: arduino; platform: @.***)

HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash

  • toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
  • toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5 No dependencies Compiling .pioenvs/maktestnode1/src/main.cpp.o Compiling .pioenvs/maktestnode1/FrameworkArduino/Print.cpp.o Compiling .pioenvs/maktestnode1/FrameworkArduino/Stream.cpp.o Compiling .pioenvs/maktestnode1/FrameworkArduino/StreamString.cpp.o Compiling .pioenvs/maktestnode1/FrameworkArduino/Tone.cpp.o Compiling .pioenvs/maktestnode1/FrameworkArduino/USB.cpp.o Compiling .pioenvs/maktestnode1/FrameworkArduino/USBCDC.cpp.o Compiling .pioenvs/maktestnode1/FrameworkArduino/USBMSC.cpp.o In file included from src/esphome.h:3, from src/main.cpp:3: src/esphome/components/ble_adv_light/ble_adv_light.h:94:58: error: expected template-name before '<' token template class PairAction : public Action { ^ src/esphome/components/ble_adv_light/ble_adv_light.h:94:58: error: expected '{' before '<' token src/esphome/components/ble_adv_light/ble_adv_light.h:106:60: error: expected template-name before '<' token template class UnpairAction : public Action { ^ src/esphome/components/ble_adv_light/ble_adv_light.h:106:60: error: expected '{' before '<' token Compiling .pioenvs/maktestnode1/FrameworkArduino/WMath.cpp.o Compiling .pioenvs/maktestnode1/FrameworkArduino/WString.cpp.o Compiling .pioenvs/maktestnode1/FrameworkArduino/base64.cpp.o *** [.pioenvs/maktestnode1/src/main.cpp.o] Error 1 ========================== [FAILED] Took 2.80 seconds ==========================

— Reply to this email directly, view it on GitHub https://github.com/aronsky/esphome-components/issues/12#issuecomment-2018910364, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABD52DAQRPU7WWJTINAGMV3Y2CGJ5AVCNFSM6AAAAABFF5VXK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJYHEYTAMZWGQ . You are receiving this because you commented.Message ID: @.***>

mak-42 commented 3 months ago

Completely new config:

esphome:
  name: tmp1

esp32:
  board: esp32-s3-devkitc-1

external_components:
  # shorthand
  source: github://aronsky/esphome-components

light:
  - platform: ble_adv_light
    type: lampsmart_pro
    name: Test Light
    duration: 750
    default_transition_length: 0s

Same error:

INFO ESPHome 2024.3.0
INFO Reading configuration /config/tmp1.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing tmp1 (board: esp32-s3-devkitc-1; framework: arduino; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
No dependencies
Compiling .pioenvs/tmp1/src/esphome/components/ble_adv_light/ble_adv_light.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/ble_adv_light/lampsmart_pro.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/ble_adv_light/msc26a.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/ble_adv_light/zhijia_light.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/esp32/core.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/esp32/gpio.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/esp32/preferences.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/esp32_ble/ble.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/esp32_ble/ble_advertising.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/esp32_ble/ble_uuid.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/addressable_light.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/automation.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/esp_color_correction.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/esp_hsv_color.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/esp_range_view.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/light_call.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/light_json_schema.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/light_output.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/light_state.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/application.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/color.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/component.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/component_iterator.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/controller.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/entity_base.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/helpers.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/log.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/ring_buffer.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/scheduler.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/string_ref.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/time.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/util.cpp.o
Compiling .pioenvs/tmp1/src/main.cpp.o
Building .pioenvs/tmp1/bootloader.bin
Creating esp32s3 image...
Successfully created esp32s3 image.
Generating partitions .pioenvs/tmp1/partitions.bin
Compiling .pioenvs/tmp1/FrameworkArduino/Esp.cpp.o
Compiling .pioenvs/tmp1/FrameworkArduino/FirmwareMSC.cpp.o
Compiling .pioenvs/tmp1/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling .pioenvs/tmp1/FrameworkArduino/HWCDC.cpp.o
In file included from src/esphome.h:3,
                 from src/main.cpp:3:
src/esphome/components/ble_adv_light/ble_adv_light.h:94:58: error: expected template-name before '<' token
 template<typename... Ts> class PairAction : public Action<Ts...> {
                                                          ^
src/esphome/components/ble_adv_light/ble_adv_light.h:94:58: error: expected '{' before '<' token
src/esphome/components/ble_adv_light/ble_adv_light.h:106:60: error: expected template-name before '<' token
 template<typename... Ts> class UnpairAction : public Action<Ts...> {
                                                            ^
src/esphome/components/ble_adv_light/ble_adv_light.h:106:60: error: expected '{' before '<' token
Compiling .pioenvs/tmp1/FrameworkArduino/HardwareSerial.cpp.o
Compiling .pioenvs/tmp1/FrameworkArduino/IPAddress.cpp.o
Compiling .pioenvs/tmp1/FrameworkArduino/IPv6Address.cpp.o
Compiling .pioenvs/tmp1/FrameworkArduino/MD5Builder.cpp.o
*** [.pioenvs/tmp1/src/main.cpp.o] Error 1
========================== [FAILED] Took 7.58 seconds ==========================
aronsky commented 3 months ago

Strange... Unless the issue is with the board field itself (i.e., it causes some includes/defines that somehow break the Action template). I'll run the exact same config on my end tomorrow and check the result.

On Mon, 25 Mar 2024, 23:11 Dmitry, @.***> wrote:

Completely new config:

esphome: name: tmp1

esp32: board: esp32-s3-devkitc-1

external_components:

shorthand

source: github://aronsky/esphome-components

light:

  • platform: ble_adv_light type: lampsmart_pro name: Test Light duration: 750 default_transition_length: 0s

Same error:

INFO ESPHome 2024.3.0 INFO Reading configuration /config/tmp1.yaml... INFO Generating C++ source... INFO Compiling app... Processing tmp1 (board: esp32-s3-devkitc-1; framework: arduino; platform: @.***)

HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash

  • toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
  • toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5 No dependencies Compiling .pioenvs/tmp1/src/esphome/components/ble_adv_light/ble_adv_light.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/ble_adv_light/lampsmart_pro.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/ble_adv_light/msc26a.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/ble_adv_light/zhijia_light.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/esp32/core.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/esp32/gpio.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/esp32/preferences.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/esp32_ble/ble.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/esp32_ble/ble_advertising.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/esp32_ble/ble_uuid.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/light/addressable_light.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/light/automation.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/light/esp_color_correction.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/light/esp_hsv_color.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/light/esp_range_view.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/light/light_call.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/light/light_json_schema.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/light/light_output.cpp.o Compiling .pioenvs/tmp1/src/esphome/components/light/light_state.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/application.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/color.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/component.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/component_iterator.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/controller.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/entity_base.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/helpers.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/log.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/ring_buffer.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/scheduler.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/string_ref.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/time.cpp.o Compiling .pioenvs/tmp1/src/esphome/core/util.cpp.o Compiling .pioenvs/tmp1/src/main.cpp.o Building .pioenvs/tmp1/bootloader.bin Creating esp32s3 image... Successfully created esp32s3 image. Generating partitions .pioenvs/tmp1/partitions.bin Compiling .pioenvs/tmp1/FrameworkArduino/Esp.cpp.o Compiling .pioenvs/tmp1/FrameworkArduino/FirmwareMSC.cpp.o Compiling .pioenvs/tmp1/FrameworkArduino/FunctionalInterrupt.cpp.o Compiling .pioenvs/tmp1/FrameworkArduino/HWCDC.cpp.o In file included from src/esphome.h:3, from src/main.cpp:3: src/esphome/components/ble_adv_light/ble_adv_light.h:94:58: error: expected template-name before '<' token template class PairAction : public Action { ^ src/esphome/components/ble_adv_light/ble_adv_light.h:94:58: error: expected '{' before '<' token src/esphome/components/ble_adv_light/ble_adv_light.h:106:60: error: expected template-name before '<' token template class UnpairAction : public Action { ^ src/esphome/components/ble_adv_light/ble_adv_light.h:106:60: error: expected '{' before '<' token Compiling .pioenvs/tmp1/FrameworkArduino/HardwareSerial.cpp.o Compiling .pioenvs/tmp1/FrameworkArduino/IPAddress.cpp.o Compiling .pioenvs/tmp1/FrameworkArduino/IPv6Address.cpp.o Compiling .pioenvs/tmp1/FrameworkArduino/MD5Builder.cpp.o *** [.pioenvs/tmp1/src/main.cpp.o] Error 1 ========================== [FAILED] Took 7.58 seconds ==========================

— Reply to this email directly, view it on GitHub https://github.com/aronsky/esphome-components/issues/12#issuecomment-2018924271, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABD52DG5WROVJJ6RTCXXJJDY2CHIZAVCNFSM6AAAAABFF5VXK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJYHEZDIMRXGE . You are receiving this because you commented.Message ID: @.***>

mak-42 commented 3 months ago

Changed it for something different:

esphome:
  name: tmp1
  platform: ESP32
  board: nodemcu-32s

external_components:
  # shorthand
  source: github://aronsky/esphome-components

light:
  - platform: ble_adv_light
    type: lampsmart_pro
    name: Test Light
    duration: 750
    default_transition_length: 0s

Same error:

INFO ESPHome 2024.3.0
INFO Reading configuration /config/tmp1.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing tmp1 (board: nodemcu-32s; framework: arduino; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
No dependencies
Compiling .pioenvs/tmp1/src/esphome/components/ble_adv_light/ble_adv_light.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/ble_adv_light/lampsmart_pro.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/ble_adv_light/msc26a.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/ble_adv_light/zhijia_light.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/esp32/core.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/esp32/gpio.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/esp32/preferences.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/esp32_ble/ble.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/esp32_ble/ble_advertising.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/esp32_ble/ble_uuid.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/addressable_light.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/automation.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/esp_color_correction.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/esp_hsv_color.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/esp_range_view.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/light_call.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/light_json_schema.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/light_output.cpp.o
Compiling .pioenvs/tmp1/src/esphome/components/light/light_state.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/application.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/color.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/component.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/component_iterator.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/controller.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/entity_base.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/helpers.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/log.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/ring_buffer.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/scheduler.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/string_ref.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/time.cpp.o
Compiling .pioenvs/tmp1/src/esphome/core/util.cpp.o
Compiling .pioenvs/tmp1/src/main.cpp.o
Building .pioenvs/tmp1/bootloader.bin
Creating esp32 image...
Successfully created esp32 image.
Generating partitions .pioenvs/tmp1/partitions.bin
Compiling .pioenvs/tmp1/FrameworkArduino/Esp.cpp.o
Compiling .pioenvs/tmp1/FrameworkArduino/FirmwareMSC.cpp.o
Compiling .pioenvs/tmp1/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling .pioenvs/tmp1/FrameworkArduino/HWCDC.cpp.o
Compiling .pioenvs/tmp1/FrameworkArduino/HardwareSerial.cpp.o
Compiling .pioenvs/tmp1/FrameworkArduino/IPAddress.cpp.o
In file included from src/esphome.h:3,
                 from src/main.cpp:3:
src/esphome/components/ble_adv_light/ble_adv_light.h:94:58: error: expected template-name before '<' token
 template<typename... Ts> class PairAction : public Action<Ts...> {
                                                          ^
src/esphome/components/ble_adv_light/ble_adv_light.h:94:58: error: expected '{' before '<' token
src/esphome/components/ble_adv_light/ble_adv_light.h:106:60: error: expected template-name before '<' token
 template<typename... Ts> class UnpairAction : public Action<Ts...> {
                                                            ^
src/esphome/components/ble_adv_light/ble_adv_light.h:106:60: error: expected '{' before '<' token
Compiling .pioenvs/tmp1/FrameworkArduino/IPv6Address.cpp.o
Compiling .pioenvs/tmp1/FrameworkArduino/MD5Builder.cpp.o
*** [.pioenvs/tmp1/src/main.cpp.o] Error 1
aronsky commented 3 months ago

OK, I got it. Your original configuration is fine - but the code in this repo (specifically, the part that generates the error - the Action class - depends on Home Assistant API. So, the quick fix for you is to enable the Home Assistant API (just add a line containing api: to your original configuration, see here for more details).

The long-term fix is to update the code in this repo and enable the PairAction/UnpairAction conditionally, only when Home Assistant API is enabled in config. I'll try to do it soon.

mak-42 commented 3 months ago

I've temporary added "api" component. I confirm it works with it. I managed to add and control Estares TETRA (lampsmart_pro type). You should add "bleadvlight.pair" and "bleadvlight.unpair" actions to the component description as well.