Skip to content

Commit cc4ceb4

Browse files
committed
[fix] error logging, update dependencies
1 parent 1c20b45 commit cc4ceb4

5 files changed

Lines changed: 37 additions & 30 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v8.7.6 - 2025-12-27
4+
- Fix: Error logging for objects
5+
- Update dependencies
6+
37
## v8.7.5 - 2025-12-04
48
- Update dependencies due to vulnerability
59

package-lock.json

Lines changed: 18 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@homebridge-plugins/homebridge-tado",
3-
"version": "8.7.5",
3+
"version": "8.7.6",
44
"description": "Homebridge plugin for controlling tado° devices.",
55
"main": "index.js",
66
"scripts": {
@@ -35,16 +35,16 @@
3535
"@homebridge/plugin-ui-utils": "^2.1.2",
3636
"fakegato-history": "^0.6.7",
3737
"form-data": "^4.0.5",
38-
"fs-extra": "^11.3.2",
38+
"fs-extra": "^11.3.3",
3939
"got": "^14.6.5",
4040
"moment": "^2.30.1"
4141
},
4242
"devDependencies": {
4343
"@babel/core": "7.28.5",
4444
"@babel/eslint-parser": "7.28.5",
4545
"@babel/eslint-plugin": "7.27.1",
46-
"@eslint/js": "^9.39.1",
47-
"eslint": "^9.39.1",
46+
"@eslint/js": "^9.39.2",
47+
"eslint": "^9.39.2",
4848
"eslint-config-prettier": "^10.1.8",
4949
"eslint-plugin-import": "^2.32.0",
5050
"eslint-plugin-prettier": "^5.5.4",

src/helper/handler.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ export default (api, accessories, config, tado, telegram) => {
564564
break;
565565
}
566566
} catch (error) {
567-
Logger.error(`Failed to set states: ${error.message || error}`);
567+
Logger.error(`Failed to set states: ${error.message || JSON.stringify(error)}`);
568568
} finally {
569569
delete helpers[config.homeId].activeSettingStateRuns[runId];
570570
//update zones to ensure correct state in Apple Home
@@ -744,7 +744,7 @@ export default (api, accessories, config, tado, telegram) => {
744744
Logger.warn(`Skipping persistence of tado states file for home ${homeId}: zone states are empty.`);
745745
}
746746
} catch (error) {
747-
Logger.error(`Error while updating the tado states file for home ${homeId}: ${error.message || error}`);
747+
Logger.error(`Error while updating the tado states file for home ${homeId}: ${error.message || JSON.stringify(error)}`);
748748
}
749749
}
750750

@@ -757,7 +757,7 @@ export default (api, accessories, config, tado, telegram) => {
757757
refreshHistory();
758758
}
759759
} catch (error) {
760-
Logger.error(`Error while refreshing history services: ${error.message || error}`);
760+
Logger.error(`Error while refreshing history services: ${error.message || JSON.stringify(error)}`);
761761
}
762762
}
763763

@@ -796,7 +796,7 @@ export default (api, accessories, config, tado, telegram) => {
796796
//Child Lock
797797
if (config.childLock.length) await updateDevices();
798798
} catch (error) {
799-
Logger.error(`Failed to get states: ${error.message || error}`);
799+
Logger.error(`Failed to get states: ${error.message || JSON.stringify(error)}`);
800800
} finally {
801801
void refreshHistoryServices();
802802
}
@@ -850,7 +850,7 @@ export default (api, accessories, config, tado, telegram) => {
850850
try {
851851
await _updateZones();
852852
} catch (error) {
853-
Logger.error(`Failed to update zones: ${error.message || error}`);
853+
Logger.error(`Failed to update zones: ${error.message || JSON.stringify(error)}`);
854854
}
855855
if (helpers[config.homeId].updateZonesNextQueued) {
856856
helpers[config.homeId].updateZonesNextQueued = false;

src/tado/tado-api.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default class Tado {
5959
if (data) return JSON.parse(data);
6060
} catch (error) {
6161
//no persisted counter data => ignore
62-
Logger.debug(`Failed to read tado API file for user ${this.hashedUsername}: ${error.message || error}`);
62+
Logger.debug(`Failed to read tado API file for user ${this.hashedUsername}: ${error.message || JSON.stringify(error)}`);
6363
}
6464
}
6565

@@ -82,7 +82,7 @@ export default class Tado {
8282
this._counter++;
8383
this._counterTimestamp = new Date().toISOString();
8484
} catch (error) {
85-
Logger.warn(`Failed to increase tado API counter: ${error.message || error}`);
85+
Logger.warn(`Failed to increase tado API counter: ${error.message || JSON.stringify(error)}`);
8686
}
8787
}
8888

@@ -100,7 +100,7 @@ export default class Tado {
100100
data.counterData = await this._getCounterData();
101101
await writeFile(join(this.storagePath, `tado-api-${this.hashedUsername}.json`), JSON.stringify(data, null, 2), "utf-8");
102102
} catch (error) {
103-
Logger.error(`Error while updating the tado API file for user ${this.hashedUsername}: ${error.message || error}`);
103+
Logger.error(`Error while updating the tado API file for user ${this.hashedUsername}: ${error.message || JSON.stringify(error)}`);
104104
}
105105
}
106106

@@ -109,7 +109,7 @@ export default class Tado {
109109
const counter = (await this._getCounterData()).counter;
110110
Logger.info(`tado API counter: ${counter.toLocaleString('en-US')}`);
111111
} catch (error) {
112-
Logger.warn(`Failed to get tado API counter: ${error.message || error}`);
112+
Logger.warn(`Failed to get tado API counter: ${error.message || JSON.stringify(error)}`);
113113
}
114114
}
115115

@@ -135,7 +135,7 @@ export default class Tado {
135135

136136
return this._tadoBearerToken.access_token;
137137
} catch (error) {
138-
throw new Error(`API call failed. Could not get access token: ${error.message || error}`);
138+
throw new Error(`API call failed. Could not get access token: ${error.message || JSON.stringify(error)}`);
139139
}
140140
}
141141

@@ -184,7 +184,7 @@ export default class Tado {
184184
await writeFile(this._tadoInternalTokenFilePath, JSON.stringify({ access_token, refresh_token }));
185185
this._tadoBearerToken = { access_token, refresh_token, timestamp: Date.now() };
186186
} catch (error) {
187-
Logger.warn(`Error while refreshing token: ${error.message || error}`);
187+
Logger.warn(`Error while refreshing token: ${error.message || JSON.stringify(error)}`);
188188
return this._authenticateUser();
189189
}
190190
}

0 commit comments

Comments
 (0)