-
Notifications
You must be signed in to change notification settings - Fork 57
Added resetAutoReleaseOnDetection property to sensors #169
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
base: master
Are you sure you want to change the base?
Conversation
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.
Please correct the commented lines.
} | ||
|
||
HttpWebHookSensorAccessory.prototype.setAutoReleaseTimeout = function () { | ||
if (!this.autoRelease || !this.resetAutoReleaseOnDetection) return; |
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.
This prevents autoreleases if not resetAutoReleaseOnDetection
is set. The flag resetAutoReleaseOnDetection
should be handled as optional.
|
||
HttpWebHookSensorAccessory.prototype.setAutoReleaseTimeout = function () { | ||
if (!this.autoRelease || !this.resetAutoReleaseOnDetection) return; | ||
clearTimeout(this[this.getTimeoutKey()]); |
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.
Clearing and resetting timeout should only be done if resetAutoReleaseOnDetection
is true. Otherwise it should always add the timeout as before, so nothing break.
HttpWebHookSensorAccessory.prototype.setAutoReleaseTimeout = function () { | ||
if (!this.autoRelease || !this.resetAutoReleaseOnDetection) return; | ||
clearTimeout(this[this.getTimeoutKey()]); | ||
this[this.getTimeoutKey()] = setTimeout(this.resetToInitialState.bind(this), this.autoReleaseTime); |
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.
See comment above.
@Kellojo in case you did not see it, I requested some changes... |
Solving #168