From af88beb902468eb03749e5b120f3e350e60256e1 Mon Sep 17 00:00:00 2001 From: DutchmanNL Date: Wed, 26 Jul 2023 21:25:28 +0200 Subject: [PATCH] solve stupid mistake --- main.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 4747aea6..95f3eea6 100644 --- a/main.js +++ b/main.js @@ -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 @@ -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 @@ -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; } }