@homebridge-plugins/homebridge-tado 8.3.0 → 8.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/package.json +1 -1
- package/src/helper/handler.js +12 -8
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/helper/handler.js
CHANGED
|
@@ -717,11 +717,15 @@ export default (api, accessories, config, tado, telegram) => {
|
|
|
717
717
|
|
|
718
718
|
async function persistStates(homeId, zoneStates) {
|
|
719
719
|
try {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
720
|
+
if (zoneStates && Object.keys(zoneStates).length) {
|
|
721
|
+
const homeData = {};
|
|
722
|
+
homeData.zoneStates = zoneStates;
|
|
723
|
+
await writeFile(join(storagePath, `tado-states-${homeId}.json`), JSON.stringify(homeData, null, 2), "utf-8");
|
|
724
|
+
} else {
|
|
725
|
+
Logger.info(`Skipping persistence of tado states for home ${homeId}: zone states are empty.`);
|
|
726
|
+
}
|
|
723
727
|
} catch (error) {
|
|
724
|
-
Logger.error(`Error while updating the tado states file for home
|
|
728
|
+
Logger.error(`Error while updating the tado states file for home ${homeId}: ${error.message || error}`);
|
|
725
729
|
}
|
|
726
730
|
try {
|
|
727
731
|
const data = {};
|
|
@@ -731,10 +735,10 @@ export default (api, accessories, config, tado, telegram) => {
|
|
|
731
735
|
Logger.error(`Error while updating the tado states file: ${error.message || error}`);
|
|
732
736
|
}
|
|
733
737
|
try {
|
|
734
|
-
//wait for fakegato services to be loaded
|
|
738
|
+
//wait for fakegato history services to be loaded
|
|
735
739
|
await new Promise(r => setTimeout(r, 4000));
|
|
736
|
-
for (const
|
|
737
|
-
|
|
740
|
+
for (const refreshHistory of aRefreshHistoryHandlers) {
|
|
741
|
+
refreshHistory();
|
|
738
742
|
}
|
|
739
743
|
} catch (error) {
|
|
740
744
|
Logger.error(`Error while refreshing history: ${error.message || error}`);
|
|
@@ -1568,7 +1572,7 @@ export default (api, accessories, config, tado, telegram) => {
|
|
|
1568
1572
|
error = err;
|
|
1569
1573
|
}
|
|
1570
1574
|
|
|
1571
|
-
Logger.error(error, config.homeName);
|
|
1575
|
+
Logger.error("Error:", error, config.homeName);
|
|
1572
1576
|
|
|
1573
1577
|
return;
|
|
1574
1578
|
}
|