tsvesync 1.0.45 → 1.0.46

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.
@@ -88,8 +88,9 @@ export declare class VeSync {
88
88
  deviceTimeCheck(): boolean;
89
89
  /**
90
90
  * Update device list and details
91
+ * @param excludeDevices - Optional array of device IDs to exclude from detail updates
91
92
  */
92
- update(): Promise<void>;
93
+ update(excludeDevices?: string[]): Promise<void>;
93
94
  /**
94
95
  * Create device instance from details
95
96
  */
@@ -448,8 +448,9 @@ class VeSync {
448
448
  }
449
449
  /**
450
450
  * Update device list and details
451
+ * @param excludeDevices - Optional array of device IDs to exclude from detail updates
451
452
  */
452
- async update() {
453
+ async update(excludeDevices = []) {
453
454
  if (this.deviceTimeCheck()) {
454
455
  if (!this.enabled) {
455
456
  logger_1.logger.error('Not logged in to VeSync');
@@ -459,6 +460,11 @@ class VeSync {
459
460
  logger_1.logger.debug('Start updating the device details one by one');
460
461
  for (const deviceList of Object.values(this._devList)) {
461
462
  for (const device of deviceList) {
463
+ // Skip excluded devices
464
+ if (excludeDevices.includes(device.cid)) {
465
+ logger_1.logger.debug(`Skipping update for excluded device ${device.deviceName} (${device.cid})`);
466
+ continue;
467
+ }
462
468
  try {
463
469
  await device.getDetails();
464
470
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tsvesync",
3
- "version": "1.0.45",
3
+ "version": "1.0.46",
4
4
  "description": "A TypeScript library for interacting with VeSync smart home devices",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/lib/vesync.ts CHANGED
@@ -549,8 +549,9 @@ export class VeSync {
549
549
 
550
550
  /**
551
551
  * Update device list and details
552
+ * @param excludeDevices - Optional array of device IDs to exclude from detail updates
552
553
  */
553
- async update(): Promise<void> {
554
+ async update(excludeDevices: string[] = []): Promise<void> {
554
555
  if (this.deviceTimeCheck()) {
555
556
  if (!this.enabled) {
556
557
  logger.error('Not logged in to VeSync');
@@ -562,6 +563,12 @@ export class VeSync {
562
563
  logger.debug('Start updating the device details one by one');
563
564
  for (const deviceList of Object.values(this._devList)) {
564
565
  for (const device of deviceList) {
566
+ // Skip excluded devices
567
+ if (excludeDevices.includes(device.cid)) {
568
+ logger.debug(`Skipping update for excluded device ${device.deviceName} (${device.cid})`);
569
+ continue;
570
+ }
571
+
565
572
  try {
566
573
  await device.getDetails();
567
574
  } catch (error) {