Skip to content

Commit

Permalink
requirements by eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
bolliy committed Nov 3, 2024
1 parent 3533d80 commit 0e5d8f7
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 284 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ browse in the [wiki](https://github.com/bolliy/ioBroker.sun2000/wiki)
Placeholder for the next version (at the beginning of the line):
### **WORK IN PROGRESS**
-->

### **WORK IN PROGRESS**
* Upgrade to ESLint 9.x
* node >= 20.9

### 0.16.0 (2024-11-01)
* dependency and configuration updates
* read additional register data of Huawei Emma
Expand Down
1 change: 0 additions & 1 deletion eslint.config.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const compat = new FlatCompat({
});

export default [{
ignores: ["**/.eslintrc.js", "admin/words.js"],
ignores: ["**/.eslintrc.js", "admin/words.js", ".dev-server/**", "eslint.config.*"],
}, ...compat.extends("eslint:recommended"), {
plugins: {},

Expand Down
2 changes: 1 addition & 1 deletion lib/modbus/modbus_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class ModbusServer {
await this.wait(500);
callback({ modbusErrorCode: 0x01, msg: 'Illegal function (device does not support this read/write function)' });
}
} catch (err) {
} catch {
this._addInfoStat('#getMultipleHoldingRegisters',startAddr, length, unitId);
await this.wait(500);
callback({ modbusErrorCode: 0x04, msg: 'Slave device failure (device reports internal error)' });
Expand Down
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ class Sun2000 extends utils.Adapter {
this.config.integration = 1;
this.updateConfig(this.config);
}

await this.setState('info.ip', {val: this.config.address, ack: true});
await this.setState('info.port', {val: this.config.port, ack: true});
await this.setState('info.modbusIds', {val: this.config.modbusIds, ack: true});
Expand All @@ -339,6 +338,7 @@ class Sun2000 extends utils.Adapter {
this.settings.modbusIds = this.config.modbusIds.split(',').map((n) => {return Number(n);});
//SmartDongle
this.settings.sd.active = this.config.sd_active;
// eslint-disable-next-line no-constant-binary-expression
this.settings.sd.sDongleId = Number(this.config.sDongleId) ?? 0;
if (this.settings.sd.sDongleId < 0 || this.settings.sd.sDongleId >= 255) this.settings.sd.active = false;
this.settings.highInterval = this.config.updateInterval*1000; //ms
Expand Down Expand Up @@ -527,7 +527,7 @@ class Sun2000 extends utils.Adapter {
this.modbusClient && this.modbusClient.close();
this.setState('info.connection', false, true);
callback();
} catch (e) {
} catch {
callback();
}
}
Expand Down
Loading

0 comments on commit 0e5d8f7

Please sign in to comment.