diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index 6284ed4..339ba0c 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -40,8 +40,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node-version: [18.x, 20.x] - os: [ubuntu-latest, windows-latest] + node-version: [18.x, 20.x, 22.x] + os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: ioBroker/testing-action-adapter@v1 diff --git a/README.md b/README.md index 7d367d2..2e2d3da 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ # Basic concept There are several adapters available to view charts within ioBroker. As far as I know, all of them are using a UI to configure content and options of the charts. Typically not all features of the used graphical sub system could be used in this way. E.g. it's not possible to view fully featured stacked charts with eChart-Adapter. -This adapter uses a different approach. It brings the complete feature set of [Apache eCharts](https://echarts.apache.org/en/index.html) to ioBroker. Take a look the [demo charts](https://echarts.apache.org/examples/en/index.html). +This adapter uses a different approach. It brings the complete feature set of [Apache ECharts](https://echarts.apache.org/en/index.html) to ioBroker. Take a look the [demo charts](https://echarts.apache.org/examples/en/index.html). **There is no UI to configure any chart.** You have to define the chart yourself, the adapter takes care about visualization. You have to provide definition and content of the chart by providing the content as a json-object - in eCharts examples it corresponds to the content of variable `option`. Here's an example to make it clear. To create a stacked chart you store it's definition in an ioBroker state (json format): @@ -52,14 +52,6 @@ But if you have a very specific idea in mind for a more complex chart, flexchart # Getting started -### Install flexchart adapter - -Presently the adapter is availabe at Github only. Best way for installation is via command line interface: -``` -iob url https://github.com/MyHomeMyData/ioBroker.flexcharts.git -``` -Now add an instance in ioBroker GUI. The only configuration parameter of the adapter is the port number. You may use the default value of 3100 (used in examples shown here). - ### Using the adapter Wenn adapter is running you can access it via http://localhost:3100/echarts.html (replace `localhost` by address of your ioBroker server). @@ -175,3 +167,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Additional remark: +Source code of [Apache ECharts](https://echarts.apache.org/en/index.html) is used according to [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) \ No newline at end of file diff --git a/io-package.json b/io-package.json index 5f88d36..9741c35 100644 --- a/io-package.json +++ b/io-package.json @@ -30,7 +30,6 @@ "zh-cn": "初步释放" } }, - "title": "Fully featured eCharts", "titleLang": { "en": "Fully featured eCharts", "de": "Alle Möglichkeiten von eCharts nutzen", @@ -61,15 +60,16 @@ "MyHomeMyData " ], "keywords": [ - "ioBroker", "visualization", "chart", "charts", "echarts" ], - "license": "MIT", + "licenseInformation": { + "license": "MIT", + "type": "free" + }, "platform": "Javascript/Node.js", - "main": "main.js", "icon": "flexcharts-icon.png", "enabled": true, "extIcon": "https://raw.githubusercontent.com/MyHomeMyData/ioBroker.flexcharts/main/admin/flexcharts-icon.png", @@ -78,6 +78,7 @@ "mode": "daemon", "messagebox": true, "type": "visualization-widgets", + "tier": 3, "compact": true, "connectionType": "local", "dataSource": "assumption", diff --git a/main.js b/main.js index cc740b1..e67e8fe 100644 --- a/main.js +++ b/main.js @@ -30,9 +30,6 @@ class Flexcharts extends utils.Adapter { this.webServer = null; this.on('ready', this.onReady.bind(this)); - this.on('stateChange', this.onStateChange.bind(this)); - // this.on('objectChange', this.onObjectChange.bind(this)); - // this.on('message', this.onMessage.bind(this)); this.on('unload', this.onUnload.bind(this)); } @@ -40,8 +37,6 @@ class Flexcharts extends utils.Adapter { * Is called when databases are connected and adapter received configuration. */ async onReady() { - // Initialize your adapter here - // Reset the connection indicator during startup this.setState('info.connection', false, true); @@ -348,57 +343,6 @@ class Flexcharts extends utils.Adapter { } } - - // If you need to react to object changes, uncomment the following block and the corresponding line in the constructor. - // You also need to subscribe to the objects with `this.subscribeObjects`, similar to `this.subscribeStates`. - // /** - // * Is called if a subscribed object changes - // * @param {string} id - // * @param {ioBroker.Object | null | undefined} obj - // */ - // onObjectChange(id, obj) { - // if (obj) { - // // The object was changed - // this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`); - // } else { - // // The object was deleted - // this.log.info(`object ${id} deleted`); - // } - // } - - /** - * Is called if a subscribed state changes - * @param {string} id - * @param {ioBroker.State | null | undefined} state - */ - onStateChange(id, state) { - if (state) { - // The state was changed - this.log.info(`state ${id} changed: ${state.val} (ack = ${state.ack})`); - } else { - // The state was deleted - this.log.info(`state ${id} deleted`); - } - } - - // If you need to accept messages in your adapter, uncomment the following block and the corresponding line in the constructor. - // /** - // * Some message was sent to this instance over message box. Used by email, pushover, text2speech, ... - // * Using this method requires "common.messagebox" property to be set to true in io-package.json - // * @param {ioBroker.Message} obj - // */ - // onMessage(obj) { - // if (typeof obj === 'object' && obj.message) { - // if (obj.command === 'send') { - // // e.g. send email or pushover or whatever - // this.log.info('send command'); - - // // Send response in callback if required - // if (obj.callback) this.sendTo(obj.from, obj.command, 'Message received', obj.callback); - // } - // } - // } - } if (require.main !== module) {