sinricpro / esp8266-esp32-sdk

Library for https://sinric.pro - simple way to connect your device to Alexa, Google Home, SmartThings and cloud
https://sinric.pro
228 stars 121 forks source link

Fan library example issue #262

Closed Jad7x closed 2 years ago

Jad7x commented 2 years ago

Hello!

I'm trying to compile the fan example, chaging olny the credentials infos and I get this errror:

"invalid conversion from 'bool ()(const String&, const String&, int&)' to 'SINRICPRO_2_9_16::AdjustRangeValueCallback {aka bool ()(const String&, int&)}' [-fpermissive]"

Arduino IDE 1.8.19 Sinricpro 2.9.16 ArduinoJason 6.19.3 WebSockets 2.3.6

sivar2311 commented 2 years ago

Please check your changes on the sample code. The example compiles without problems. Please note that the onAdjustRangeValue function only needs the parameters deviceId (const String&) and rangeValueDelta (int&). However, you still use an additional parameter of the type const String&.

Maybe you mixed your code with another one that uses the generic RangeController? This one needs an additional parameter of the type const String&.

Jad7x commented 2 years ago

Thanks a lot! I opened the original sample code and realized that the "&" character from rangeValueDelta was missing, so I just added it and no more error.

sivar2311 commented 2 years ago

I am glad that you have found the cause of the error and everything is working now.