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 TeslaFi to latest #4236

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

Add TeslaFi to latest #4236

wants to merge 1 commit into from

Conversation

hombach
Copy link
Contributor

@hombach hombach commented Oct 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 Oct 28, 2024
@github-actions github-actions bot deleted a comment from hombach Oct 28, 2024
@mcm1957 mcm1957 added (RE-)REVIEW pending (mcm1957) Changes requested by review have been applied, re-review could be done. New at LATEST 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 Oct 29, 2024
@github-actions github-actions bot added *📬 a new comment has been added 4.11.2024 labels Oct 29, 2024
@mcm1957 mcm1957 removed the *📬 a new comment has been added label Oct 29, 2024
@simatec
Copy link
Contributor

simatec commented Oct 30, 2024

jsonConfig looks good...

@github-actions github-actions bot added the *📬 a new comment has been added label Oct 30, 2024
@github-actions github-actions bot added must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review and removed 4.11.2024 labels Nov 1, 2024
@github-actions github-actions bot deleted a comment from mcm1957 Nov 1, 2024
@hombach hombach closed this Nov 1, 2024
@hombach hombach reopened this Nov 1, 2024
@github-actions github-actions bot deleted a comment from hombach Nov 1, 2024
@hombach
Copy link
Contributor Author

hombach commented Nov 1, 2024

"xs" should specify a value of "12" at admin/jsonConfig.json/items/_StandardTab/_donate -> has to be 6, otherwise button is too big

I'm no friend of automated translations - so I don't use i18n

@github-actions github-actions bot deleted a comment from mcm1957 Nov 1, 2024
@mcm1957
Copy link
Collaborator

mcm1957 commented Nov 1, 2024

Your TOO fast :-)
Size check has been disabled for divider an staticImage in the meantime. Checks are adjustes to results in real life. :-)

I18n is a warning only which will not be considered blocking.

@hombach
Copy link
Contributor Author

hombach commented Nov 1, 2024

:) - so all this 5 times 12 for dividers could be removed?.... -> next release ;)

... so must be fixed label isn't relevant anymore? Or do I have to change something?

@mcm1957 mcm1957 added New at LATEST 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 Nov 1, 2024
Copy link

github-actions bot commented Nov 2, 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

@mcm1957
Copy link
Collaborator

mcm1957 commented Nov 5, 2024

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

reminder 4.11.2024

@github-actions github-actions bot added the 4.11.2024 remind after 4.11.2024 label Nov 24, 2024
@mcm1957 mcm1957 changed the title Adding TeslaFi Adapter to latest repository Adding TeslaFi to latest Nov 24, 2024
@mcm1957 mcm1957 changed the title Adding TeslaFi to latest Add TeslaFi to latest Nov 24, 2024
Copy link

Automated adapter checker

ioBroker.teslafi

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

👍 No errors found

  • 👀 [W401] Cannot find "teslafi" in latest repository
  • 👀 [W508] attribute "xs" for staticImage should specify a value of "12" at admin/jsonConfig.json/items/_StandardTab/_donate
  • 👀 [W522] Why did you decide not to use i18n support?

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

@mcm1957
Copy link
Collaborator

mcm1957 commented Nov 26, 2024

@hombach

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.

  • TeslaFi related to tibber?

    Is teslafi related to tibber or is this loga a copy/paste error?

    'pull of homes from Tibber-Server'

  • unused onMessage handler

    onMessage handler has no obvious functionality. Please remove from code an config.

  • 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, '_');
}
  • 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 should be preferred when called once during startup of the adapter.

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

    One example: role 'value' must not be writeable.

  • Is there any reason to not use i18n translation environment?

    I suggest to evaluate to use i18n translation environment and the iobroker/adapter-dev environment (https://github.com/ioBroker/adapter-dev#iobroker-adapter-dev). You could easyly add new strings to the english json and run npm run translate afterward. When using i18n environment activating iobrokers weblate translation system (see https://github.com/ioBrokerTranslator/doc) is trivial.

  • Add timeout to axios calls

    All axios calls should have a timeout set. The default value for axios timeout is 0 which results in no timeout. So an unresponsive remote system could lead to an hanging adapter. Either set an appropiate timeout per axios call or set a default timeout globally for the axios instance.

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

  • check and limit intervals used to access cloud services

    Limit all intervals used to access cloud services to a reasonable value. If users configure an inapprobiate access rate this could lead to suspending the service by the provider for all ioBroker users.

  • 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 suggestions or at least commented the suggestions and you think the adapter is ready for a re-review!

reminder 10.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 26, 2024
@github-actions github-actions bot added 10.12.2024 remind after 10.12.2024 and removed 4.11.2024 remind after 4.11.2024 labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.12.2024 remind after 10.12.2024 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.

3 participants