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 dreame adapter to latest #4416

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add dreame adapter to latest #4416

wants to merge 1 commit into from

Conversation

TA2k
Copy link
Contributor

@TA2k TA2k commented Dec 28, 2024

No description provided.

@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 *📬 a new comment has been added labels Dec 28, 2024
@github-actions github-actions bot deleted a comment from TA2k Dec 28, 2024
@github-actions github-actions bot deleted a comment from TA2k Dec 28, 2024
Copy link

Automated adapter checker

ioBroker.dreame

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

👍 No errors found

  • 👀 [W401] Cannot find "dreame" in latest repository
  • 👀 [W515] Why did you decide to disable i18n support?

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

@mcm1957 mcm1957 added new at LATEST REVIEW pending (by mcm1957) 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 labels Dec 28, 2024
@mcm1957
Copy link
Collaborator

mcm1957 commented Dec 28, 2024

reminder 4.1.2025

@github-actions github-actions bot added the 4.1.2025 remind after 4.1.2025 label Dec 28, 2024
@mcm1957
Copy link
Collaborator

mcm1957 commented Jan 22, 2025

To verify the Object structure of this adapter during REVIEW please export the object structure of a working installation and attach the file i. You find a guide how to export the object struture here: https://github.com/ioBroker/ioBroker.repochecker/blob/master/OBJECTDUMP.md

Thanks

@TA2k
Copy link
Contributor Author

TA2k commented Jan 24, 2025

dreame.0.json

@github-actions github-actions bot added the *📬 a new comment has been added label Jan 24, 2025
@mcm1957
Copy link
Collaborator

mcm1957 commented Jan 25, 2025

@TA2k

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 oppinion. @Apollon77 might have additional suggestions or even a different oppinion 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 should contain a link to the manufacturer and/or device

    The README.md of any adapter related to device or m ultiple devices of a manufacturer should contain a link the manufacturers website and/or to a description of the device. This is to anable new users to easily check wether they associate the adapter with the correct device(s). (See https://github.com/ioBroker/ioBroker.repositories#requirements-for-adapter-to-get-added-to-the-latest-repository paragraph 4.)

  • setObjectNotExists is not synchronous

    setObjectNotExists is an asynchronous function despite its name. Only the callback (not used by your code) is guaranteed to be executed after creation of the object. So please evalute wether ist really save to use setObjectNotExists without a callback. You may use setObjectNotExistsAsync with await or use await together with setObjectNotExists when reuiring js.controller 7.0.4 minimum (https://github.com/ioBroker/ioBroker.js-controller/blob/master/CHANGELOG.md#704-2024-12-04---lucy)

    Please adapt as most likely no other mechanismen than timings will gurantee that objects are really cerated befor first usage.

  • setState is not synchronous

    setState is an asynchronous function too. The ste need not be store when the function returns. Please evaluate if an asynchronous operation is ok (setting an state fully asynchronous might be ok) or use await. see https://github.com/TA2k/ioBroker.dreame/blob/a7036514ce714d7ce40e0ded3337d382509818df/main.js#L825

  • invalid characters should be filtered from object ids

    Some characters are not allowed to be used as part of an object id. If an object id is not hardcoded or even depending on user input you should ensure that such an object id does not contain an invalid character. Iobroker provides the constant adapter.FORBIDDEN_CHARS, i.e. by using the following snippet:

    function name2id(pName) {
        return (pName || '').replace(adapter.FORBIDDEN_CHARS, '_');
    }
    

    You retrieve the deviceId directly from the external cloud. This information is used as objectIds. So please filter the received information to ensure that no illegal characters ar contained.

  • some objects are missing

    all intermediate objects must be created.

    • dreame.0.XXXXXXXX.general.deviceInfo.defaultVendors
    • dreame.0.XXXXXXXX.general.deviceInfo.extendScType
    • dreame.0.XXXXXXXX.map.cleanset.2
    • possibly more

    are not created. Please check / add creation.

  • 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.

    Some notes:

  • XXXXXXXX.map.cleanset.2.RoomOrder is writeable, so it should be level (value required write:false)

  • role 'array' does not exist. Please change.

  • linter setup

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

    This is a suggestion only and not blocking. Decision is up to maintainer.

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 1.2.2025

@github-actions github-actions bot added 1.2.2025 remind after 1.2.2025 and removed 4.1.2025 remind after 4.1.2025 labels Jan 25, 2025
@mcm1957 mcm1957 added must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review and removed *📬 a new comment has been added REVIEW pending (by mcm1957) 1.2.2025 remind after 1.2.2025 labels Jan 25, 2025
@github-actions github-actions bot added the 1.2.2025 remind after 1.2.2025 label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.2.2025 remind after 1.2.2025 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 new at LATEST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants