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 lorawan to latest #3224

Merged
merged 1 commit into from
Feb 13, 2024
Merged

Add lorawan to latest #3224

merged 1 commit into from
Feb 13, 2024

Conversation

BenAhrdt
Copy link
Contributor

Please add my adapter ioBroker.lorawan to latest.

This pull request was created by https://www.iobroker.dev c0726ff.

@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 Jan 20, 2024
@mcm1957 mcm1957 added (RE-)REVIEW pending (mcm1957) Changes requested by review have been applied, re-review could be done. and removed must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review labels Jan 20, 2024
@mcm1957
Copy link
Collaborator

mcm1957 commented Jan 20, 2024

reminder 03.02.2024

@BenAhrdt
Copy link
Contributor Author

@mcm1957 muss ich was fixen?

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

mcm1957 commented Jan 21, 2024

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.

You will find the results of the review and evntually issues / suggestings as a communt to this PR. So please keep this PR watched.

If you have any urgent questions feel free to ask.

mcm1957

@BenAhrdt
Copy link
Contributor Author

Hi @mcm1957,
sorry wenn ich nachfrage, aber gibts schon einen Fortschritt?
Ich werde dauernd gefragt :-D

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

mcm1957 commented Jan 27, 2024

Adapter is not yet revied. Hope I can process it next week .
Users can install it from github or npm anyway for testing

@mcm1957 mcm1957 removed the *📬 a new comment has been added label Jan 27, 2024
@BenAhrdt
Copy link
Contributor Author

BenAhrdt commented Feb 1, 2024

Hi. @mcm1957 bist Du weiter gekommen?

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

mcm1957 commented Feb 1, 2024

No, did not have time for review.
Hope I can gest some time tomorrow as next week I do not have time for review for almost sure.

@mcm1957 mcm1957 removed the *📬 a new comment has been added label Feb 1, 2024
@BenAhrdt
Copy link
Contributor Author

BenAhrdt commented Feb 2, 2024

Thanks for the info,
the queries. That would be great.

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

mcm1957 commented Feb 2, 2024

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 is very short

    The README.md of this adapter is very minimalistic. Please add a short description about the functionality of the adpter, add links the the manufacturer site (if applicable) and add a description of the configuration of the adapter. If you provide an external documentation - which should be located at doc/xx directory - please add links to at least the english documentation.

    Someone not familar with lorowan need more information. Please add links to the homepages of the supported networks or some place to get infomation about them

    Please add a short description describing the purpose of the paramaters and where to get them from.

  • [] small typo in german header

image

  • Password field twice?

    Why do you require the password twice? As far as I can guess this is an parameter used to get access to an external system. Duplicate password entry is used for setting up passwords for own servers usually. But that does not seem to be the case here.

  • check admin requirements

    Admin 5.x.x does not provide accordion for sure. Please correct dependency. Check admin releasenotes to get correct value.

  • sensitive information should not be logged into logfile

    To avoid publishing sensitive information when forwarding logs, those information should never be written into the logs but either omitted or at least partly masked so that the information cannot be misused. This relates at least to usernames, passwords, uniqui (user assigned) keys and tokens. In addition personal information like name, address, gegraphical coordinagtes should not be logged too.

    This line https://github.com/BenAhrdt/ioBroker.lorawan/blob/6e3d9bae58e5a828a6d5bc5358833b61c6b16eb7/io-package.json#L155 logs complete config including password. Please filter password (and eventually other sensitive infomration.). As an alternative remove logginng oc config completly as this can be retrieved via ui or dump of system object anyway (without protected data)

  • evaluate subsciptions

    You are subscribing to multipl wildcarded states. This requires js-controller to do some parsing. Maybe ist would be better to subscribe to all states and do filtering locally as this can be processes within the adapter code and process. Evnetually discuss this at telegramm to get feedback from Appollon77

  • 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, '_');
    }
    

    It loks like object Ids are generated from date transmitted frome xternal systems and / or entered by user at UI. Please filter all ids to remove invalid characters. Filtering at UI is insufficient as config could be changed by direct access to system objet and i.e. by import of a configuration.

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

    Why do you recreate the object every time? Why not use extendObject (or setObjectNotExists)?
    https://github.com/BenAhrdt/ioBroker.lorawan/blob/6e3d9bae58e5a828a6d5bc5358833b61c6b16eb7/lib/modules/messagehandler.js#L101

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

    At least here https://github.com/BenAhrdt/ioBroker.lorawan/blob/6e3d9bae58e5a828a6d5bc5358833b61c6b16eb7/lib/modules/messagehandler.js#L101 all objects are created with write:true. Please check whther write:true is really needed / OK. Do you subscribe to all of them?

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 12.2.2024

@mcm1957 mcm1957 removed the (RE-)REVIEW pending (mcm1957) Changes requested by review have been applied, re-review could be done. label Feb 2, 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 12.2.2024 labels Feb 2, 2024
@BenAhrdt
Copy link
Contributor Author

BenAhrdt commented Feb 5, 2024

Hello @mcm1957 & @Apollon77

i have solved all the points of the last comment.

Here my comments to the points:

Readme.md is very short

=> Solved with an first documentation

Password field twice?

=> Solved with just one password

check admin requirements

=> Solved with Setting Admin Version in dependencies to 6.13.15
(is there something plant for the issue, that the admin shows a warning, when accordion is used?)

sensitive information should not be logged into logfile

=> Solved: Log just the accordion parameter

evaluate subsciptions

=> Solved: Subscribe ("*"); and filter in onStateChange

invalid characters should be filtered from object ids

=> Solved: Use the funktion replace(adapter.FORBIDDEN_CHARS;"_");

avoid usage of setObject

=> Solved: Use extendObject

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.

=> Solved:I use only this roles

In addition the roles MUST match the read/write functionality.

=> Solved: eg. button is read = false;

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

Solved: i dont use this

At least here https://github.com/BenAhrdt/ioBroker.lorawan/blob/6e3d9bae58e5a828a6d5bc5358833b61c6b16eb7/lib/modules/messagehandler.js#L101 all objects are created with write:true. Please check whther write:true is really needed / OK. Do you subscribe to all of them?

=> Solved: if i dont use wildcards i subscribe all... (fun). These states are all in folder "control" an where all subscribed and send topics i case of state change

@github-actions github-actions bot added the *📬 a new comment has been added label Feb 5, 2024
@mcm1957 mcm1957 added (RE-)REVIEW pending (mcm1957) Changes requested by review have been applied, re-review could be done. and removed must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review labels Feb 6, 2024
@github-actions github-actions bot added the must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review label Feb 13, 2024
Copy link

Automated adapter checker

ioBroker.elgato-key-light

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

  • ❗ [E114] No adapter are allowed in the repo without admin support (set "common.noConfig = true" and "common.adminUI.config = none" if adapter has no configuration)

ioBroker.lorawan

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

👍 No errors found

  • 👀 [W171] "common.title" is deprecated in io-package.json
  • 👀 [W400] Cannot find "lorawan" in latest repository
  • 👀 [W505] setTimeout found in "main.js", but no clearTimeout detected

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

@github-actions github-actions bot deleted a comment from mcm1957 Feb 13, 2024
@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 (RE-)REVIEW pending (mcm1957) Changes requested by review have been applied, re-review could be done. *📬 a new comment has been added 12.2.2024 labels Feb 13, 2024
@mcm1957 mcm1957 merged commit 59a0ba2 into ioBroker:master Feb 13, 2024
38 checks passed
@mcm1957
Copy link
Collaborator

mcm1957 commented Feb 13, 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
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