-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle "GetBinaryState" requests and cache device states #15
base: master
Are you sure you want to change the base?
Conversation
handle XML responses for GetBinaryState request
Provide an example and description for getSateHandler.
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? 🤔 |
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
, returnthe remembered state for the device using the map
lastKnownDeviceStates
.In any doubt, just return "0" (off).