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

Problems using "ZeroCode" function with 2 or more Switches. #298

Closed ph0xyz closed 1 year ago

ph0xyz commented 1 year ago

Original Code from Website:

SinricProSwitch& mySwitch1 = SinricPro[SWITCH_ID_1];
  mySwitch1.onPowerState(onPowerState1);

  SinricProSwitch& mySwitch2 = SinricPro[SWITCH_ID_2];
  mySwitch**1**.onPowerState(onPowerState2);

should be changed to the following

SinricProSwitch& mySwitch1 = SinricPro[SWITCH_ID_1];
  mySwitch1.onPowerState(onPowerState1);

  SinricProSwitch& mySwitch2 = SinricPro[SWITCH_ID_2];
  mySwitch**2**.onPowerState(onPowerState2);
kakopappa commented 1 year ago

hi @anumpho

Thanks for reporting this issue. I have fixed it now.

ph0xyz commented 1 year ago

Great, thanks for the fast response!