ioBroker / ioBroker.repositories

Repositories for ioBroker project
MIT License
137 stars 284 forks source link

Add fenecon to latest #3735

Open sg-app opened 1 month ago

mcm1957 commented 1 month ago

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.

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

If you have any urgent questions feel free to ask.

mcm1957 commented 1 month ago

reminder 21.6.2024

mcm1957 commented 6 days ago

@sg-app

First of all - THANK YOU for the time and effort you spend to maintain this adapter. And sorry for the long delay due to holiday absence and lack of time.

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.

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 28.7.2024

sg-app commented 5 days ago

Hi, i have completed all points.

Why do you create any state with write:true access?

The feature for writing states was planned and will be implemented at a later date. I hope I was able to address all points to your satisfaction.

Georg

mcm1957 commented 1 day ago

REVIEW - W.I.P

github-actions[bot] commented 1 day ago

Automated adapter checker

ioBroker.fenecon

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

:thumbsup: No errors found

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

mcm1957 commented 1 day ago

Thanks, most remarks are solved. For those I have still remarks:

You filter illegal characters at object creation (https://github.com/sg-app/ioBroker.fenecon/blob/28e5fb459ac358c90b884acd4a5be6809e177ef1/main.js#L116).

But allowedId is only used at creation of object. When updating the state the unfiltered Id seems to be used. (https://github.com/sg-app/ioBroker.fenecon/blob/28e5fb459ac358c90b884acd4a5be6809e177ef1/main.js#L126)

This seems to be incorrect.

In addition I do not see a filtering for "channelName" https://github.com/sg-app/ioBroker.fenecon/blob/28e5fb459ac358c90b884acd4a5be6809e177ef1/main.js#L152

You construct the state Id using address.jpin("."); https://github.com/sg-app/ioBroker.fenecon/blob/28e5fb459ac358c90b884acd4a5be6809e177ef1/main.js#L144 So your stateIds will look something like "aaa.bbb.ccc.ddd". So you MUST create each level seperatly, i.e. createObject ('aaa',...) --> type device or channel or folder createObject ('aaa.bbb',...) --> i.e. type folder (or channel) createObject ('aaa.bbb.ccc',...) --> type foleder createObject ('aaa.bbb.ccc.ddd',...) -> type state

If you are sure that there are always exactly two elements, you should check this at code to block incorrect data received. Do NOT trust that the webservice sends valid data only. (Often a webservice should send some structured rest data but in case of a problem a html page is transmitted. So you should check the data retrieved and block incorrect data from creating nonsense states etc.

https://github.com/sg-app/ioBroker.fenecon/blob/28e5fb459ac358c90b884acd4a5be6809e177ef1/main.js#L126 https://github.com/sg-app/ioBroker.fenecon/blob/28e5fb459ac358c90b884acd4a5be6809e177ef1/main.js#L229 https://github.com/sg-app/ioBroker.fenecon/blob/28e5fb459ac358c90b884acd4a5be6809e177ef1/main.js#L255

you could remove the check wehtehr the object exists and execute extendObject always. extendObject creates the object if it does not exists and updates the object with the information passed to extendObject. If you do not want to update createObjectNotExists will do nothing if an object already exists.

So checks https://github.com/sg-app/ioBroker.fenecon/blob/28e5fb459ac358c90b884acd4a5be6809e177ef1/main.js#L147 https://github.com/sg-app/ioBroker.fenecon/blob/28e5fb459ac358c90b884acd4a5be6809e177ef1/main.js#L162 coudl be removed.

Please set correct state roles for all states. You might do this using some configuration table. Roles are important for vis and type detector. Setting all states to role "state" is a last chance way only and intended for adapter knowing nathing about the content they receive (i.e. mqtt). As this adapter handles values from an inverter, most or all states should be known and correct types and units should be set. You can add a mapping table for all known states and log new / unknown states so that the can be implemented at next release.

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 2.8.2024