Open boeserwolf opened 6 years ago
I was unable to discover devices when running your branch. Using the master branch I was able to use the Echo to discover the devices. At that point I was able to use your branch with the state handler working as expected.
@boeserwolf can you address the comments from @cchampignon? I will try to get some time to test this also. Sorry it has been 6 months since you committed.
@dsandor My apologies, I just lacked some spare time to re-check, I will look into it tomorrow as we have a public holiday over here.
@dsandor @cchampignon I merged the latest master branch and did some in-depth testing. Discovering devices using the Alexa App and the Echo device works perfect for me. Please also bear in mind, that I did not modify anything regarding the discovery.
@cchampignon Could you please test the changes again, and, if the issue continues to exist, tell me more about your discovery procedure and environment (which Echo Gen., etc.)? Thanks in advance.
@dsandor I see you accepted another PR addressing the same issue, was anything wrong with this approach? :thinking:
Previous actions are stored in a (volatile) map "lastKnownDeviceStates".
If a "GetBinaryState" request was received, try to get the current device state by calling the custom handler function
device.getStateHandler
.If no custom handler function was defined or it returns
undefined
, return the remembered state for the device using the maplastKnownDeviceStates
.In any doubt, just return "0" (off).