homebridge-mitsubishi-comfort 1.0.0 → 1.0.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/dist/accessory.js CHANGED
@@ -41,9 +41,9 @@ class KumoThermostatAccessory {
41
41
  this.updateStatus();
42
42
  }, this.pollIntervalMs);
43
43
  }
44
- async updateStatus() {
44
+ async updateStatus(forceRefresh = false) {
45
45
  try {
46
- const result = await this.kumoAPI.getZonesWithETag(this.siteId);
46
+ const result = await this.kumoAPI.getZonesWithETag(this.siteId, forceRefresh);
47
47
  if (result.notModified) {
48
48
  this.platform.log.debug(`Status not modified for device ${this.deviceSerial}`);
49
49
  return;
@@ -210,7 +210,7 @@ class KumoThermostatAccessory {
210
210
  operationMode,
211
211
  });
212
212
  if (success) {
213
- setTimeout(() => this.updateStatus(), 1000);
213
+ setTimeout(() => this.updateStatus(true), 1000);
214
214
  }
215
215
  else {
216
216
  this.platform.log.error(`Failed to set target heating cooling state for ${this.accessory.displayName}`);
@@ -279,7 +279,7 @@ class KumoThermostatAccessory {
279
279
  }
280
280
  const success = await this.kumoAPI.sendCommand(this.deviceSerial, commands);
281
281
  if (success) {
282
- setTimeout(() => this.updateStatus(), 1000);
282
+ setTimeout(() => this.updateStatus(true), 1000);
283
283
  }
284
284
  else {
285
285
  this.platform.log.error(`Failed to set target temperature for ${this.accessory.displayName}: ${JSON.stringify(commands)}`);
@@ -20,7 +20,7 @@ export declare class KumoAPI {
20
20
  private makeAuthenticatedRequest;
21
21
  getSites(): Promise<Site[]>;
22
22
  getZones(siteId: string): Promise<Zone[]>;
23
- getZonesWithETag(siteId: string): Promise<{
23
+ getZonesWithETag(siteId: string, forceRefresh?: boolean): Promise<{
24
24
  zones: Zone[];
25
25
  notModified: boolean;
26
26
  }>;
package/dist/kumo-api.js CHANGED
@@ -200,7 +200,7 @@ class KumoAPI {
200
200
  const zones = await this.makeAuthenticatedRequest(`/sites/${siteId}/zones`);
201
201
  return zones || [];
202
202
  }
203
- async getZonesWithETag(siteId) {
203
+ async getZonesWithETag(siteId, forceRefresh = false) {
204
204
  const etag = this.siteEtags.get(siteId);
205
205
  const authenticated = await this.ensureAuthenticated();
206
206
  if (!authenticated) {
@@ -209,7 +209,7 @@ class KumoAPI {
209
209
  }
210
210
  try {
211
211
  const headers = this.getAuthHeaders();
212
- if (etag) {
212
+ if (etag && !forceRefresh) {
213
213
  headers['If-None-Match'] = etag;
214
214
  }
215
215
  const response = await (0, node_fetch_1.default)(`${settings_1.API_BASE_URL}/sites/${siteId}/zones`, { headers });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-mitsubishi-comfort",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Homebridge plugin for Mitsubishi heat pumps using Kumo Cloud v3 API",
5
5
  "author": "burtherman",
6
6
  "main": "dist/index.js",