@homebridge-plugins/homebridge-tado 8.5.0 → 8.5.1-beta.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 CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## v8.5.1 - 2025-10-28
4
+ - Fix: Incorrect update of config zone properties leading to unwanted heating changes (#178)
5
+
3
6
  ## v8.5.0 - 2025-10-27
4
7
  - Change minimum polling interval to 30s due to improvements made in v8.2.0
5
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebridge-plugins/homebridge-tado",
3
- "version": "8.5.0",
3
+ "version": "8.5.1-beta.1",
4
4
  "description": "Homebridge plugin for controlling tado° devices.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -51,4 +51,4 @@
51
51
  "globals": "^16.4.0",
52
52
  "prettier": "^3.6.2"
53
53
  }
54
- }
54
+ }
@@ -27,7 +27,6 @@ export default (api, accessories, config, tado, telegram) => {
27
27
 
28
28
  async function setStates(accessory, accs, target, value) {
29
29
  let zoneUpdated = false;
30
- let allZonesUpdated = false;
31
30
 
32
31
  accessories = accs.filter((acc) => acc && acc.context.config.homeName === config.homeName);
33
32
 
@@ -376,7 +375,6 @@ export default (api, accessories, config, tado, telegram) => {
376
375
  }
377
376
  }
378
377
 
379
- allZonesUpdated = true;
380
378
  await tado.setPresenceLock(config.homeId, targetState);
381
379
 
382
380
  break;
@@ -428,7 +426,6 @@ export default (api, accessories, config, tado, telegram) => {
428
426
  })
429
427
  .filter((id) => id);
430
428
 
431
- allZonesUpdated = true;
432
429
  await tado.resumeShedule(config.homeId, roomIds);
433
430
 
434
431
  //Turn all back to AUTO/ON
@@ -553,7 +550,6 @@ export default (api, accessories, config, tado, telegram) => {
553
550
  .updateValue(false);
554
551
  }
555
552
 
556
- allZonesUpdated = true;
557
553
  await tado.switchAll(config.homeId, rooms);
558
554
 
559
555
  break;
@@ -570,7 +566,7 @@ export default (api, accessories, config, tado, telegram) => {
570
566
  errorHandler(err);
571
567
  } finally {
572
568
  //always update zone to set correct state in Apple Home
573
- if (zoneUpdated || allZonesUpdated) await updateZones(allZonesUpdated ? undefined : accessory.context.config.zoneId);
569
+ if (zoneUpdated) await updateZones(accessory.context.config.zoneId);
574
570
  settingState = false;
575
571
  }
576
572
  }
@@ -875,36 +871,34 @@ export default (api, accessories, config, tado, telegram) => {
875
871
  }
876
872
  }
877
873
 
878
- if (idToUpdate === undefined) {
879
- const allZones = (await tado.getZones(config.homeId)) || [];
874
+ const allZones = (await tado.getZones(config.homeId)) || [];
880
875
 
881
- for (const [index, zone] of config.zones.entries()) {
882
- allZones.forEach((zoneWithID) => {
883
- if (zoneWithID.name === zone.name) {
884
- const heatAccessory = accessories.filter(
885
- (acc) => acc && acc.displayName === config.homeName + ' ' + zone.name + ' Heater'
886
- );
876
+ for (const [index, zone] of config.zones.entries()) {
877
+ allZones.forEach((zoneWithID) => {
878
+ if (zoneWithID.name === zone.name) {
879
+ const heatAccessory = accessories.filter(
880
+ (acc) => acc && acc.displayName === config.homeName + ' ' + zone.name + ' Heater'
881
+ );
887
882
 
888
- if (heatAccessory.length) heatAccessory[0].context.config.zoneId = zoneWithID.id;
889
-
890
- config.zones[index].id = zoneWithID.id;
891
- config.zones[index].battery = !config.zones[index].noBattery
892
- ? zoneWithID.devices.filter(
893
- (device) =>
894
- device &&
895
- (zone.type === 'HEATING' || zone.type === 'AIR_CONDITIONING') &&
896
- typeof device.batteryState === 'string' &&
897
- !device.batteryState.includes('NORMAL')
898
- ).length
899
- ? zoneWithID.devices.filter((device) => device && !device.batteryState.includes('NORMAL'))[0]
900
- .batteryState
901
- : zoneWithID.devices.filter((device) => device && device.duties.includes('ZONE_LEADER'))[0].batteryState
902
- : false;
903
- config.zones[index].openWindowEnabled =
904
- zoneWithID.openWindowDetection && zoneWithID.openWindowDetection.enabled ? true : false;
905
- }
906
- });
907
- }
883
+ if (heatAccessory.length) heatAccessory[0].context.config.zoneId = zoneWithID.id;
884
+
885
+ config.zones[index].id = zoneWithID.id;
886
+ config.zones[index].battery = !config.zones[index].noBattery
887
+ ? zoneWithID.devices.filter(
888
+ (device) =>
889
+ device &&
890
+ (zone.type === 'HEATING' || zone.type === 'AIR_CONDITIONING') &&
891
+ typeof device.batteryState === 'string' &&
892
+ !device.batteryState.includes('NORMAL')
893
+ ).length
894
+ ? zoneWithID.devices.filter((device) => device && !device.batteryState.includes('NORMAL'))[0]
895
+ .batteryState
896
+ : zoneWithID.devices.filter((device) => device && device.duties.includes('ZONE_LEADER'))[0].batteryState
897
+ : false;
898
+ config.zones[index].openWindowEnabled =
899
+ zoneWithID.openWindowDetection && zoneWithID.openWindowDetection.enabled ? true : false;
900
+ }
901
+ });
908
902
  }
909
903
 
910
904
  let zonesToUpdate = [];