iobroker.sbfspot 4.1.3 → 4.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/FUNDING.yml +16 -0
- package/.github/dependabot.yml +13 -0
- package/.github/workflows/test-and-release.yml +72 -113
- package/README.md +7 -1
- package/io-package.json +2 -2
- package/lib/SMA_Bluetooth.js +27 -0
- package/main.js +9 -5
- package/package.json +11 -11
- package/sbfspot.njsproj +5 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# These are supported funding model platforms
|
|
2
|
+
|
|
3
|
+
#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
|
4
|
+
#patreon: # Replace with a single Patreon username
|
|
5
|
+
#open_collective: # Replace with a single Open Collective username
|
|
6
|
+
#ko_fi: # Replace with a single Ko-fi username
|
|
7
|
+
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
8
|
+
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
+
#liberapay: # Replace with a single Liberapay username
|
|
10
|
+
#issuehunt: # Replace with a single IssueHunt username
|
|
11
|
+
#otechie: # Replace with a single Otechie username
|
|
12
|
+
#lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
|
13
|
+
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
custom: "https://www.paypal.com/donate/?hosted_button_id=34ESBMJ932QZC"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
|
3
|
+
# Please see the documentation for all configuration options:
|
|
4
|
+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
|
5
|
+
|
|
6
|
+
version: 2
|
|
7
|
+
updates:
|
|
8
|
+
- package-ecosystem: "npm"
|
|
9
|
+
directory: "/"
|
|
10
|
+
schedule:
|
|
11
|
+
interval: "daily"
|
|
12
|
+
target-branch: "master"
|
|
13
|
+
open-pull-requests-limit: 30
|
|
@@ -1,120 +1,79 @@
|
|
|
1
|
-
# This is a composition of lint and test scripts
|
|
2
|
-
# Make sure to update this file along with the others
|
|
3
|
-
|
|
4
1
|
name: Test and Release
|
|
5
2
|
|
|
6
3
|
# Run this job on all pushes and pull requests
|
|
7
4
|
# as well as tags with a semantic version
|
|
8
5
|
on:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- "master"
|
|
9
|
+
tags:
|
|
10
|
+
# normal versions
|
|
11
|
+
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
12
|
+
# pre-releases
|
|
13
|
+
- "v[0-9]+.[0-9]+.[0-9]+-**"
|
|
14
|
+
pull_request: {}
|
|
18
15
|
|
|
19
16
|
jobs:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
#
|
|
82
|
-
#
|
|
83
|
-
# Then uncomment the following block:
|
|
84
|
-
|
|
85
|
-
# # Deploys the final package to NPM
|
|
86
|
-
# deploy:
|
|
87
|
-
# needs: [adapter-tests]
|
|
88
|
-
#
|
|
89
|
-
# # Trigger this step only when a commit on master is tagged with a version number
|
|
90
|
-
# if: |
|
|
91
|
-
# contains(github.event.head_commit.message, '[skip ci]') == false &&
|
|
92
|
-
# github.event_name == 'push' &&
|
|
93
|
-
# github.event.base_ref == 'refs/heads/master' &&
|
|
94
|
-
# startsWith(github.ref, 'refs/tags/v')
|
|
95
|
-
#
|
|
96
|
-
# runs-on: ubuntu-latest
|
|
97
|
-
# strategy:
|
|
98
|
-
# matrix:
|
|
99
|
-
# node-version: [12.x]
|
|
100
|
-
#
|
|
101
|
-
# steps:
|
|
102
|
-
# - uses: actions/checkout@v2
|
|
103
|
-
# - name: Use Node.js ${{ matrix.node-version }}
|
|
104
|
-
# uses: actions/setup-node@v1
|
|
105
|
-
# with:
|
|
106
|
-
# node-version: ${{ matrix.node-version }}
|
|
107
|
-
#
|
|
108
|
-
# - name: Publish package to npm
|
|
109
|
-
# run: |
|
|
110
|
-
# npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
|
|
111
|
-
# npm whoami
|
|
112
|
-
# npm publish
|
|
113
|
-
|
|
114
|
-
# Dummy job for skipped builds - without this, github reports the build as failed
|
|
115
|
-
skip-ci:
|
|
116
|
-
if: contains(github.event.head_commit.message, '[skip ci]')
|
|
117
|
-
runs-on: ubuntu-latest
|
|
118
|
-
steps:
|
|
119
|
-
- name: Skip build
|
|
120
|
-
run: echo "Build skipped!"
|
|
17
|
+
# Performs quick checks before the expensive test runs
|
|
18
|
+
check-and-lint:
|
|
19
|
+
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
|
20
|
+
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: ioBroker/testing-action-check@v1
|
|
25
|
+
with:
|
|
26
|
+
node-version: '18.x'
|
|
27
|
+
# Uncomment the following line if your adapter cannot be installed using 'npm ci'
|
|
28
|
+
# install-command: 'npm install'
|
|
29
|
+
lint: true
|
|
30
|
+
|
|
31
|
+
# Runs adapter tests on all supported node versions and OSes
|
|
32
|
+
adapter-tests:
|
|
33
|
+
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
|
34
|
+
|
|
35
|
+
runs-on: ${{ matrix.os }}
|
|
36
|
+
strategy:
|
|
37
|
+
matrix:
|
|
38
|
+
node-version: [16.x, 18.x, 20.x]
|
|
39
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
40
|
+
|
|
41
|
+
steps:
|
|
42
|
+
- uses: ioBroker/testing-action-adapter@v1
|
|
43
|
+
with:
|
|
44
|
+
node-version: ${{ matrix.node-version }}
|
|
45
|
+
os: ${{ matrix.os }}
|
|
46
|
+
# Uncomment the following line if your adapter cannot be installed using 'npm ci'
|
|
47
|
+
# install-command: 'npm install'
|
|
48
|
+
|
|
49
|
+
# Deploys the final package to NPM
|
|
50
|
+
deploy:
|
|
51
|
+
needs: [check-and-lint, adapter-tests]
|
|
52
|
+
|
|
53
|
+
# Trigger this step only when a commit on any branch is tagged with a version number
|
|
54
|
+
if: |
|
|
55
|
+
contains(github.event.head_commit.message, '[skip ci]') == false &&
|
|
56
|
+
github.event_name == 'push' &&
|
|
57
|
+
startsWith(github.ref, 'refs/tags/v')
|
|
58
|
+
|
|
59
|
+
runs-on: ubuntu-latest
|
|
60
|
+
|
|
61
|
+
steps:
|
|
62
|
+
- uses: ioBroker/testing-action-deploy@v1
|
|
63
|
+
with:
|
|
64
|
+
node-version: '18.x'
|
|
65
|
+
# Uncomment the following line if your adapter cannot be installed using 'npm ci'
|
|
66
|
+
# install-command: 'npm install'
|
|
67
|
+
npm-token: ${{ secrets.NPM_TOKEN }}
|
|
68
|
+
github-token: ${{ secrets.secrets.AUTOMERGER }}
|
|
69
|
+
|
|
70
|
+
# When using Sentry for error reporting, Sentry can be informed about new releases
|
|
71
|
+
# To enable create a API-Token in Sentry (User settings, API keys)
|
|
72
|
+
# Enter this token as a GitHub secret (with name SENTRY_AUTH_TOKEN) in the repository options
|
|
73
|
+
# Then uncomment and customize the following block:
|
|
74
|
+
#sentry: true
|
|
75
|
+
#sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
76
|
+
#sentry-project: "xxx"
|
|
77
|
+
#sentry-version-prefix: "xxx"
|
|
78
|
+
# If your sentry project is linked to a GitHub repository, you can enable the following option
|
|
79
|
+
# sentry-github-integration: true
|
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ For more details and for information how to disable the error reporting see [Sen
|
|
|
18
18
|
|
|
19
19
|
**If you like it, please consider a donation:**
|
|
20
20
|
|
|
21
|
-
[](https://www.paypal.com/
|
|
21
|
+
[](https://www.paypal.com/donate/?hosted_button_id=34ESBMJ932QZC)
|
|
22
22
|
|
|
23
23
|
This adapter reads data from SMA power inverters using sbfspot.
|
|
24
24
|
Now both database types (mySQL and sqlite) are supported.
|
|
@@ -51,6 +51,12 @@ sometimes npm intall must be called more then one time to successfully install a
|
|
|
51
51
|
|
|
52
52
|
## Changelog
|
|
53
53
|
|
|
54
|
+
### 4.1.5 (2023-07-30)
|
|
55
|
+
* (René) dependencies updated
|
|
56
|
+
|
|
57
|
+
### 4.1.4 (2023-04-07)
|
|
58
|
+
* (René) dependencies updated
|
|
59
|
+
|
|
54
60
|
### 4.1.3 (2023-01-31)
|
|
55
61
|
* (René) dependencies updated
|
|
56
62
|
|
package/io-package.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const bluetooth = require('node-bluetooth');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
let parentAdapter;
|
|
6
|
+
|
|
7
|
+
function test(adapter) {
|
|
8
|
+
|
|
9
|
+
parentAdapter = adapter;
|
|
10
|
+
|
|
11
|
+
const device = new bluetooth.DeviceINQ();
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
device
|
|
15
|
+
.on('finished', function () {
|
|
16
|
+
parentAdapter.log.warn("finished ");
|
|
17
|
+
})
|
|
18
|
+
.on('found', function found(address, name) {
|
|
19
|
+
parentAdapter.log.warn('Found: ' + address + ' with name ' + name);
|
|
20
|
+
}).scan();
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
module.exports = {
|
|
26
|
+
test
|
|
27
|
+
}
|
package/main.js
CHANGED
|
@@ -18,7 +18,7 @@ const utils = require("@iobroker/adapter-core");
|
|
|
18
18
|
//const { json } = require("stream/consumers");
|
|
19
19
|
const SunCalc = require("suncalc2");
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
//const bluetooth_test = require("./lib/SMA_Bluetooth").test;
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
let adapter;
|
|
@@ -56,7 +56,11 @@ let killTimer;
|
|
|
56
56
|
|
|
57
57
|
async function main() {
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
|
|
60
|
+
//bluetooth_test();
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
if (adapter.config.databasetype === undefined) {
|
|
60
64
|
adapter.log.error("databasetype not defined. check and update settings and save");
|
|
61
65
|
adapter.terminate ? adapter.terminate(11) : process.exit(11);
|
|
62
66
|
}
|
|
@@ -187,7 +191,7 @@ async function GetSystemDateformat() {
|
|
|
187
191
|
try {
|
|
188
192
|
const ret = await adapter.getForeignObjectAsync("system.config");
|
|
189
193
|
|
|
190
|
-
if (
|
|
194
|
+
if (ret !== undefined && ret != null) {
|
|
191
195
|
//dateformat = ret.common.dateFormat;
|
|
192
196
|
longitude = ret.common.longitude;
|
|
193
197
|
latitude = ret.common.latitude;
|
|
@@ -1116,11 +1120,11 @@ function DB_Disconnect() {
|
|
|
1116
1120
|
|
|
1117
1121
|
adapter.log.debug("disconnect database");
|
|
1118
1122
|
if (adapter.config.databasetype == "mySQL" || adapter.config.databasetype == "MariaDB") {
|
|
1119
|
-
if (
|
|
1123
|
+
if (mysql_connection !== undefined && mysql_connection != null) {
|
|
1120
1124
|
mysql_connection.end();
|
|
1121
1125
|
}
|
|
1122
1126
|
} else {
|
|
1123
|
-
if (
|
|
1127
|
+
if (sqlite_db !== undefined && sqlite_db != null) {
|
|
1124
1128
|
sqlite_db.close();
|
|
1125
1129
|
}
|
|
1126
1130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.sbfspot",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.5",
|
|
4
4
|
"description": "sbfspot (SMA inverter) Adapter",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "René G.",
|
|
@@ -18,31 +18,31 @@
|
|
|
18
18
|
"url": "https://github.com/rg-engineering/ioBroker.sbfspot"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@iobroker/adapter-core": "
|
|
22
|
-
"better-sqlite3": "8.0
|
|
23
|
-
"mysql2": "3.
|
|
21
|
+
"@iobroker/adapter-core": "3.0.1",
|
|
22
|
+
"better-sqlite3": "8.5.0",
|
|
23
|
+
"mysql2": "3.5.2",
|
|
24
24
|
"suncalc2": "1.8.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@iobroker/adapter-dev": "1.2.0",
|
|
28
28
|
"@iobroker/testing": "4.1.0",
|
|
29
|
-
"@types/chai": "4.3.
|
|
29
|
+
"@types/chai": "4.3.5",
|
|
30
30
|
"@types/chai-as-promised": "7.1.5",
|
|
31
|
-
"@types/gulp": "4.0.
|
|
31
|
+
"@types/gulp": "4.0.13",
|
|
32
32
|
"@types/mocha": "10.0.1",
|
|
33
|
-
"@types/node": "
|
|
33
|
+
"@types/node": "20.4.5",
|
|
34
34
|
"@types/proxyquire": "1.3.28",
|
|
35
35
|
"@types/request-promise-native": "1.0.18",
|
|
36
|
-
"@types/sinon": "10.0.
|
|
36
|
+
"@types/sinon": "10.0.15",
|
|
37
37
|
"@types/sinon-chai": "3.2.9",
|
|
38
|
-
"axios": "
|
|
38
|
+
"axios": "1.4.0",
|
|
39
39
|
"chai": "4.3.7",
|
|
40
40
|
"chai-as-promised": "7.1.1",
|
|
41
|
-
"eslint": "8.
|
|
41
|
+
"eslint": "8.45.0",
|
|
42
42
|
"gulp": "4.0.2",
|
|
43
43
|
"mocha": "10.2.0",
|
|
44
44
|
"proxyquire": "2.1.3",
|
|
45
|
-
"sinon": "15.0
|
|
45
|
+
"sinon": "15.2.0",
|
|
46
46
|
"sinon-chai": "3.7.0"
|
|
47
47
|
},
|
|
48
48
|
"main": "main.js",
|
package/sbfspot.njsproj
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
<Compile Include="test\unit.js" />
|
|
29
29
|
<Compile Include="widgets\sbfspot\lib\js\flot\jquery.flot.js" />
|
|
30
30
|
<Compile Include="widgets\sbfspot\lib\js\flot\jquery.flot.time.js" />
|
|
31
|
+
<Content Include=".github\dependabot.yml" />
|
|
32
|
+
<Content Include=".github\FUNDING.yml" />
|
|
31
33
|
<Content Include=".github\ISSUE_TEMPLATE\BugReport.md" />
|
|
32
34
|
<Content Include=".github\ISSUE_TEMPLATE\Enhancement.md" />
|
|
33
35
|
<Content Include=".github\workflows\npmpublish.yml" />
|
|
@@ -49,6 +51,9 @@
|
|
|
49
51
|
<Content Include="docs\en\install_arm.md">
|
|
50
52
|
<SubType>Code</SubType>
|
|
51
53
|
</Content>
|
|
54
|
+
<Content Include="lib\SMA_Bluetooth.js">
|
|
55
|
+
<SubType>Code</SubType>
|
|
56
|
+
</Content>
|
|
52
57
|
<Content Include="lib\tools.js">
|
|
53
58
|
<SubType>Code</SubType>
|
|
54
59
|
</Content>
|