homebridge-tsvesync 1.4.6 → 1.4.7

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.
@@ -64,7 +64,7 @@ describe('Outlet Device Tests', () => {
64
64
  serverVersion: '1.0.0',
65
65
  user: {
66
66
  configPath: jest.fn(),
67
- storagePath: jest.fn(),
67
+ storagePath: jest.fn().mockReturnValue('/tmp'),
68
68
  persistPath: jest.fn(),
69
69
  },
70
70
  hapLegacyTypes: {},
@@ -155,6 +155,7 @@ describe('Outlet Device Tests', () => {
155
155
  accessory,
156
156
  device,
157
157
  initialize: jest.fn().mockResolvedValue(undefined),
158
+ applyUpdatedDeviceState: jest.fn(),
158
159
  updateCharacteristicValue: jest.fn(),
159
160
  } as unknown as BaseAccessory;
160
161
  return baseAccessory;
@@ -172,7 +173,7 @@ describe('Outlet Device Tests', () => {
172
173
 
173
174
  // Setup VeSync client with the mock outlet
174
175
  mockVeSync.outlets = [mockOutlet];
175
- mockVeSync.getDevices.mockResolvedValue(true);
176
+ mockVeSync.update.mockResolvedValue(undefined);
176
177
  mockVeSync.login.mockResolvedValue(true);
177
178
 
178
179
  // Initialize platform and wait for discovery
@@ -451,7 +452,7 @@ describe('Outlet Device Tests', () => {
451
452
 
452
453
  // Setup VeSync client with the mock outlet
453
454
  mockVeSync.outlets = [mockOutlet];
454
- mockVeSync.getDevices.mockResolvedValue(true);
455
+ mockVeSync.update.mockResolvedValue(undefined);
455
456
  mockVeSync.login.mockResolvedValue(true);
456
457
 
457
458
  // Initialize platform and wait for discovery
@@ -478,7 +479,7 @@ describe('Outlet Device Tests', () => {
478
479
 
479
480
  // Setup VeSync client with the mock outlet
480
481
  mockVeSync.outlets = [mockOutlet];
481
- mockVeSync.getDevices.mockResolvedValue(true);
482
+ mockVeSync.update.mockResolvedValue(undefined);
482
483
  mockVeSync.login.mockResolvedValue(true);
483
484
 
484
485
  // Initialize platform and wait for discovery
@@ -505,7 +506,7 @@ describe('Outlet Device Tests', () => {
505
506
 
506
507
  // Setup VeSync client with the mock outlet
507
508
  mockVeSync.outlets = [mockOutlet];
508
- mockVeSync.getDevices.mockResolvedValue(true);
509
+ mockVeSync.update.mockResolvedValue(undefined);
509
510
  mockVeSync.login.mockResolvedValue(true);
510
511
 
511
512
  // Initialize platform and wait for discovery
@@ -523,4 +524,4 @@ describe('Outlet Device Tests', () => {
523
524
  expect(mockOutlet.deviceType).toBe('wifi-switch-1.3');
524
525
  });
525
526
  });
526
- });
527
+ });
@@ -54,7 +54,7 @@ describe('Switch Device Tests', () => {
54
54
  serverVersion: '1.0.0',
55
55
  user: {
56
56
  configPath: jest.fn(),
57
- storagePath: jest.fn(),
57
+ storagePath: jest.fn().mockReturnValue('/tmp'),
58
58
  persistPath: jest.fn(),
59
59
  },
60
60
  hapLegacyTypes: {},
@@ -140,7 +140,7 @@ describe('Switch Device Tests', () => {
140
140
  // Setup VeSync mock
141
141
  mockVeSync = {
142
142
  login: jest.fn().mockResolvedValue(true),
143
- getDevices: jest.fn().mockResolvedValue(true),
143
+ update: jest.fn().mockResolvedValue(undefined),
144
144
  switches: [],
145
145
  } as unknown as jest.Mocked<VeSync>;
146
146
 
@@ -182,7 +182,7 @@ describe('Switch Device Tests', () => {
182
182
  });
183
183
 
184
184
  // Mock successful details retrieval
185
- mockSwitch.getDetails.mockResolvedValue(true);
185
+ (mockSwitch.getDetails as unknown as jest.Mock).mockResolvedValue(true);
186
186
  mockSwitch.deviceStatus = 'off';
187
187
 
188
188
  // Create a mock accessory
@@ -255,7 +255,7 @@ describe('Switch Device Tests', () => {
255
255
  });
256
256
 
257
257
  // Mock successful details retrieval
258
- mockSwitch.getDetails.mockResolvedValue(true);
258
+ (mockSwitch.getDetails as unknown as jest.Mock).mockResolvedValue(true);
259
259
  mockSwitch.deviceStatus = 'off';
260
260
 
261
261
  // Create a mock accessory
@@ -282,7 +282,7 @@ describe('Switch Device Tests', () => {
282
282
  });
283
283
 
284
284
  // Mock successful details retrieval
285
- mockSwitch.getDetails.mockResolvedValue(true);
285
+ (mockSwitch.getDetails as unknown as jest.Mock).mockResolvedValue(true);
286
286
  mockSwitch.deviceStatus = 'off';
287
287
 
288
288
  // Create a mock accessory
@@ -299,4 +299,4 @@ describe('Switch Device Tests', () => {
299
299
  expect(mockSwitch.deviceType).toBe('other-switch-type');
300
300
  });
301
301
  });
302
- });
302
+ });