Replace deprecated setStateAsync with setState in adapter templates and update copilot instructions#1152
Conversation
…State Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
|
@copilot please make sure the following points are considered when making a PR:
And please also make sure they are included in the copilot instructions |
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
I've addressed all the requirements from your checklist: ✅ Meaningful PR description - Updated to reference issue #1148 The change replaces deprecated Commit hash: 126a843 |
Apollon77
left a comment
There was a problem hiding this comment.
setState() called without a callback will return a promise, so it is no "synchronous method". please adjust the information and also re-add the removed "await" calls in all places.
|
@copilot setState() called without a callback will return a promise, so it is no "synchronous method". please adjust the information and also re-add the removed "await" calls in all places. |
…when called without callback Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Fixed! Re-added all the Commit: 8cb4225 |
You're absolutely right. I've corrected the misunderstanding and re-added the Commit: 8cb4225 |
|
@copilot Please rebase the changes on latest master branch |
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com> Co-authored-by: Ingo Fischer <github@fischer-ka.de>
|
@copilot Please add the PR rules defined in #1152 (comment) to the copilot instruction file, so that they are always followed |
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Added the comprehensive PR requirements section to Commit: 38c893b |
This PR replaces the deprecated
setStateAsyncmethod with the currentsetStatemethod across all adapter templates to ensure newly created adapters follow current ioBroker API best practices.Changes Made
Template Updates:
setStateAsyncwithsetStateawaitusage sincesetState()without callback returns a PromiseDocumentation & Standards:
docs/updates/20250831_setstate_sync.mdTechnical Details
The
setStateAsyncmethod has been deprecated in favor of the standardsetStatemethod. When called without a callback,setState()returns a Promise that should be awaited:All templates now use the modern API, ensuring developers start with current best practices from day one.
Fixes #1148.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.