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 sun2000-modbus to latest (replacement for #3007) #3038

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

mcm1957
Copy link
Collaborator

@mcm1957 mcm1957 commented Dec 6, 2023

@daolis
This is a replacement PR for #3007 which has been closed due to merge conflicts causing reasonable wrong positives

@github-actions github-actions bot added the auto-checked This PR was automatically checked for obvious criterias label Dec 6, 2023
@mcm1957 mcm1957 added the (RE-)REVIEW pending (mcm1957) Changes requested by review have been applied, re-review could be done. label Dec 6, 2023
@mcm1957
Copy link
Collaborator Author

mcm1957 commented Dec 6, 2023

@daolis

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

  • unusual usage of admin columns

    Usage of adminColumns is very unusual. It looks like you are trying to display configuration data. As space at objects tab is very limits adminCOlumns sholud be used only if they provide a big beneit for users. Headers must be as short as possible and not be longer than typical data.
    I suggest to remove adminColumns completly for this adapter. Otehrwise please specify why you think thea provide what benefit to users.

  • avoid usage of setObject

    setObject(Async) creates a new object whenever it is called. You should avoid using setObject unless you really want to create new objects. Creating a new object deletes any userConfig, i.e. configures history logging which is most likely not desired. Most likely either setObjectNotExists oder (even better in most cases) extendObject should be used. Extend Object ensures that attributes like role, read/write flag etc. are set as specified and hence extendObjet shul dbe preferred when called onece during startup of the adapter.

    see https://github.com/daolis/ioBroker.sun2000-modbus/blob/bef1ac1388cf1f0893abd48f820bd38a703d4912/src/lib/states.ts#L283

  • unused onStateChange handler

    You configred an onStateChange handler but it looks like this handler does not do any important tasks. Please remove the handler if the adapter does not react on state changes.

  • 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) whnever a dedicated role exists.

    model name should be info.name
    serial number should be info.serial
    etc.

    writeable states make no sense as no processing is implemented, i.e.
    https://github.com/daolis/ioBroker.sun2000-modbus/blob/bef1ac1388cf1f0893abd48f820bd38a703d4912/io-package.json#L288

    Please review and check all roles.

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!

@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 Dec 6, 2023
@mcm1957
Copy link
Collaborator Author

mcm1957 commented Dec 25, 2023

@daolis
Any news?
Do you need help?
reminder 01.01.2024

daolis added a commit to daolis/ioBroker.sun2000-modbus that referenced this pull request Jan 8, 2024
* Added storage CurrentDayChargeCapacity and CurrentDayDischargeCapacity
* Changes from [Add sun2000-modbus to latest](ioBroker/ioBroker.repositories#3038)
@daolis
Copy link
Contributor

daolis commented Jan 8, 2024

@mcm1957 Merged and created release 0.0.2

@github-actions github-actions bot added *📬 a new comment has been added 31.1.2024 and removed 31.1.2024 labels Jan 8, 2024
@github-actions github-actions bot deleted a comment from mcm1957 Jan 8, 2024
Copy link

github-actions bot commented Jan 8, 2024

Automated adapter checker

ioBroker.sun2000-modbus

Downloads Number of Installations (latest)
NPM

👍 No errors found

  • 👀 [W400] Cannot find "sun2000-modbus" in latest repository

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

@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 labels Jan 8, 2024
@mcm1957 mcm1957 merged commit dfed6b5 into master Jan 8, 2024
32 checks passed
@mcm1957
Copy link
Collaborator Author

mcm1957 commented Jan 8, 2024

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

@daolis
Copy link
Contributor

daolis commented Jan 9, 2024

Thank you Martin for the support!

@github-actions github-actions bot added the *📬 a new comment has been added label Jan 9, 2024
@mcm1957 mcm1957 removed the *📬 a new comment has been added label Jan 9, 2024
@mcm1957 mcm1957 deleted the mcm1957-patch-40 branch January 11, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-checked This PR was automatically checked for obvious criterias lgtm Looks Good To Me
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants