Skip to content
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

Add controme to latest #4256

Merged
merged 1 commit into from
Nov 27, 2024
Merged

Add controme to latest #4256

merged 1 commit into from
Nov 27, 2024

Conversation

MadErstam
Copy link
Contributor

Added controme adapter to ioBroker latest repository.

@github-actions github-actions bot added auto-checked This PR was automatically checked for obvious criterias must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review labels Nov 3, 2024
@mcm1957 mcm1957 added (RE-)REVIEW pending (mcm1957) Changes requested by review have been applied, re-review could be done. New at LATEST labels Nov 3, 2024
Copy link

github-actions bot commented Nov 3, 2024

ioBroker repository information about New at LATEST tagging

Thanks for spending your time and providing a new adapter for ioBroker.

Your adapter will get a manual review as soon as possible. Please stand by - this might last one or two weeks. Feel free to continue your work and create new releases. You do NOT need to close or update this PR in case of new releases.

In the meantime please check any feedback issues logged by automatic adapter checker and try to fix them. And please check the following information if not yet done:

You will find the results of the review and eventually issues / suggestions as a comment to this PR. So please keep this PR watched.

If you have any urgent questions feel free to ask.
mcm1957

@simatec Please take a look in respect to responsive design. Thanks

reminder 17.11.2024

@github-actions github-actions bot added *📬 a new comment has been added 17.11.2024 labels Nov 3, 2024
@mcm1957 mcm1957 removed the *📬 a new comment has been added label Nov 3, 2024
@mcm1957
Copy link
Collaborator

mcm1957 commented Nov 3, 2024

Due to outside activities (ioBroker meeting at solingen) this PR will most likely not be processed before 12.11.2024.

@github-actions github-actions bot added the *📬 a new comment has been added label Nov 3, 2024
@github-actions github-actions bot deleted a comment from MadErstam Nov 3, 2024
@github-actions github-actions bot deleted a comment from MadErstam Nov 3, 2024
@github-actions github-actions bot deleted a comment from MadErstam Nov 3, 2024
@simatec
Copy link
Contributor

simatec commented Nov 3, 2024

Except for the i18n translations, the jsonConfig looks good and fulfills all resolutions

@github-actions github-actions bot deleted a comment from MadErstam Nov 4, 2024
@MadErstam
Copy link
Contributor Author

Except for the i18n translations, the jsonConfig looks good and fulfills all resolutions

I18N translations were already directly included in the jsonConfig.json, but were missing the Ukrainian translations. I have added that now in the latest version. Unfortunately, the warning remains. If you could give me a hint how to fix the warning, I would be happy to make these changes.

@mcm1957
Copy link
Collaborator

mcm1957 commented Nov 4, 2024

jsonConfig should use traslation stored at i18n files. (admin/i18n/{lang}.json or admin/i18n/{lang}/translation.json). This enables integration into weblate and usage of dev-tools npm run translate. Direct translations inside jsonConfig is (still) supported but not recommended.

So the warning is correct. Please consider migrating to transaltions located at external files.

@github-actions github-actions bot deleted a comment from MadErstam Nov 4, 2024
@MadErstam
Copy link
Contributor Author

jsonConfig should use traslation stored at i18n files. (admin/i18n/{lang}.json or admin/i18n/{lang}/translation.json). This enables integration into weblate and usage of dev-tools npm run translate. Direct translations inside jsonConfig is (still) supported but not recommended.

So the warning is correct. Please consider migrating to transaltions located at external files.

OK, understood and changed.

@mcm1957 mcm1957 removed the *📬 a new comment has been added label Nov 4, 2024
@mcm1957
Copy link
Collaborator

mcm1957 commented Nov 5, 2024

Sorry, but due to travel / absence I will nozt able to do the review before ioBroker Meeting Solingen next weekend.

@mcm1957 mcm1957 removed the must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review label Nov 5, 2024
@mcm1957 mcm1957 changed the title Add controme adapter to ioBroker latest repository Add controme adapter to latest Nov 24, 2024
@mcm1957 mcm1957 changed the title Add controme adapter to latest Add controme to latest Nov 24, 2024
Copy link

Automated adapter checker

ioBroker.controme

Downloads Number of Installations (latest) - Test and Release
NPM

👍 No errors found

  • 👀 [W401] Cannot find "controme" in latest repository

Add comment "RE-CHECK!" to start check anew

@mcm1957
Copy link
Collaborator

mcm1957 commented Nov 27, 2024

@MadErstam

First of all - THANK YOU for the time and effort you spend to maintain this adapter.

I would like to give some feedback based on my personal opinion. @Apollon77 might have additional suggestions or even a different opinion to one or the other statement. Please feel free to contact him if you cannot follow my suggestions or want to discuss some special aspects.

  • Readme.md needs formatting

    The README.md of this adapter needs formatting. Please check at https://github.com/MadErstam/ioBroker.controme?tab=readme-ov-file#iobrokercontrome. Especially the table of states available is corrupt.

  • package.json should require up to date js-controller and admin version

    New adapters should request js-controller 5 and admin 6 as minimum if there are no strong reason to support (and test) older releases. So please add / adapt at io-package.json:

          "dependencies": [
              {
                  "js-controller": ">=5.0.19"
              }
          ],
          "globalDependencies": [
              {
                  "admin": ">=6.17.14"
              }
          ]
    
  • reevaluate state roles

    Only the values specified here (https://github.com/ioBroker/ioBroker.docs/blob/master/docs/en/dev/stateroles.md) may be used as state roles. Do not invent new names as this might disturb the functionalyity of other adapters or vis.

    In addition the roles MUST match the read/write functionality. As an example a role value.* requires that the state is a readable state. Input states (write only) should have roles like level.*. Please read the description carefully. States with role 'button' should (must) have attribute 'common.read=false' set. A button ( "Taster" in german only triggers when you press but else has no state), so it should also be not readable. This is also like HomeMatic does it. A switch has clear states true or false and so can be read.

    Please avoid using general roles (state, value) whenever a dedicated role exists.

    Role 'value' is reserved for read-only states. Consider using role 'level'if no beeter matching role exists.

  • consider using adapter.setTimeout / this.setTimeout instead of (standard) setTimeout

    The adapter package provides wrapper routines for native setTimeout, setInterval, clearTimeout and clearInterval. Using those routines ensures that timers are cancelled on on load. Additional checks on thomse limits might be performed, too. So consider replacing native setTimeout/clearTimeout by adapter.setTimeout/adapter.clearTimeout or this.setTimeout/this.clearTimeout. The same refers to setInterval/clearInterval.

  • check and limit configurable timeouts / intervals

    Node setTimeout/setInterval routines have a maximum allowed value of 2,147,483,647 ms. Using delays larger than 2,147,483,647 ms (about 24.8 days) result in the timeout being executed immediately. So all (user configurable) values passed to setTimeout / setInterval should be checked in code and limited. Checking/limiting in code is required as config data could be changed directly or by some other adapter too, so limiting at ui level might not be sufficient.

  • unused onMessage handler

    onMessage code seems to not provide any functionality. Please remove unused onMeassge handler from code and config (if enabled there).

  • Why do you set "common.getHistory"

    io-package.json defines 'common.getHistory' as true. I cpould not see any message handler processing such a request. Please check and correct or comment. (https://github.com/MadErstam/ioBroker.controme/blob/f4a22fe1ced429deff16daabefc9e3c0e49960a6/io-package.json#L138)

  • linter setup

    Please use standard iobroker linter setup. This is located at @iobroker/eslint-config. See migration guide at https://github.com/ioBroker/ioBroker.eslint-config/blob/main/MIGRATION.md

Thanks for reading and evaluating this suggestions.
McM1957

Please add a comment when you have reviewed and fixed the suggestionsor at least commented the suggestions and you think the adapter is ready for a re-review!

reminder 11.12.2024

@mcm1957 mcm1957 added must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review and removed (RE-)REVIEW pending (mcm1957) Changes requested by review have been applied, re-review could be done. labels Nov 27, 2024
@github-actions github-actions bot added the 11.12.2024 remind after 11.12.2024 label Nov 27, 2024
@MadErstam
Copy link
Contributor Author

Hi @mcm1957!

Thank you for your comments! I think I fixed all of them. See one deviation to what you recommended regarding package.json below.

I would consider the adapter ready for a re-review!

  • ☑️ Readme.md needs formatting

Done, was an error in the table formatting

  • ☑️ package.json should require up to date js-controller and admin version

Shouldn't these go in io-package.json rather than to package.json? I did not find these two dependencies in any package.json of other adapters I have checked, but rather in io-package.json, where at least the js-controller dependency was already included. Anyway, I have included them now in io-package.json.

  • ☑️ reevaluate state roles

Done and fixed. All state roles should now comply with the requirements. Read/write functionality also now matches to the role.

  • ☑️ consider using adapter.setTimeout / this.setTimeout instead of (standard) setTimeout

Done.

  • ☑️ check and limit configurable timeouts / intervals

Done. The timeout was already limited due to the variable defining the duration having a maximum value. For the interval, I included an upper limit now well below the max delay.

  • ☑️ unused onMessage handler

Done. Was really unused and has been fully removed.

  • ☑️ Why do you set "common.getHistory"

Was really not needed. Removed the setting.

  • ☑️ linter setup

Done and fixed all new lint errors (prettier) and warnings.

@github-actions github-actions bot added the *📬 a new comment has been added label Nov 27, 2024
@mcm1957
Copy link
Collaborator

mcm1957 commented Nov 27, 2024

package.json should require up to date js-controller and admin version

Yes of course. Was a typo in my side. Sorry

@mcm1957
Copy link
Collaborator

mcm1957 commented Nov 27, 2024

Thnaks for ultra fasct reaction and fixes

@mcm1957 mcm1957 added lgtm Looks Good To Me and removed must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review *📬 a new comment has been added 11.12.2024 remind after 11.12.2024 labels Nov 27, 2024
@github-actions github-actions bot added the 11.12.2024 remind after 11.12.2024 label Nov 27, 2024
@mcm1957 mcm1957 merged commit e68d23f into ioBroker:master Nov 27, 2024
58 checks passed
@mcm1957
Copy link
Collaborator

mcm1957 commented Nov 27, 2024

This adapter has been released to latest repository and should be visible within 24h maximum.

Please create a thread at https://forum.iobroker.net/category/91/tester titled like "Test Adapter " to collect some user feedback and provide a link to this topic when requesting addition to stable repository later.

Note: If an other testing topic already exists, it' OK to continue using this topic too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11.12.2024 remind after 11.12.2024 auto-checked This PR was automatically checked for obvious criterias lgtm Looks Good To Me New at LATEST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants