Skip to content

Commit

Permalink
1.7.1
Browse files Browse the repository at this point in the history
Small logging changes.
  • Loading branch information
RonnyWinkler committed Oct 13, 2024
1 parent afcb5ae commit c0c71f0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .homeychangelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,10 @@
"1.7.0": {
"en": "Added dynamic mode lists (climate, vacuum, custom select entity).",
"de": "Dynamische Modus-Listen hinzugefügt (Klima, Staubsauger, benutzerdefinierte Select-Entität)."
},
"1.7.1": {
"en": "Small logging changes.",
"de": "Kleine Logging-Änderungen."
}

}
2 changes: 1 addition & 1 deletion .homeycompose/app.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "io.home-assistant.community",
"version": "1.7.0",
"version": "1.7.1",
"compatibility": ">=12.0.1",
"sdk": 3,
"brandColor": "#0DA6EA",
Expand Down
30 changes: 15 additions & 15 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1301,9 +1301,9 @@ class App extends Homey.App {
}
this._flowTriggerAppMemwarn.trigger(data).catch(error => this.log("onMemwarn() flow trigger error: ", error.message));

// Trigger extended crash log. Call async function without await and raise error...
if (data.count == data.limit - 2){
this.extendedCrashLog("Memory Warning " + data.count + "/" + data.limit);
// Trigger extended crash log.
if (data.count == data.limit - 1){
await this.extendedCrashLog("Memory Warning " + data.count + "/" + data.limit);
}
}

Expand All @@ -1317,9 +1317,9 @@ class App extends Homey.App {
}
this._flowTriggerAppCpuwarn.trigger(data).catch(error => this.log("onCpuwarn() flow trigger error: ", error.message));

// Trigger extended crash log. Call async function without await and raise error...
if (data.count == data.limit - 2){
this.extendedCrashLog("CPU Warning " + data.count + "/" + data.limit);
// Trigger extended crash log.
if (data.count == data.limit - 1){
await this.extendedCrashLog("CPU Warning " + data.count + "/" + data.limit);
}
}

Expand All @@ -1329,20 +1329,20 @@ class App extends Homey.App {
this.log("Statistics: App start: " + statistics.overview.startup);
this.log("Statistics: Last connect: " + statistics.overview.lastConnect);
this.log("Statistics: Connects: " + statistics.overview.connects);
this.log("Statistics: Overall EntityListUpdates: " + statistics.sum.entityUpdates + " EntityLisUpdates: " + statistics.sum.entityUpdatesElements + " EntityStates: " + statistics.sum.entityStates + " Events: " + statistics.sum.events);
this.log("Statistics: 30sec EntityListUpdates: " + statistics.short.entityUpdates + " EntityLisUpdates: " + statistics.short.entityUpdatesElements + " EntityStates: " + statistics.short.entityStates + " Events: " + statistics.short.events);
this.log("Statistics: current EntityListUpdates: " + statistics.current.entityUpdates + " EntityLisUpdates: " + statistics.current.entityUpdatesElements + " EntityStates: " + statistics.current.entityStates + " Events: " + statistics.current.events);
this.log("Statistics: Overall EntityListUpdates: " + statistics.sum.entityUpdates + " EntityListEntries: " + statistics.sum.entityUpdatesElements + " EntityStates: " + statistics.sum.entityStates + " Events: " + statistics.sum.events);
this.log("Statistics: 30sec EntityListUpdates: " + statistics.short.entityUpdates + " EntityListEntries: " + statistics.short.entityUpdatesElements + " EntityStates: " + statistics.short.entityStates + " Events: " + statistics.short.events);
this.log("Statistics: current EntityListUpdates: " + statistics.current.entityUpdates + " EntityListEntries: " + statistics.current.entityUpdatesElements + " EntityStates: " + statistics.current.entityStates + " Events: " + statistics.current.events);
}

async extendedCrashLog(reason=''){
this.log("Trigger extended crash log. Reason: "+reason);
this.logStatistics();
let log = this.getLog();
let logText = '';
for (let i=log.length; i>0; i--){
logText += log[i-1] + '\n';
}
throw new Error("Extended crash log...\n" + logText);
// let log = this.getLog();
// let logText = '';
// for (let i=log.length; i>0; i--){
// logText += log[i-1] + '\n';
// }
// throw new Error("Extended crash log...\n" + logText);
}

getClient() {
Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"_comment": "This file is generated. Please edit .homeycompose/app.json instead.",
"id": "io.home-assistant.community",
"version": "1.7.0",
"version": "1.7.1",
"compatibility": ">=12.0.1",
"sdk": 3,
"brandColor": "#0DA6EA",
Expand Down

0 comments on commit c0c71f0

Please sign in to comment.