diff --git a/.releaseconfig.json b/.releaseconfig.json index 3da1374..3cfe214 100644 --- a/.releaseconfig.json +++ b/.releaseconfig.json @@ -1,8 +1,6 @@ { - "all": true, - "lerna": false, - - "scripts": { + "plugins": ["iobroker", "license"], + "exec": { "beforePush": "npm run build" } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 30d89a0..b825bfa 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,9 @@ More description could be found [here](https://github.com/ioBroker/ioBroker.s7/b --> ## Changelog +### __WORK IN PROGRESS__ +* (bluefox) Corrected type of "write" attribute + ### 1.3.6 (2021-07-31) * (bluefox) Corrected import of last line diff --git a/main.js b/main.js index 36d6ff7..c38b14f 100644 --- a/main.js +++ b/main.js @@ -817,7 +817,7 @@ const main = { type: convertS7type[main.ac.inputs[i].Type] || 'number', unit: main.ac.inputs[i].Unit || ((main.ac.inputs[i].Type === 'S5TIME') ? 's' : main.ac.inputs[i].Unit), read: true, - write: main.ac.inputs[i].RW + write: main.ac.inputs[i].RW === true || main.ac.inputs[i].RW === 'true' }, native: { cat: 'input', @@ -858,7 +858,7 @@ const main = { type: convertS7type[main.ac.outputs[i].Type] || 'number', unit: main.ac.outputs[i].Unit || ((main.ac.outputs[i].Type === 'S5TIME') ? 's' : main.ac.outputs[i].Unit), read: true, - write: main.ac.outputs[i].RW + write: main.ac.outputs[i].RW === true || main.ac.outputs[i].RW === 'true' }, native: { cat: 'output', @@ -897,7 +897,7 @@ const main = { type: convertS7type[main.ac.markers[i].Type] || 'number', unit: main.ac.markers[i].Unit || ((main.ac.markers[i].Type === 'S5TIME') ? 's' : main.ac.markers[i].Unit), read: true, - write: main.ac.markers[i].RW + write: main.ac.markers[i].RW === true || main.ac.markers[i].RW === 'true' }, native: { cat: 'marker', @@ -939,7 +939,7 @@ const main = { type: convertS7type[main.ac.dbs[i].Type] || 'number', unit: main.ac.dbs[i].Unit || ((main.ac.dbs[i].Type === 'S5TIME') ? 's' : main.ac.dbs[i].Unit), read: true, - write: main.ac.dbs[i].RW + write: main.ac.dbs[i].RW === true || main.ac.dbs[i].RW === 'true' }, native: { cat: 'db', @@ -1104,7 +1104,7 @@ const main = { }, write: function (id, buff, type, offsetByte, offsetBit, len) { - let val = 0; + let val = 0; if (type === 'BOOL') { val = !!((buff[offsetByte] >> offsetBit) & 1); @@ -1524,4 +1524,4 @@ if (module && module.parent) { } else { // or start the instance directly startAdapter(); -} \ No newline at end of file +} diff --git a/package.json b/package.json index bdccb03..f149e3d 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,9 @@ "@iobroker/adapter-core": "^2.5.1" }, "devDependencies": { - "@alcalzone/release-script": "^2.2.1", + "@alcalzone/release-script": "^3.4.1", + "@alcalzone/release-script-plugin-iobroker": "^3.4.1", + "@alcalzone/release-script-plugin-license": "^3.4.1", "axios": "^0.24.0", "gulp": "^4.0.2", "mocha": "^9.1.3", @@ -58,6 +60,7 @@ "scripts": { "test": "node node_modules/mocha/bin/mocha --exit", "build": "gulp", - "release": "release-script" + "release": "release-script patch --yes", + "release-minor": "release-script minor --yes" } } diff --git a/src/src/Tabs/BaseRegisters.js b/src/src/Tabs/BaseRegisters.js index 4429e2f..3c01e4d 100644 --- a/src/src/Tabs/BaseRegisters.js +++ b/src/src/Tabs/BaseRegisters.js @@ -78,9 +78,9 @@ class BaseRegisters extends Component { struct2address(struct) { if (struct.db !== undefined) { if (struct.bit !== undefined) { - return 'DB' + struct.db + ' ' + struct.byte + '.' + struct.bit; + return `DB${struct.db} ${struct.byte}.${struct.bit}`; } else { - return 'DB' + struct.db + ' ' + struct.byte; + return `DB${struct.db} ${struct.byte}`; } } else if (struct.bit !== undefined) { return struct.byte + '.' + struct.bit; @@ -136,7 +136,9 @@ class BaseRegisters extends Component { addItem = () => { let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField])); let newItem = {} - this.getFields().forEach(field => newItem[field.name] = '') + + this.getFields().forEach(field => newItem[field.name] = ''); + if (data.length) { let sortedData = JSON.parse(JSON.stringify(data)); sortedData.sort((item1, item2) => item1.Address > item2.Address ? 1 : -1);