ratgdo / esphome-ratgdo

ratgdo for ESPHome
GNU General Public License v2.0
357 stars 108 forks source link

Compilation fails with custom config that doesn't include dry-contact sensors #264

Closed kpfleming closed 4 months ago

kpfleming commented 7 months ago

I use my own config (not the ones from this repo), and I don't have any dry-contact connections to my board, so none of those components are present in my configuration.

Since the dry-contact code was merged into the main branch, compilation fails with my configuration because the code assumes that gpio_binary_sensor.h will be available, but it is not unless at least one platform: gpio binary_sensor has been included in the YAML configuration.

ESPHome generally solves this problem by providing USE_<foo> defines, but there is no USE_GPIO_BINARY_SENSOR define at this time. I'll work with the ESPHome team to see if this can be added, and if so I'll submit a PR to this repository to make use of it.

As a workaround, this can be added to the YAML configuration:

  # Dummy sensor to fix compile issues
  - platform: gpio
    id: dummy
    pin: D3
    internal: true
zd3sf commented 6 months ago

That solved my problem. I also have a custom YAML with no dry contacts. adding this per suggestion worked:

binary sensor:
  - platform: gpio
    id: dummy
    pin: D3
    internal: true