How to access Wire.h in an external component?

I’m creating an external component for the Adafruit NeoTrellis keypad using their (Arduino) libraries. I’ve heavily leveraged the internal matrix_keypad component as an example, simplifying it greatly as the NeoTrellis does most of the grunt work using I2C. The only build error I’ve been unable to get past is Wire.h: No such file or directory from one of the headers in the Adafruit libraries included using cg.add_library(). I could assume Wire should be somewhere in the standard path for header files, but apparently not. How do I connect these Adafruit libraries to Wire.h? Is there another library I need to add in the __init__.py?

I asked the same question on r/Esphome and got the answer:
cg.add_library(“Wire”, None)

How did you go with creating the external component for the neotrellis? It’s the only non-esphome homemade device I have currently running, I’m keen to get it into esphome!

I’ll publish it on GitHub in a few days after cleaning it up.

Legend. thx.

See my post…

1 Like