@mp-consulting/homebridge-lg-thinq 1.0.12 → 1.0.13

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.
@@ -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>LG ThinQ</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">
@@ -1,6 +1,20 @@
1
1
  (async () => {
2
2
  'use strict';
3
3
 
4
+ // Confirm theme from Homebridge settings (overrides the early OS-preference detection)
5
+ try {
6
+ const settings = await homebridge.getUserSettings();
7
+ const scheme = settings.colorScheme;
8
+ if (scheme === 'dark' || scheme === 'light') {
9
+ document.documentElement.dataset.bsTheme = scheme;
10
+ } else if (scheme === 'auto') {
11
+ document.documentElement.dataset.bsTheme =
12
+ window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
13
+ }
14
+ } catch {
15
+ // getUserSettings not available in older versions — keep the early-detected theme
16
+ }
17
+
4
18
  // State
5
19
  let credentials = { refresh_token: null, country: null, language: null };
6
20
  let devices = [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Homebridge LG ThinQ",
3
3
  "name": "@mp-consulting/homebridge-lg-thinq",
4
- "version": "1.0.12",
4
+ "version": "1.0.13",
5
5
  "description": "A Homebridge plugin for controlling/monitoring LG ThinQ devices via LG ThinQ platform.",
6
6
  "author": {
7
7
  "name": "Mickael Palma",
@@ -59,7 +59,7 @@
59
59
  "@vitest/coverage-v8": "^4.0.18",
60
60
  "eslint": "^9.39.2",
61
61
  "homebridge": "^2.0.0-beta.55",
62
- "homebridge-config-ui-x": "^5.15.0",
62
+ "homebridge-config-ui-x": "^5.19.0",
63
63
  "nodemon": "^3.1.11",
64
64
  "rimraf": "^6.1.0",
65
65
  "typescript": "^5.9.3",