Skip to content

Commit

Permalink
(simatec) Beta 0.9.15
Browse files Browse the repository at this point in the history
  • Loading branch information
simatec committed Jan 22, 2025
1 parent a242029 commit 9fc0dfd
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 190 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ When the adapter crashes or an other Code error happens, this error message that

## Changelog
<!-- ### __WORK IN PROGRESS__ -->
### __WORK IN PROGRESS__
* (simatec) Fix Request
* (simatec) Code Fix
* (simatec) Dependencies updated

### 0.9.14 (2025-01-08)
* (simatec) eslint-config fix
* (simatec) Code fix
Expand Down
43 changes: 23 additions & 20 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ async function validateURL() {
available = await axios({
method: 'get',
url: cloudURL[url],
timeout: 10000,
validateStatus: () => true
});
} catch (err) {
Expand Down Expand Up @@ -636,27 +637,29 @@ async function requestLocalAPI(root_dataPoints, information_dataPoints, data_dat
}

async function setDataPoint(dataPoint, data) {
const dataPointPath = dataPoint.name;

// @ts-ignore
if (!stateCache.includes(dataPoint.name)) {
await adapter.setObjectNotExistsAsync(dataPointPath, {
type: 'state',
common: {
role: dataPoint.role,
name: dataPoint.description,
type: dataPoint.type,
unit: dataPoint.unit,
read: true,
write: false
},
native: {}
});

stateCache.push(dataPoint.name);
}
if (dataPoint?.name) {
const dataPointPath = dataPoint.name;

// @ts-ignore
if (!stateCache.includes(dataPoint.name)) {
await adapter.setObjectNotExistsAsync(dataPointPath, {
type: 'state',
common: {
role: dataPoint.role,
name: dataPoint.description,
type: dataPoint.type,
unit: dataPoint.unit,
read: true,
write: false
},
native: {}
});

stateCache.push(dataPoint.name);
}

await adapter.setStateAsync(dataPointPath, data, true);
await adapter.setStateAsync(dataPointPath, data, true);
}
}

async function resetValues(data_dataPoints) {
Expand Down
198 changes: 30 additions & 168 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"@alcalzone/release-script-plugin-manual-review": "^3.7.0",
"@iobroker/adapter-dev": "^1.3.0",
"@iobroker/eslint-config": "^1.0.0",
"@iobroker/testing": "^5.0.0",
"@iobroker/testing": "^5.0.2",
"chai": "^4.5.0",
"chai-as-promised": "^7.1.2",
"mocha": "^11.0.1",
"mocha": "^11.1.0",
"sinon": "^18.0.0",
"sinon-chai": "^3.7.0"
},
Expand Down

0 comments on commit 9fc0dfd

Please sign in to comment.