homebridge-multiple-switch 1.3.3 → 1.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.4.1] - 2026-03-21
4
+
5
+ ### Fixed
6
+ - Dark mode: replaced Bootstrap CSS variables (not available inside iframe) with
7
+ custom `--ui-*` variables and `@media (prefers-color-scheme: dark)` for reliable
8
+ light/dark theme detection across all elements (cards, inputs, labels, borders)
9
+
10
+ ## [1.4.0] - 2026-03-21
11
+
12
+ ### Removed
13
+ - Lightbulb and Fan switch types (HomeKit natively converts switches to these)
14
+
15
+ ### Fixed
16
+ - Custom UI white background in dark mode — set `background: transparent !important`
17
+ on html/body so the iframe inherits the Homebridge theme
18
+
3
19
  ## [1.3.3] - 2026-03-21
4
20
 
5
21
  ### Fixed
@@ -42,9 +42,7 @@
42
42
  "default": "outlet",
43
43
  "oneOf": [
44
44
  { "title": "Switch", "enum": ["switch"] },
45
- { "title": "Outlet", "enum": ["outlet"] },
46
- { "title": "Lightbulb", "enum": ["lightbulb"] },
47
- { "title": "Fan", "enum": ["fan"] }
45
+ { "title": "Outlet", "enum": ["outlet"] }
48
46
  ]
49
47
  },
50
48
  "defaultState": {
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "نوع ملحق HomeKit لهذا المفتاح.",
16
16
  "typeSwitch": "مفتاح",
17
17
  "typeOutlet": "مقبس",
18
- "typeLightbulb": "مصباح",
19
- "typeFan": "مروحة",
20
18
  "defaultState": "الحالة الافتراضية",
21
19
  "defaultStateDesc": "حالة الطاقة الأولية عند بدء تشغيل Homebridge.",
22
20
  "delayOff": "إيقاف تلقائي (مللي ثانية)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "Der HomeKit-Zubehörtyp für diesen Schalter.",
16
16
  "typeSwitch": "Schalter",
17
17
  "typeOutlet": "Steckdose",
18
- "typeLightbulb": "Glühbirne",
19
- "typeFan": "Ventilator",
20
18
  "defaultState": "Standardzustand",
21
19
  "defaultStateDesc": "Anfänglicher Energiezustand beim Start von Homebridge.",
22
20
  "delayOff": "Automatisch ausschalten (ms)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "The HomeKit accessory type for this switch.",
16
16
  "typeSwitch": "Switch",
17
17
  "typeOutlet": "Outlet",
18
- "typeLightbulb": "Lightbulb",
19
- "typeFan": "Fan",
20
18
  "defaultState": "Default State",
21
19
  "defaultStateDesc": "Initial power state when Homebridge starts.",
22
20
  "delayOff": "Auto Turn Off (ms)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "El tipo de accesorio HomeKit para este interruptor.",
16
16
  "typeSwitch": "Interruptor",
17
17
  "typeOutlet": "Enchufe",
18
- "typeLightbulb": "Bombilla",
19
- "typeFan": "Ventilador",
20
18
  "defaultState": "Estado predeterminado",
21
19
  "defaultStateDesc": "Estado de energía inicial cuando Homebridge se inicia.",
22
20
  "delayOff": "Apagado automático (ms)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "Le type d'accessoire HomeKit pour cet interrupteur.",
16
16
  "typeSwitch": "Interrupteur",
17
17
  "typeOutlet": "Prise",
18
- "typeLightbulb": "Ampoule",
19
- "typeFan": "Ventilateur",
20
18
  "defaultState": "État par défaut",
21
19
  "defaultStateDesc": "État d'alimentation initial au démarrage de Homebridge.",
22
20
  "delayOff": "Arrêt automatique (ms)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "Il tipo di accessorio HomeKit per questo interruttore.",
16
16
  "typeSwitch": "Interruttore",
17
17
  "typeOutlet": "Presa",
18
- "typeLightbulb": "Lampadina",
19
- "typeFan": "Ventilatore",
20
18
  "defaultState": "Stato predefinito",
21
19
  "defaultStateDesc": "Stato di alimentazione iniziale all'avvio di Homebridge.",
22
20
  "delayOff": "Spegnimento automatico (ms)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "このスイッチの HomeKit アクセサリタイプ。",
16
16
  "typeSwitch": "スイッチ",
17
17
  "typeOutlet": "コンセント",
18
- "typeLightbulb": "電球",
19
- "typeFan": "ファン",
20
18
  "defaultState": "デフォルト状態",
21
19
  "defaultStateDesc": "Homebridge 起動時の初期電源状態。",
22
20
  "delayOff": "自動オフ(ミリ秒)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "이 스위치의 HomeKit 액세서리 유형.",
16
16
  "typeSwitch": "스위치",
17
17
  "typeOutlet": "콘센트",
18
- "typeLightbulb": "전구",
19
- "typeFan": "팬",
20
18
  "defaultState": "기본 상태",
21
19
  "defaultStateDesc": "Homebridge 시작 시 초기 전원 상태.",
22
20
  "delayOff": "자동 꺼짐 (ms)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "Het HomeKit-accessoiretype voor deze schakelaar.",
16
16
  "typeSwitch": "Schakelaar",
17
17
  "typeOutlet": "Stopcontact",
18
- "typeLightbulb": "Gloeilamp",
19
- "typeFan": "Ventilator",
20
18
  "defaultState": "Standaardstatus",
21
19
  "defaultStateDesc": "Initiële voedingsstatus wanneer Homebridge opstart.",
22
20
  "delayOff": "Automatisch uitschakelen (ms)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "Typ akcesorium HomeKit dla tego przełącznika.",
16
16
  "typeSwitch": "Przełącznik",
17
17
  "typeOutlet": "Gniazdko",
18
- "typeLightbulb": "Żarówka",
19
- "typeFan": "Wentylator",
20
18
  "defaultState": "Stan domyślny",
21
19
  "defaultStateDesc": "Początkowy stan zasilania przy uruchomieniu Homebridge.",
22
20
  "delayOff": "Automatyczne wyłączenie (ms)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "O tipo de acessório HomeKit para este interruptor.",
16
16
  "typeSwitch": "Interruptor",
17
17
  "typeOutlet": "Tomada",
18
- "typeLightbulb": "Lâmpada",
19
- "typeFan": "Ventilador",
20
18
  "defaultState": "Estado padrão",
21
19
  "defaultStateDesc": "Estado de energia inicial quando o Homebridge inicia.",
22
20
  "delayOff": "Desligamento automático (ms)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "Тип аксессуара HomeKit для этого переключателя.",
16
16
  "typeSwitch": "Выключатель",
17
17
  "typeOutlet": "Розетка",
18
- "typeLightbulb": "Лампочка",
19
- "typeFan": "Вентилятор",
20
18
  "defaultState": "Состояние по умолчанию",
21
19
  "defaultStateDesc": "Начальное состояние питания при запуске Homebridge.",
22
20
  "delayOff": "Автоматическое выключение (мс)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "Bu anahtar için HomeKit aksesuar tipi.",
16
16
  "typeSwitch": "Anahtar",
17
17
  "typeOutlet": "Priz",
18
- "typeLightbulb": "Ampul",
19
- "typeFan": "Vantilatör",
20
18
  "defaultState": "Varsayılan Durum",
21
19
  "defaultStateDesc": "Homebridge başladığında başlangıç güç durumu.",
22
20
  "delayOff": "Otomatik Kapanma (ms)",
@@ -15,8 +15,6 @@
15
15
  "switchTypeDesc": "此开关的 HomeKit 配件类型。",
16
16
  "typeSwitch": "开关",
17
17
  "typeOutlet": "插座",
18
- "typeLightbulb": "灯泡",
19
- "typeFan": "风扇",
20
18
  "defaultState": "默认状态",
21
19
  "defaultStateDesc": "Homebridge 启动时的初始电源状态。",
22
20
  "delayOff": "自动关闭(毫秒)",
@@ -1,34 +1,55 @@
1
1
  <style>
2
+ :root {
3
+ --ui-bg: #fff;
4
+ --ui-text: #212529;
5
+ --ui-text-muted: #6c757d;
6
+ --ui-border: #dee2e6;
7
+ --ui-card-bg: #f8f9fa;
8
+ --ui-input-bg: #fff;
9
+ --ui-accent: #007bff;
10
+ }
11
+ @media (prefers-color-scheme: dark) {
12
+ :root {
13
+ --ui-bg: transparent;
14
+ --ui-text: #e1e1e1;
15
+ --ui-text-muted: #9e9e9e;
16
+ --ui-border: #444;
17
+ --ui-card-bg: rgba(255,255,255,0.06);
18
+ --ui-input-bg: rgba(255,255,255,0.08);
19
+ --ui-accent: #7b61ff;
20
+ }
21
+ }
2
22
  * { box-sizing: border-box; margin: 0; padding: 0; }
3
- body {
23
+ html, body {
4
24
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
5
- color: var(--bs-body-color, inherit);
25
+ color: var(--ui-text);
26
+ background: var(--ui-bg) !important;
6
27
  }
7
28
  .form-group { margin-bottom: 16px; }
8
29
  label {
9
30
  display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px;
10
- color: var(--bs-body-color, inherit);
31
+ color: var(--ui-text);
11
32
  }
12
33
  .desc {
13
- color: var(--bs-secondary-color, #888);
34
+ color: var(--ui-text-muted);
14
35
  font-size: 12px; margin-bottom: 6px;
15
36
  }
16
37
  input[type="text"], input[type="number"], select {
17
38
  width: 100%; padding: 8px 10px;
18
- border: 1px solid var(--bs-border-color, #444);
39
+ border: 1px solid var(--ui-border);
19
40
  border-radius: 6px; font-size: 14px;
20
- background: var(--bs-body-bg, transparent);
21
- color: var(--bs-body-color, inherit);
41
+ background: var(--ui-input-bg);
42
+ color: var(--ui-text);
22
43
  transition: border-color 0.2s;
23
44
  }
24
45
  input:focus, select:focus {
25
- border-color: var(--bs-primary, #007bff);
46
+ border-color: var(--ui-accent);
26
47
  outline: none;
27
48
  }
28
49
  .switch-card {
29
- border: 1px solid var(--bs-border-color, #444);
50
+ border: 1px solid var(--ui-border);
30
51
  border-radius: 8px; padding: 16px; margin-bottom: 12px;
31
- background: var(--bs-tertiary-bg, rgba(128,128,128,0.08));
52
+ background: var(--ui-card-bg);
32
53
  position: relative;
33
54
  }
34
55
  .switch-card .switch-header {
@@ -36,7 +57,7 @@
36
57
  }
37
58
  .switch-card .switch-header strong {
38
59
  font-size: 14px;
39
- color: var(--bs-body-color, inherit);
60
+ color: var(--ui-text);
40
61
  }
41
62
  .btn {
42
63
  padding: 8px 16px; border: none; border-radius: 6px;
@@ -44,21 +65,21 @@
44
65
  }
45
66
  .btn-danger { background: #dc3545; color: #fff; }
46
67
  .btn-danger:hover { background: #c82333; }
47
- .btn-primary { background: var(--bs-primary, #007bff); color: #fff; }
68
+ .btn-primary { background: var(--ui-accent); color: #fff; }
48
69
  .btn-primary:hover { opacity: 0.85; }
49
70
  .actions { margin-top: 16px; display: flex; gap: 10px; }
50
71
  .toggle-wrap { display: flex; align-items: center; gap: 8px; }
51
- .toggle-wrap input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--bs-primary, #007bff); }
52
- .toggle-wrap span { color: var(--bs-body-color, inherit); }
72
+ .toggle-wrap input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--ui-accent); }
73
+ .toggle-wrap span { color: var(--ui-text); }
53
74
  .section-title {
54
75
  font-size: 15px; font-weight: 700; margin-bottom: 10px;
55
- padding-bottom: 6px; border-bottom: 1px solid var(--bs-border-color, #444);
56
- color: var(--bs-body-color, inherit);
76
+ padding-bottom: 6px; border-bottom: 1px solid var(--ui-border);
77
+ color: var(--ui-text);
57
78
  }
58
79
  .inline-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
59
80
  select option {
60
- background: var(--bs-body-bg, #fff);
61
- color: var(--bs-body-color, #000);
81
+ background: var(--ui-input-bg);
82
+ color: var(--ui-text);
62
83
  }
63
84
  </style>
64
85
 
@@ -182,8 +203,6 @@
182
203
  <select class="sw-field" data-idx="${i}" data-field="type">
183
204
  <option value="switch" ${sw.type === 'switch' ? 'selected' : ''}>${t.typeSwitch || 'Switch'}</option>
184
205
  <option value="outlet" ${sw.type === 'outlet' || !sw.type ? 'selected' : ''}>${t.typeOutlet || 'Outlet'}</option>
185
- <option value="lightbulb" ${sw.type === 'lightbulb' ? 'selected' : ''}>${t.typeLightbulb || 'Lightbulb'}</option>
186
- <option value="fan" ${sw.type === 'fan' ? 'selected' : ''}>${t.typeFan || 'Fan'}</option>
187
206
  </select>
188
207
  </div>
189
208
  </div>
package/index.js CHANGED
@@ -5,8 +5,6 @@ const PLATFORM_NAME = 'MultipleSwitchPlatform';
5
5
 
6
6
  const SERVICE_TYPES = {
7
7
  switch: 'Switch',
8
- lightbulb: 'Lightbulb',
9
- fan: 'Fan',
10
8
  outlet: 'Outlet',
11
9
  };
12
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-multiple-switch",
3
- "version": "1.3.3",
3
+ "version": "1.4.1",
4
4
  "description": "Multiple switch platform for Homebridge",
5
5
  "homepage": "https://github.com/azadaydinli/homebridge-multiple-switch",
6
6
  "main": "index.js",