esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

bk72xx - call of overloaded 'millis()' is ambiguous #6118

Open jon-daemon opened 3 months ago

jon-daemon commented 3 months ago

The problem

I'm using generic-bk7231n-qfn32-tuya as board and I have created a template switch to run some code with lambda. When I'm using millis in lambda and try to compile I get this error

error: call of overloaded 'millis()' is ambiguous

The same code compiles fine on ESP8266, ESP8285 and wr3(rtl87xx).

It compiles fine on bk72xx if I add #define millis() esphome::millis() in lambda. Why is that? Is there any other way to fix it without changing the code? I'm using local packages to add multiple sensors on many devices and I don't want to edit each one every time I make a change.

Which version of ESPHome has the issue?

2024.2.2

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

No response

What platform are you using?

BK72XX

Board

generic

Component causing the issue

millis in lambda

Example YAML snippet

platform: template
id: some_switch
name: my switch
optimistic: true
lambda: |-
  unsigned long current_millis = millis() / 1000;

Anything in the logs that might be useful for us?

No response

Additional information

No response

szupi-ipuzs commented 3 months ago

This looks like an old unresolved issue in libretiny. Maybe you should ask for help there.