vintlabs / fauxmoESP

Add voice control of your ESP32 and ESP8266 devices using Amazon Alexa
MIT License
391 stars 71 forks source link

setState() callback broken #159

Open Miq1 opened 3 years ago

Miq1 commented 3 years ago

I upgraded to the recent Fauxmo 3.2 version and discovered that the callback signature for the setState() callback seems to have been changed, preventing my application from being compiled.

Where can I find a documentation on how to interpret the additional 3 unsigned int values?

For the time being I added those with a default = 0, but am not sure if the remainder will behave as before?

sebkouba commented 3 years ago

Where do you see the additional unsigned int values? I see and use this onSetState() function. fauxmo.onSetState([](unsigned char device_id, const char * device_name, bool state, unsigned char value)

Miq1 commented 3 years ago

Where do you see the additional unsigned int values? I see and use this onSetState() function. fauxmo.onSetState([](unsigned char device_id, const char * device_name, bool state, unsigned char value)

In fauxmoESP.h line 103 we have

 void onSetState(TSetStateCallback fn) { _setCallback = fn; }

TSetStateCallback is typedef'd in line 75:

typedef std::function<void(unsigned char, const char *, bool, unsigned char, unsigned int, unsigned int, unsigned int)> TSetStateCallback;
pvint commented 3 years ago

Are you using the latest master branch in git? If so, that's my fault.

In making changes to add ability to change colours I think there's still an incorrectly overloaded function. I've been thinking that I didn't like the way I implemented the interface for changing colours and will likely roll it back.

For now, if you're using git, try checking out the source at commit 74a69c9

Miq1 commented 3 years ago

I think I do use the master branch indeed. I am using Platformio for development and that hinted me to the library update after that I got the error on using the older onSetState function signature.