Closed nishanthhegde closed 5 years ago
I think you misunderstand the Promie resolvement here. The "response" only tellss you that the command was really send out to the device. Alternatively the call is rejected on error.
If you want to verify that the device reacted correctly to the call you need to add more logic.
I would consider this as a "not an issue" for the library
can you please tell me what should i do in order to check if the device reacted properly? @Apollon77
// Set default property to opposite if (!stateHasChanged) { device.set({set: !(data.dps['1'])});
// Otherwise we'll be stuck in an endless
// loop of toggling the state.
stateHasChanged = true;
here- device.set({set: !(data.dps['1'])}); is doing nothing.
@nishanthhegde just call device.get()
after setting the device to confirm that it now has the intended state.
Thanks for helping out @Apollon77.
Connect to the switch using the tuyapi and change the status of the switch To Reproduce Steps to reproduce the behavior:
Expected behavior Switch should change the status if 'true' then switch ON and if 'false' then OFF.
P.S. I'm not an expert in this field , it would really help if there is any solution to this issue.