feat: added more granular control for the discovery process#32
Conversation
8c470e3 to
c7e3fb4
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ben <43026681+bwp91@users.noreply.github.com>
This comment was marked as outdated.
This comment was marked as outdated.
…ress, deleted async keywords
This comment was marked as outdated.
This comment was marked as outdated.
… stopDiscovery method
90060f6 to
7298ed1
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
README.md:43
- There's a spelling error: "settings" should be "setting". The text should read "by setting the autoStartDiscovery property".
It's possible to control the discovery process manually, by settings the `autoStartDiscovery` property to `false` and then calling `this.hapClient.startDiscovery(discoveryTimeout?: number)` when ready. If no timeout is provided to the function, the `discoveryTimeout` property will be used from the `config` object, and if that is not provided either, the default discovery timeout (60 seconds) will be used.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
One thing came to my mind: I missed adding the |
ah can you please create another PR against the |
Yes, of course. Here it is: #33 |
|
@kovapatrik this is all included in |
Yeah, sure! I won't be able to test it this weekend, but at the start of next week I will. |
♻️ Current situation
Currently, the discovery process is auto-started with the default 1 minute timeout, whenever
HapClientis created. There should be a way to control this process more granular.💡 Proposed solution
The
configobject got extended with 2 new field:autoStartDiscovery: controls, whether the discovery process should start upon creating theHapClient, defaults totruediscoveryTimeout: set the default discovery timeout, defaults to 60000 msWith these defaults,
HapClientbehave like it does now, so it won't break current usages of the package.⚙️ Release Notes
I've modified the changelog in this PR.
➕ Additional Information
-
Testing
I've added no extra tests for this.
Reviewer Nudging
-