Andre-Schuiki / esphome_im350

GNU General Public License v3.0
13 stars 8 forks source link

ESPHome example not building: error in main.cpp:15:1 siemens_im350 does not name a type #1

Open amueller80 opened 3 years ago

amueller80 commented 3 years ago

Hi Andre,

I used your ESPHome example and when building I get the message src/main.cpp:15:1:error siemens_im350 does not name a type

I do not know if it matters, but the autogenerated main.cpp includes the siemens_im350.h last in the autogenerated header block. , after the definition of *siemens_im350_smartmetersnsorComponent, etc.

Do you have an idea?

Best Regards, Armin

grisu122 commented 2 years ago

I had the same issue and I belive I found a solution for it.

  1. Following include line in the YAML file is not neccessary and responsible the #include "siemens_im350.h" at then end of AUTO GENERATED INCLUDE BLOCK of main.cpp. So you can savely delete it.
    includes:
      - custom_components/siemens_im350/siemens_im350.h
  2. To get the project building you have to add an empty __init__.py file into component folder /custom_components/siemens_im350.