homebridge-multiple-switch 1.3.2 → 1.4.0

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.0] - 2026-03-21
4
+
5
+ ### Removed
6
+ - Lightbulb and Fan switch types (HomeKit natively converts switches to these)
7
+
8
+ ### Fixed
9
+ - Custom UI white background in dark mode — set `background: transparent !important`
10
+ on html/body so the iframe inherits the Homebridge theme
11
+
12
+ ## [1.3.3] - 2026-03-21
13
+
14
+ ### Fixed
15
+ - Custom UI light/dark mode support: all labels, inputs, cards, and borders
16
+ now use Homebridge Bootstrap CSS variables (`--bs-body-color`, `--bs-body-bg`,
17
+ `--bs-border-color`, `--bs-tertiary-bg`) for proper theme adaptation
18
+
3
19
  ## [1.3.2] - 2026-03-21
4
20
 
5
21
  ### Changed
@@ -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,33 +1,66 @@
1
1
  <style>
2
2
  * { box-sizing: border-box; margin: 0; padding: 0; }
3
- body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #333; }
3
+ html, body {
4
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
5
+ color: var(--bs-body-color, inherit);
6
+ background: transparent !important;
7
+ }
4
8
  .form-group { margin-bottom: 16px; }
5
- label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
6
- .desc { color: #666; font-size: 12px; margin-bottom: 6px; }
9
+ label {
10
+ display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px;
11
+ color: var(--bs-body-color, inherit);
12
+ }
13
+ .desc {
14
+ color: var(--bs-secondary-color, #888);
15
+ font-size: 12px; margin-bottom: 6px;
16
+ }
7
17
  input[type="text"], input[type="number"], select {
8
- width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px;
9
- font-size: 14px; background: #fff; transition: border-color 0.2s;
18
+ width: 100%; padding: 8px 10px;
19
+ border: 1px solid var(--bs-border-color, #444);
20
+ border-radius: 6px; font-size: 14px;
21
+ background: var(--bs-body-bg, transparent);
22
+ color: var(--bs-body-color, inherit);
23
+ transition: border-color 0.2s;
24
+ }
25
+ input:focus, select:focus {
26
+ border-color: var(--bs-primary, #007bff);
27
+ outline: none;
10
28
  }
11
- input:focus, select:focus { border-color: #007bff; outline: none; }
12
29
  .switch-card {
13
- border: 1px solid #ddd; border-radius: 8px; padding: 16px; margin-bottom: 12px;
14
- background: #fafafa; position: relative;
30
+ border: 1px solid var(--bs-border-color, #444);
31
+ border-radius: 8px; padding: 16px; margin-bottom: 12px;
32
+ background: var(--bs-tertiary-bg, rgba(128,128,128,0.08));
33
+ position: relative;
34
+ }
35
+ .switch-card .switch-header {
36
+ display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
37
+ }
38
+ .switch-card .switch-header strong {
39
+ font-size: 14px;
40
+ color: var(--bs-body-color, inherit);
41
+ }
42
+ .btn {
43
+ padding: 8px 16px; border: none; border-radius: 6px;
44
+ cursor: pointer; font-size: 13px; font-weight: 600;
15
45
  }
16
- .switch-card .switch-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
17
- .switch-card .switch-header strong { font-size: 14px; }
18
- .btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
19
46
  .btn-danger { background: #dc3545; color: #fff; }
20
47
  .btn-danger:hover { background: #c82333; }
21
- .btn-primary { background: #007bff; color: #fff; }
22
- .btn-primary:hover { background: #0069d9; }
23
- .btn-success { background: #28a745; color: #fff; }
24
- .btn-success:hover { background: #218838; }
48
+ .btn-primary { background: var(--bs-primary, #007bff); color: #fff; }
49
+ .btn-primary:hover { opacity: 0.85; }
25
50
  .actions { margin-top: 16px; display: flex; gap: 10px; }
26
- h4 { margin-bottom: 8px; }
27
51
  .toggle-wrap { display: flex; align-items: center; gap: 8px; }
28
- .toggle-wrap input[type="checkbox"] { width: 18px; height: 18px; }
29
- .section-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #eee; }
52
+ .toggle-wrap input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--bs-primary, #007bff); }
53
+ .toggle-wrap span { color: var(--bs-body-color, inherit); }
54
+ .section-title {
55
+ font-size: 15px; font-weight: 700; margin-bottom: 10px;
56
+ padding-bottom: 6px; border-bottom: 1px solid var(--bs-border-color, #444);
57
+ color: var(--bs-body-color, inherit);
58
+ }
30
59
  .inline-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
60
+ select option {
61
+ background: var(--bs-body-bg, #fff);
62
+ color: var(--bs-body-color, #000);
63
+ }
31
64
  </style>
32
65
 
33
66
  <div id="app"></div>
@@ -150,8 +183,6 @@
150
183
  <select class="sw-field" data-idx="${i}" data-field="type">
151
184
  <option value="switch" ${sw.type === 'switch' ? 'selected' : ''}>${t.typeSwitch || 'Switch'}</option>
152
185
  <option value="outlet" ${sw.type === 'outlet' || !sw.type ? 'selected' : ''}>${t.typeOutlet || 'Outlet'}</option>
153
- <option value="lightbulb" ${sw.type === 'lightbulb' ? 'selected' : ''}>${t.typeLightbulb || 'Lightbulb'}</option>
154
- <option value="fan" ${sw.type === 'fan' ? 'selected' : ''}>${t.typeFan || 'Fan'}</option>
155
186
  </select>
156
187
  </div>
157
188
  </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.2",
3
+ "version": "1.4.0",
4
4
  "description": "Multiple switch platform for Homebridge",
5
5
  "homepage": "https://github.com/azadaydinli/homebridge-multiple-switch",
6
6
  "main": "index.js",