Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: call of overloaded 'millis()' #18

Open
oli82 opened this issue Aug 15, 2023 · 4 comments · May be fixed by #23
Open

error: call of overloaded 'millis()' #18

oli82 opened this issue Aug 15, 2023 · 4 comments · May be fixed by #23

Comments

@oli82
Copy link

oli82 commented Aug 15, 2023

Hi.
I try to compile your code with esphome 2023.7.1 and get errors like that:

src/esphome/components/junctek_kgf/junctek_kgf.cpp: In member function 'void JuncTekKHF::handle_settings(const char*)': src/esphome/components/junctek_kgf/junctek_kgf.cpp:91:33: error: call of overloaded 'millis()' is ambiguous this->last_settings_ = millis(); ^ In file included from /config/.esphome/platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:36, from .piolibdeps/junctek-khf/ArduinoJson/src/ArduinoJson/Configuration.hpp:156, from .piolibdeps/junctek-khf/ArduinoJson/src/ArduinoJson.hpp:7, from .piolibdeps/junctek-khf/ArduinoJson/src/ArduinoJson.h:9, from src/esphome/components/json/json_util.h:11, from src/esphome/core/string_ref.h:10, from src/esphome/core/entity_base.h:5, from src/esphome/components/sensor/sensor.h:5, from src/esphome/components/junctek_kgf/junctek_kgf.h:4, from src/esphome/components/junctek_kgf/junctek_kgf.cpp:1: /config/.esphome/platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:131:15: note: candidate: 'long unsigned int millis()' unsigned long millis(); ^~~~~~ In file included from src/esphome/components/uart/uart.h:5, from src/esphome/components/junctek_kgf/junctek_kgf.h:5, from src/esphome/components/junctek_kgf/junctek_kgf.cpp:1: src/esphome/core/hal.h:37:10: note: candidate: 'uint32_t esphome::millis()' uint32_t millis(); ^~~~~~ src/esphome/components/junctek_kgf/junctek_kgf.cpp: In member function 'void JuncTekKHF::handle_status(const char*)': src/esphome/components/junctek_kgf/junctek_kgf.cpp:133:30: error: call of overloaded 'millis()' is ambiguous this->last_stats_ = millis(); ^ In file included from /config/.esphome/platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:36,

Can you help me to get rid of this errors?

Thanks, Oli

@krasa
Copy link

krasa commented Oct 4, 2023

krasa@21a3f79

@Arnix11
Copy link

Arnix11 commented Nov 24, 2023

Hi Oli,
I try to compile your code with esphome 2023.7.1 and get error like that:

INFO ESPHome 2023.11.4
INFO Reading configuration /config/esphome/esphome-web-daa12b.yaml...
Failed config

sensor.junctek_khf: [source /config/esphome/esphome-web-daa12b.yaml:40]

[ah_total_used] is an invalid option for [sensor.junctek_khf]. Please check the indentation.
ah_total_used:
name: junctek1_ah_total_used

Can you help me repair this error?
Thanks.
Arnold.

@ldiegos
Copy link

ldiegos commented Jan 11, 2024

Same error with millis() stuff... but following @krasa I forked the project and add the esphome:: to my project and linked it to the esphome HA... is compiling fine now.

Thanks a lot @krasa !

@jbergler jbergler linked a pull request Mar 6, 2024 that will close this issue
@jbergler
Copy link

jbergler commented Mar 6, 2024

@krasa's fix does indeed work, but I can't seem to use the rest of the repo for some reason I haven't had time to debug.

@tfyoung I opened a PR that addresses the compilation issues without the other changes in @krasa's fork, if you'd be open to merging #23 it would make the component usable again.

In the meantime, it's easy to use this PR like so

external_components:
  - source:
      type: git
      url: https://github.com/tfyoung/esphome-junctek_kgf.git
      ref: pull/23/head
    components: [junctek_kgf]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants