motwok / thisandthat

Just a collection of mixed things
GNU General Public License v3.0
10 stars 6 forks source link

Compile time errors with esphome #2

Open vks007 opened 1 year ago

vks007 commented 1 year ago

Hi @motwok , firstly thank you for the wonderful work. I have my own code that I have been using with espnow for a long time now but seeing the possibility of using it as a esphome component is exciting. I know you commented on the esphome integration discussion that you dont have enough bandwidth to look into this but is it possible for you to guide as to how can I remove the compile time errors I am getting so that I can do some experiments with this library.

I am using the latest version of ESPHome v2022.12.3 , when I compile a simple program I get the following errors:

Compiling /data/wifi-now-receiver/.pioenvs/wifi-now-receiver/src/esphome/core/application.cpp.o Compiling /data/wifi-now-receiver/.pioenvs/wifi-now-receiver/src/esphome/core/component.cpp.o In file included from src/esphome/components/wifi_now/receive_trigger.h:7, from src/esphome/components/wifi_now/receive_trigger.cpp:1: src/esphome/core/base_automation.h: In member function 'bool esphome::ForCondition<Ts>::check_internal()': src/esphome/core/base_automation.h:71:30: error: there are no arguments to 'millis' that depend on a template parameter, so a declaration of 'millis' must be available [-fpermissive] 71 | this->last_inactive_ = millis(); | ^~~~~~ src/esphome/core/base_automation.h:71:30: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) src/esphome/core/base_automation.h: In member function 'bool esphome::ForCondition<Ts>::check(Ts ...)': src/esphome/core/base_automation.h:78:12: error: there are no arguments to 'millis' that depend on a template parameter, so a declaration of 'millis' must be available [-fpermissive] 78 | return millis() - this->last_inactive_ >= this->time_.value(x...); | ^~~~~~ *** [/data/wifi-now-receiver/.pioenvs/wifi-now-receiver/src/esphome/components/wifi_now/receive_trigger.cpp.o] Error 1 ========================= [FAILED] Took 57.92 seconds =========================

the program I am using is:

` substitutions: device_id: 'wifi-now-receiver' device_name: 'Wifi Now Receiver' platform: ESP8266 board: d1_mini ssid: !secret primary_ssid ssid_pswd: !secret primary_ssid_pswd api_pswd: !secret api_pswd ota_pswd: !secret ota_pswd static_ip: !secret IP_wifi_receiver

esphome: <<: !include common/esphome.yaml

logger:

<<: !include common/common.yaml # cant use common file as I have to define my api below

wifi: <<: !include common/wifi.yaml

api: <<: !include common/api.yaml

wifi_now: channel: 11 peers: