Skip to content

Commit

Permalink
adjust isConnected
Browse files Browse the repository at this point in the history
  • Loading branch information
bolliy committed Nov 15, 2024
1 parent 15be5b3 commit d4ae5fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ 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**
* isConnected if inverter in standby

### 0.17.0 (2024-11-05)
* adjust for Responsive Design #134
* migrate to ESLint 9.x
Expand Down
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,9 @@ class Sun2000 extends utils.Adapter {
const sinceLastUpdate = new Date().getTime() - this.lastTimeUpdated; //ms
this.logger.debug('### Watchdog: time since last update '+sinceLastUpdate/1000+' sec');
const lastIsConnected = this.isConnected;
this.isConnected = this.lastStateUpdatedHigh > 0 && sinceLastUpdate < this.settings.highInterval*3;
//this.isConnected = this.lastStateUpdatedHigh > 0 && sinceLastUpdate < this.settings.highInterval*3;
this.isConnected = this.lastStateUpdatedHigh > 0 || this.lastStateUpdatedLow > 0;

if (this.isConnected !== lastIsConnected ) this.setState('info.connection', this.isConnected, true);
if (!this.settings.modbusAdjust) {
if (!this.isConnected) {
Expand Down

0 comments on commit d4ae5fa

Please sign in to comment.