Skip to content

Commit

Permalink
solve stupid mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
DutchmanNL committed Jul 26, 2023
1 parent 5487fa0 commit af88beb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,15 @@ class Sourceanalytix extends utils.Adapter {
this.log.error(`Can't get information for ${stateID}, state will be ignored`);
delete this.activeStates[stateID];
this.unsubscribeForeignStates(stateID);
return;
initError = true;
return false;
}
} catch (error) {
this.log.error(`${stateID} is incorrectly correctly formatted, ${JSON.stringify(error)}`);
delete this.activeStates[stateID];
this.unsubscribeForeignStates(stateID);
return;
initError = true;
return false;
}

// Replace not allowed characters for state name
Expand Down Expand Up @@ -329,7 +331,7 @@ class Sourceanalytix extends utils.Adapter {
this.log.error(`Cannot handle calculations for ${stateID}, check log messages and adjust settings!`);
delete this.activeStates[stateID];
this.unsubscribeForeignStates(stateID);
return initError;
return false;
}

// Load price definition from settings & library
Expand Down Expand Up @@ -374,10 +376,11 @@ class Sourceanalytix extends utils.Adapter {
this.activeStates[stateID].calcValues.previousReadingWattTs = null;
}
this.log.debug(`[buildStateDetailsArray] completed for ${stateID}: with content ${JSON.stringify(this.activeStates[stateID])}`);
return initError;
return true;
}
} catch (error) {
this.errorHandling(`[buildStateDetailsArray] ${stateID}`, error);
return false;
}
}

Expand Down

0 comments on commit af88beb

Please sign in to comment.