@mp-consulting/homebridge-unifi-access 1.0.8 → 1.0.9

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.
@@ -108,6 +108,19 @@ const bindSupportScreen = () => {
108
108
  // Initialize the plugin UI.
109
109
  const init = async () => {
110
110
 
111
+ // Confirm theme from Homebridge settings (overrides the early OS-preference detection)
112
+ try {
113
+ const settings = await homebridge.getUserSettings();
114
+ const scheme = settings.colorScheme;
115
+ if (scheme === 'dark' || scheme === 'light') {
116
+ document.documentElement.dataset.bsTheme = scheme;
117
+ } else if (scheme === 'auto') {
118
+ document.documentElement.dataset.bsTheme =
119
+ window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
120
+ }
121
+ } catch {
122
+ // getUserSettings not available in older versions — keep the early-detected theme
123
+ }
111
124
 
112
125
  bindDiscoveryScreen();
113
126
  bindSetupScreen();
@@ -4,6 +4,13 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <title>UniFi Access</title>
7
+ <!-- Detect theme before CSS renders to avoid flash of wrong theme -->
8
+ <script>
9
+ (function () {
10
+ var dark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
11
+ document.documentElement.dataset.bsTheme = dark ? 'dark' : 'light';
12
+ }());
13
+ </script>
7
14
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
8
15
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
9
16
  <link rel="stylesheet" href="lib/kit.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mp-consulting/homebridge-unifi-access",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "displayName": "UniFi Access",
5
5
  "description": "Complete HomeKit support for UniFi Access devices — locks, doorbells, sensors, and readers — with automatic device discovery and realtime events.",
6
6
  "author": "Mickael Palma",
@@ -71,13 +71,13 @@
71
71
  "unifi-access": "1.5.3"
72
72
  },
73
73
  "devDependencies": {
74
- "@mp-consulting/homebridge-ui-kit": "^1.0.0",
75
74
  "@eslint/js": "^9.39.2",
75
+ "@mp-consulting/homebridge-ui-kit": "^1.0.0",
76
76
  "@types/node": "^24.0.0",
77
77
  "@vitest/coverage-v8": "^4.0.18",
78
78
  "eslint": "^9.39.2",
79
79
  "homebridge": "^2.0.0-beta.55",
80
- "homebridge-config-ui-x": "^5.15.0",
80
+ "homebridge-config-ui-x": "^5.19.0",
81
81
  "nodemon": "^3.1.11",
82
82
  "shx": "0.4.0",
83
83
  "typescript": "^5.9.3",