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 adapter flexcharts to latest #3889

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

Conversation

MyHomeMyData
Copy link
Contributor

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 Aug 6, 2024
@github-actions github-actions bot deleted a comment from MyHomeMyData Aug 6, 2024
@github-actions github-actions bot deleted a comment from MyHomeMyData Aug 6, 2024
@mcm1957 mcm1957 added (RE-)REVIEW pending (mcm1957) Changes requested by review have been applied, re-review could be done. and removed *📬 a new comment has been added labels Aug 6, 2024
@mcm1957
Copy link
Collaborator

mcm1957 commented Aug 6, 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.

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.

reminder 13.8.2024

@mcm1957 mcm1957 changed the title Added adapter flexcharts to latest Add adapter flexcharts to latest Aug 6, 2024
@mcm1957 mcm1957 removed the must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review label Aug 6, 2024
@mcm1957 mcm1957 added the Adapter-Review needed A developer from the ioBroker Team will review the adapter, will provide comments or require changes label Aug 17, 2024
@mcm1957
Copy link
Collaborator

mcm1957 commented Sep 1, 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.

Please note that most likely @foxriver76 or @bluefox might give some remarks too.

  • errors and warning reported by adapter checker must be fixed

    Please fix errors and warnings reported by adapter checker (excpet W400 of course).

  • remove github install instructions

    Installation from GitHub is stringly discouraged. So please remove such instructions from README.md. (Tests know how to install a github version anyway and normal users should not be guided this way. In general ioBroker users should be familyr with installing an adapter, so normally no guide for installation is required. Thsi relates to installation only, configuratzion should be described as good as possible.

    ref: https://github.com/MyHomeMyData/ioBroker.flexcharts/tree/main#install-flexchart-adapter

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

  • echarts.js seems to be an external copy

    Please verify that license requirements are fulfilled.

  • adapt testing to supported node releases

    Tests for node 18 are mandatory.
    Tests for node 20 are mandatory as this is the recommended node version.
    Tests for node 22 are mandatory unless you already know incompatibilities which cannot be fixed immidiatly. In this case please create a issue stating the problem and fix as soon as possible.

    So the recommended testmatrix is [18.x, 20.x, 22.x] depending on engines requirments setting at package.json

    Tests must be performed at all supported platforms (linux, windows, mac) unless special hardware or software restrictions prohibit this. Please readd mac.

To be discussed with @foxriver76 and @Apollon77

  • is the design to store the configuration of the chart AND the actual date within ONE object / state really the best solution? Normally one would expect to configure the grafik at one place and to provide the date at a second place as normally only data changes during operation.

    I refer to description here: https://github.com/MyHomeMyData/ioBroker.flexcharts/tree/main#basic-concept

  • it looks like that this adapter is only some sort of webserver. Wouldn't this better implemnted as a vis component (widget?) instead of an adapter and / or to use the standard webserver support of ioBroker?

  • This adapter does not provide any refresh mechanism on itself. It seems to process the content of a state only when the html port get queried. So vis must do a cyclic refresh. Is this the way vis works? There will be no refresh if the content of the used state is changed.

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
Copy link
Collaborator

mcm1957 commented Sep 1, 2024

reminder 15.9.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. 15.9.2024 labels Sep 1, 2024
MyHomeMyData pushed a commit to MyHomeMyData/ioBroker.flexcharts that referenced this pull request Sep 2, 2024
@MyHomeMyData
Copy link
Contributor Author

Thanks a lot for doing the review! Hopefully, I fixed the findings so far.

Regarding ECharts licence: It appies "Apache License, Version 2.0". To my understanding usage of local copy is allowed. I added a note in License part of Readme.

Regarding basic concept:
I'm curious to hear opinions of @foxriver76 and @Apollon77.

Yes, there is no refresh mechanism on itself.

It's quite possible that the current approach isn't optimal for this concept. Unfortunately, I don't know anything about programming widgets etc., so I can't assess these alternatives.
If we go in this direction, I'll need support to get started.

@github-actions github-actions bot added the *📬 a new comment has been added label Sep 2, 2024
@mcm1957 mcm1957 removed the *📬 a new comment has been added label Sep 3, 2024
@MyHomeMyData
Copy link
Contributor Author

@mcm1957 Hi Martin, I would appreciate it if we could come to a decision on how to proceed here.

If it's not feasable to use an adapter I would need your advice for a better approach.
I try to summarize the present approach:

  • adapter creates a http server on a specific port. Port no. is presently the only configuration parameter.
  • a client (browser, iFrame, ...) using the provided http-address can hand over a set of parameters
  • based on those parameters adapter decides to grab data for EChart from an ioBroker state or from an ioBroker script via sendMessage and callback
  • user provides complete definition of EChart via state or script
  • adapter hands over received definition of EChart to Apache echart-script

Finally an EChart is shown according to users definition. It's possible to use almost full feature set of Apache ECharts within ioBrokers eco system.

@github-actions github-actions bot added the *📬 a new comment has been added label Sep 22, 2024
@Apollon77
Copy link
Collaborator

Apollon77 commented Sep 23, 2024

Hi, and sorry for the delay in answering. In general we would have some proposals how to make the adapter more generically working, also e.g. with the ioBroker cloud, because this is not possible with the current "own port" approach.

So one proposal would be to rebuild it as a web extension, so that the web adapter server can be used and your adapter kind of have a sub path in that for it's things and do not need an own port. Via this web server you also have the default websocket interface for web to fetch states or send messages, so also this might already be reusable.

The conversion to a web extension should be not too hard and the logic can be check e.g. in the simpleapi or socketio or other adapters. Also some informations are in the web adapter readme.

But in fact this is mainly a proposal to be better usable for the users. Rest is fine and in my eyes we do not want to block the repo addition any longer. So your decision if you like to do web extension first and we wait, or if you want to do it later (or never ;-)) and we add now...

Ingo

@Apollon77
Copy link
Collaborator

Hi @MyHomeMyData ... web extension is no web development! It is just to "write the nodejs stuff slighly different so that the web adapter loads it as a plugin server side. SO it is still and 100% backend effort :-)

Lets look at simpleaoi adapter.

More info also on https://github.com/ioBroker/ioBroker.web/blob/master/WEB-EXTENSIONS-HOWTO.md

@mcm1957 mcm1957 removed the *📬 a new comment has been added label Sep 23, 2024
@MyHomeMyData
Copy link
Contributor Author

Hi @Apollon77 thanks again for all the help via telegram!

Adapter now works as web extension using mode:extension. Functionality - hopefully - is the same as before.

Please do a re-check.

@github-actions github-actions bot added the *📬 a new comment has been added label Oct 1, 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 Adapter-Review needed A developer from the ioBroker Team will review the adapter, will provide comments or require changes *📬 a new comment has been added 15.9.2024 labels Oct 1, 2024
@mcm1957
Copy link
Collaborator

mcm1957 commented Oct 1, 2024

reminder 8.10.2024

@github-actions github-actions bot added 8.10.2024 remind after 8.10.2024 must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review and removed 15.9.2024 labels Oct 1, 2024
@github-actions github-actions bot deleted a comment from mcm1957 Oct 1, 2024
@mcm1957
Copy link
Collaborator

mcm1957 commented Oct 1, 2024

Please ignore E166 - seems to be false positive

@github-actions github-actions bot added the *📬 a new comment has been added label Oct 1, 2024
@github-actions github-actions bot deleted a comment from MyHomeMyData Oct 1, 2024
@mcm1957 mcm1957 removed *📬 a new comment has been added must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review labels Oct 1, 2024
@mcm1957
Copy link
Collaborator

mcm1957 commented Oct 1, 2024

@MyHomeMyData
I'm still checking with @foxriver76 what combination of mode:extension / onlyWWW is valid. Currently it looks like onlyWWW should not be set - but I still do not know for sure. Sorry.

Please ignore checker errors until the recommended combination is clearified

@mcm1957
Copy link
Collaborator

mcm1957 commented Oct 1, 2024

It's me again:

I checked oth aapters configures as mode:extension:

ioBroker.flexcharts.json
ioBroker.googleauth.json
ioBroker.habpanel.json
ioBroker.proxy.json
ioBroker.weblogin.json

The correct setup seems to be:

  • onlyWWW: false (or not existing) at io-package.json
  • main empty (main:"") or pointing to the extension file (i.e. lib/adapter,js)

I suggest to setup flexcharts this wai for now - if you have time. I cannot ensire that his setup will be correct but as the listed adpaters have such a setup (check yourself if interested) it should work. Foxriver will try to analyze the controlelr code and respond within the next week - at least if nothing important arises in between.

@MyHomeMyData
Copy link
Contributor Author

@mcm1957 I changed configuration according to your proposal. Hope this fits for the moment.

Now instance is displayed as "running" and gray color. Fine from my point of view.

@github-actions github-actions bot added *📬 a new comment has been added must be fixed The Adapter request got review/automatic feedback that is required to be fixed before another review labels Oct 1, 2024
@github-actions github-actions bot deleted a comment from MyHomeMyData Oct 2, 2024
Copy link

github-actions bot commented Oct 2, 2024

Automated adapter checker

ioBroker.flexcharts

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

  • ❗ [E143] No main found in the package.json
  • ❗ [E166] "common.mode: extension" is unknown in io-package.json.
  • 👀 [W401] Cannot find "flexcharts" in latest repository

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

@mcm1957
Copy link
Collaborator

mcm1957 commented Oct 2, 2024

Please ignore errors for now - these are false positives

@mcm1957 mcm1957 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 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.10.2024 remind after 8.10.2024 auto-checked This PR was automatically checked for obvious criterias New at LATEST (RE-)REVIEW pending (mcm1957) Changes requested by review have been applied, re-review could be done.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants