-
Notifications
You must be signed in to change notification settings - Fork 130
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
Insteon: MH Should React to AllLink Broadcast Messages #153
Comments
I think the code for processing the second event (i.e. direct-cleanup) could just compare the current state to the new state and only update if the two do not match. Effectively “state” is the flag you describe. |
I thought about that, but it would create the possibility of a quirk. So two options:
Neither are ideal, what do you think? On Sun, Apr 7, 2013 at 7:06 AM, Michael Stovenour
|
Fixes issue hollie#153 The set routine is now called when a broadcase message is received. The flag _pending_cleanup is also set. When a Direct Cleanup Message is received, if the state of the device matches the pending state and the _pending_cleanup flag is set, we assume that this command was already processed. This code is all adjacent to each other, so using a flag should not be confusing. Much of the code was already there, but was commented out by Gregg in his first commit of the new insteon code. This initial commit included a huge number of changes and no notes were added as to why this was disabled in the redux.
Currently MH ignores the AllLink Broadcast message knowing that a direct-cleanup message containing the same information will arrive shortly thereafter. Unfortunately, the direct-cleanup messages are lost sometimes. Moreover, in a large scene, it may take many seconds for the direct-cleanup message to arrive and so it may be preferable for MH to react to the broadcast message to be more "in-sync" with the timing of things.
Some consideration should be given to preventing duplicate calls to set the state of the device. Perhaps a flag that tracks the time when an alllink broadcast message is received and if a matching direct-cleanup message is received within a specified number of seconds no subsequent call to the set routine is made?
The text was updated successfully, but these errors were encountered: