@mp-consulting/homebridge-daikin-cloud 1.3.1 → 1.3.3

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
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.3.3] - 2026-01-10
9
+
10
+ ### Fixed
11
+
12
+ - **UI initialization race condition**: Fixed "Token expired or invalid" error on initial UI load. The device list now waits for `AuthMode` initialization to complete before fetching devices. Backend now gracefully falls back to active token if the requested mode's token is unavailable, ensuring device list loads even during initialization.
13
+
14
+ ## [1.3.2] - 2026-01-10
15
+
16
+ ### Fixed
17
+
18
+ - **UI JavaScript error**: Fixed "Can't find variable: AuthModeManager" error by correcting variable reference to `AuthMode`. This error prevented the device list from loading in the plugin UI.
19
+
8
20
  ## [1.3.1] - 2026-01-10
9
21
 
10
22
  ### Fixed
@@ -629,7 +629,7 @@ const Settings = {
629
629
  DOM.hide(empty);
630
630
 
631
631
  try {
632
- const result = await homebridge.request('/devices/list', { mode: AuthModeManager.current });
632
+ const result = await homebridge.request('/devices/list', { mode: AuthMode.current });
633
633
  DOM.hide(loading);
634
634
 
635
635
  if (!result.success || !result.devices.length) {
@@ -743,7 +743,7 @@ const Devices = {
743
743
  DOM.hide(El.devicesError);
744
744
 
745
745
  try {
746
- const result = await homebridge.request('/devices/list', { mode: AuthModeManager.current });
746
+ const result = await homebridge.request('/devices/list', { mode: AuthMode.current });
747
747
  DOM.hide(El.devicesLoading);
748
748
 
749
749
  if (!result.success) {
@@ -1071,11 +1071,11 @@ function cacheElements() {
1071
1071
  };
1072
1072
  }
1073
1073
 
1074
- document.addEventListener('DOMContentLoaded', () => {
1074
+ document.addEventListener('DOMContentLoaded', async () => {
1075
1075
  cacheElements();
1076
1076
  Auth.loadStatus();
1077
1077
  Config.load();
1078
1078
  Settings.load();
1079
+ await AuthMode.init();
1079
1080
  Devices.load();
1080
- AuthMode.init();
1081
1081
  });
@@ -789,6 +789,11 @@ class DaikinCloudUiServer extends HomebridgePluginUiServer {
789
789
  tokenSet = this.getActiveTokenSet();
790
790
  }
791
791
 
792
+ // If the requested mode's token doesn't exist or is invalid, fall back to active token
793
+ if (!tokenSet?.access_token) {
794
+ tokenSet = this.getActiveTokenSet();
795
+ }
796
+
792
797
  if (!tokenSet?.access_token) {
793
798
  return { success: false, devices: [], message: 'Not authenticated. Please authenticate first.' };
794
799
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "displayName": "Daikin Cloud",
3
3
  "platformname": "daikincloud",
4
4
  "name": "@mp-consulting/homebridge-daikin-cloud",
5
- "version": "1.3.1",
5
+ "version": "1.3.3",
6
6
  "description": "Integrate with the Daikin Cloud to control your Daikin air conditioning via the cloud",
7
7
  "license": "Apache-2.0",
8
8
  "repository": {