KaufHA / PLF10

Files for the PLF10 Power Monitoring Smart Plug.
26 stars 15 forks source link

Unable to compile kauf-plug-lite.yaml #12

Closed robgregg96 closed 1 year ago

robgregg96 commented 1 year ago

I was testing out the different versions of the yaml files that you have provided and I am unable to compile with kauf-plug-lite.yaml. My system is using ESPHome v2022.12.1 that was released today.

I get the following error:

Compiling .pioenvs/kauf-plug-0ad993/src/main.cpp.o
/config/.esphome/packages/a0579e33/kauf-plug-lite.yaml: In lambda function:
/config/.esphome/packages/a0579e33/kauf-plug-lite.yaml:722:39: error: 'GPIO_SWITCH_RESTORE_DEFAULT_OFF' is not a member of 'esphome::gpio'
  722 |             relay->set_restore_mode(gpio::GPIO_SWITCH_RESTORE_DEFAULT_OFF);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/config/.esphome/packages/a0579e33/kauf-plug-lite.yaml:724:39: error: 'GPIO_SWITCH_RESTORE_INVERTED_DEFAULT_OFF' is not a member of 'esphome::gpio'
  724 |             relay->set_restore_mode(gpio::GPIO_SWITCH_RESTORE_INVERTED_DEFAULT_OFF);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/config/.esphome/packages/a0579e33/kauf-plug-lite.yaml:726:39: error: 'GPIO_SWITCH_ALWAYS_ON' is not a member of 'esphome::gpio'
  726 |             relay->set_restore_mode(gpio::GPIO_SWITCH_ALWAYS_ON);
      |                                       ^~~~~~~~~~~~~~~~~~~~~
/config/.esphome/packages/a0579e33/kauf-plug-lite.yaml:728:39: error: 'GPIO_SWITCH_ALWAYS_OFF' is not a member of 'esphome::gpio'
  728 |             relay->set_restore_mode(gpio::GPIO_SWITCH_ALWAYS_OFF);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~
/config/.esphome/packages/a0579e33/kauf-plug-lite.yaml:730:39: error: 'GPIO_SWITCH_RESTORE_DEFAULT_ON' is not a member of 'esphome::gpio'
  730 |             relay->set_restore_mode(gpio::GPIO_SWITCH_$sub_restore_mode);
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*** [.pioenvs/kauf-plug-0ad993/src/main.cpp.o] Error 1

This seems to have changed in: https://github.com/esphome/esphome/commit/c55e01ff3f0f1b62cf1cea0612867f0c2453c3ee if I am reading the code correctly.

I can use kauf-plug.yaml, so there is no rush getting this fixed. Thanks!

bkaufx commented 1 year ago

Thanks for letting me know. I made the change in the main yaml and it slipped my mind that I needed to do the same thing in the lite. Just fixed it.