homebridge-multiple-switch 1.6.0-beta.8 → 1.6.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.
Files changed (3) hide show
  1. package/CHANGELOG.md +28 -50
  2. package/index.js +3 -21
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,63 +1,41 @@
1
1
  # Changelog
2
2
 
3
- ## [1.6.0-beta.8] - 2026-03-22
4
-
5
- ### Fixed
6
- - Homebridge v2 compatibility — plugin now shows green checkmark in v2 readiness check
7
- - Switch ordering in HomeKit now follows config order using ServiceLabelIndex
8
-
9
- ### Changed
10
- - Master switch type now defaults to Switch instead of Outlet (both UI and backend)
11
-
12
- ## [1.6.0-beta.5] - 2026-03-21
13
-
14
- ### Fixed
15
- - Switch names now correctly appear in HomeKit — services are recreated on each
16
- start with fresh displayName, Name, and ConfiguredName (cached services kept
17
- stale names from initial creation)
18
- - Master switch now always appears first in HomeKit — all subtype services are
19
- removed and recreated in correct order (master first, then switches)
20
-
21
- ### Changed
22
- - Master switch type selector now inline with the toggle (same row)
23
-
24
- ## [1.6.0-beta.4] - 2026-03-21
3
+ ## [1.6.0] - 2026-03-22
25
4
 
26
5
  ### Added
27
- - Master switch type selection (Switch or Outlet) appears when master switch is enabled
28
- - `masterSwitchType` config option
6
+ - Multi-device support: create multiple separate HomeKit accessories, each with
7
+ its own name, switch behavior mode, and set of switches
8
+ - `devices` array in config — each device becomes a separate accessory in HomeKit
9
+ - Master Switch option (available in Independent mode): adds an extra switch
10
+ that turns all switches on or off at once
11
+ - Master switch type selection (Switch or Outlet)
12
+ - Collapsible device and switch cards in config UI with chevron animation
13
+ - Summary info shown when collapsed (switch count for devices, type/delay for switches)
14
+ - i18n localization with 14 languages: English, Turkish, German, French, Spanish,
15
+ Portuguese, Italian, Russian, Chinese (Simplified), Japanese, Korean, Polish,
16
+ Dutch, Arabic
17
+ - Custom UI (`homebridge-ui/public/`) with `homebridge.i18nCurrentLang()` for
18
+ proper language detection
19
+ - Descriptions for both switch behavior modes (Independent / Single)
20
+ - ConfiguredName characteristic for correct switch names in HomeKit
21
+ - Homebridge v2 compatibility (`^2.0.0-beta.0` in engines)
29
22
 
30
23
  ### Changed
31
- - All devices and switches now start collapsed when config UI is opened
32
- - New devices/switches still open expanded when freshly added
33
-
34
- ## [1.6.0-beta.3] - 2026-03-21
24
+ - Switch behavior now has two modes: Independent and Single (removed Master mode)
25
+ - Master switch type defaults to Switch instead of Outlet
26
+ - All devices and switches start collapsed when config UI is opened
27
+ - Services are recreated on each start to ensure fresh names in HomeKit
35
28
 
36
29
  ### Fixed
37
- - Switch names now display correctly in HomeKit using `ConfiguredName`
38
- characteristic (previously all showed the device name)
39
- - Master switch now always appears first in HomeKit (created before regular switches)
40
-
41
- ## [1.6.0-beta.2] - 2026-03-21
42
-
43
- ### Fixed
44
- - Master Switch now available in Independent mode (was incorrectly in Single mode)
45
- - Behavior description now appears below the select dropdown instead of above
46
-
47
- ## [1.6.0-beta.1] - 2026-03-21
30
+ - Dark mode: custom `--ui-*` CSS variables with `@media (prefers-color-scheme: dark)`
31
+ for reliable theme support inside iframe
32
+ - Switch names now correctly appear in HomeKit (cached services kept stale names)
33
+ - Backward compatibility: old configs with `switches` at root level auto-migrate
34
+ to `devices` format
48
35
 
49
36
  ### Removed
50
- - Master switch behavior mode replaced by a more useful master switch option
51
- within Single mode
52
-
53
- ### Changed
54
- - Switch behavior now only has two modes: Independent and Single
55
- - Added descriptions to both behavior modes explaining how they work
56
-
57
- ### Added
58
- - Master Switch option (available in Single mode only): adds an extra switch
59
- that turns all switches on or off at once
60
- - New i18n keys for behavior descriptions, master switch label/description
37
+ - Lightbulb and Fan switch types (HomeKit natively converts switches to these)
38
+ - Master behavior mode (replaced by Master Switch option in Independent mode)
61
39
 
62
40
  ## [1.5.1] - 2026-03-21
63
41
 
package/index.js CHANGED
@@ -113,32 +113,16 @@ class MultipleSwitchPlatform {
113
113
  }
114
114
 
115
115
  reconcileServices(accessory, device, switches, services, hasMaster) {
116
- // Remove ALL existing subtype services (ensures fresh names and correct order)
116
+ // Remove ALL existing subtype services (ensures fresh names)
117
117
  const subtypeServices = accessory.services.filter((s) => s.subtype);
118
118
  subtypeServices.forEach((s) => accessory.removeService(s));
119
119
 
120
- // Remove existing ServiceLabel if present, then re-add to ensure ordering
121
- const existingLabel = accessory.services.find(
122
- (s) => s.UUID === this.Service.ServiceLabel.UUID
123
- );
124
- if (existingLabel) accessory.removeService(existingLabel);
125
-
126
- const labelService = accessory.addService(this.Service.ServiceLabel);
127
- labelService.setCharacteristic(
128
- this.Characteristic.ServiceLabelNamespace,
129
- this.Characteristic.ServiceLabelNamespace.ARABIC_NUMERALS
130
- );
131
-
132
- let labelIndex = 1;
133
-
134
- // 1. Create master switch FIRST if enabled (appears at top in HomeKit)
120
+ // Create master switch if enabled
135
121
  if (hasMaster) {
136
122
  const MasterServiceClass = this.getServiceClass(device.masterSwitchType || 'switch');
137
123
  const masterService = accessory.addService(MasterServiceClass, 'Master', MASTER_SUBTYPE);
138
124
 
139
125
  this.setServiceName(masterService, 'Master');
140
- masterService.addOptionalCharacteristic(this.Characteristic.ServiceLabelIndex);
141
- masterService.setCharacteristic(this.Characteristic.ServiceLabelIndex, labelIndex++);
142
126
  this.configureMasterHandler(accessory, masterService, services);
143
127
 
144
128
  services.set(MASTER_SUBTYPE, masterService);
@@ -148,7 +132,7 @@ class MultipleSwitchPlatform {
148
132
  }
149
133
  }
150
134
 
151
- // 2. Create regular switches in config order
135
+ // Create regular switches
152
136
  switches.forEach((sw, index) => {
153
137
  const subtype = `switch_${index}`;
154
138
 
@@ -156,8 +140,6 @@ class MultipleSwitchPlatform {
156
140
  const service = accessory.addService(ServiceClass, sw.name, subtype);
157
141
 
158
142
  this.setServiceName(service, sw.name);
159
- service.addOptionalCharacteristic(this.Characteristic.ServiceLabelIndex);
160
- service.setCharacteristic(this.Characteristic.ServiceLabelIndex, labelIndex++);
161
143
  this.configureSwitchHandlers(accessory, service, sw, subtype, services);
162
144
 
163
145
  services.set(subtype, service);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-multiple-switch",
3
- "version": "1.6.0-beta.8",
3
+ "version": "1.6.0",
4
4
  "description": "Multiple switch platform for Homebridge",
5
5
  "homepage": "https://github.com/azadaydinli/homebridge-multiple-switch",
6
6
  "main": "index.js",