Skip to content

Commit

Permalink
* (bluefox) Corrected type of "write" attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Nov 8, 2021
1 parent 9b9c1d5 commit d1abb59
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
8 changes: 3 additions & 5 deletions .releaseconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"all": true,
"lerna": false,

"scripts": {
"plugins": ["iobroker", "license"],
"exec": {
"beforePush": "npm run build"
}
}
}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1524,4 +1524,4 @@ if (module && module.parent) {
} else {
// or start the instance directly
startAdapter();
}
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
}
8 changes: 5 additions & 3 deletions src/src/Tabs/BaseRegisters.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d1abb59

Please sign in to comment.