I’m trying to use some LD017 code on an ESP32C6. The linked code snippet compiles just fine in HA supervised install ESPHome 2024.6.4 but throws a warning and fails in W10 with ESPHome 2024.6.4 in CLI.
c6test.yaml: In lambda function:
c6test.yaml:71:33: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
I don’t code for a living and it’s been 20 years since I’ve taken any Computer Science classes. What am I missing here?
For future reference… the more information the easier it is to get help and its faster. With such little information to go on, people are going to have to play, “ask 50 questions” to figure out what youve got going on.
Post your config. “Your” config, not a link to some code you copied and pasted. Maybe thats all the code you added and maybe its not, no one knows and for all we know, you’ve got another 50 lines of yaml that no one knows about and could be the problem.
Secondly, people want to help you so do them a courtesy and post it here so people dont have to go elsewhere to see the config and potentially bounce back and forth to look at the config and then back here to ask a question, etc. when its a matter of copy/paste to put it in your post. Atleast for me, i like helping people up untill i have to jump through hoops to do it.
Help us help you! The more information the better.
The mystery is how it compiles on linux, but not on windows.
As well as posting your yaml, it may pay to do a “clean” on windows and try again.
The other thing is that there may be a difference in how windows parses your yaml file vs linux, including the dreaded line ending bug that windows introduced all those years ago.