-
Notifications
You must be signed in to change notification settings - Fork 325
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
Improve Request Queue Behavior #6 #860
Conversation
src/controller/model/device.ts
Outdated
@@ -102,9 +101,19 @@ class Device extends Entity { | |||
set skipDefaultResponse(skipDefaultResponse: boolean) {this._skipDefaultResponse = skipDefaultResponse;} | |||
get skipTimeResponse(): boolean {return this._skipTimeResponse;} | |||
set skipTimeResponse(skipTimeResponse: boolean) {this._skipTimeResponse = skipTimeResponse;} | |||
get defaultSendRequestWhen(): SendRequestWhen {return this._defaultSendRequestWhen;} | |||
set defaultSendRequestWhen(defaultSendRequestWhen: SendRequestWhen) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are only 3 references to this in zigbee-herdsman-converters, could we refactor those and remove this entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be fine for me, too - I just thougt we could give it a little grace period, remove the 3 occcurrences (and maybe also all occurrences of sendWhen
) and then remove the adapters.
Should I better remove it right away and prepare a PR for zhc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it right away, I will merge the PRs at the same time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, corresponding zhc PR is here: Koenkk/zigbee-herdsman-converters#6865
This reverts commit 8200aea.
const request = new Request(func, frame, this.getDevice().pendingRequestTimeout, options.sendWhen, | ||
options.sendPolicy); | ||
|
||
if(options.sendWhen) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also remove this part? (maybe in a next PR?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely! And yes, that will be another PR:-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for your dedication 😄
Thanks! I think the |
This is the 6th and final PR in a series to implement Koenkk/zigbee2mqtt#17177.
It removes the special behavior for
sendWhen=fastpoll
devices (568abc3). I.e. the same queue behavior is now consistently used for all devices according to theirpendingRequestTimeout
and per-requestsendPolicy
.The rest of the PR is cleanup: After the removal of the special behavior,
sendWhen
is not used anywhere any more and therefore I removed it from the request queue. To maintain backwards compatibility, I added conversion functions for the public interfaces. I also added tests for these functions and removed some other now-obsolete tests.