homebridge-multiple-switch 1.7.0-beta.5 → 1.7.0-beta.6

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.7.0-beta.6] - 2026-05-17
4
+
5
+ ### Changed
6
+ - Master Switch now uses the device-level switch type automatically — separate type selector removed
7
+
8
+ ### Removed
9
+ - Master Switch Type selector from UI and schema (`masterSwitchType` config field is no longer used)
10
+
3
11
  ## [1.7.0-beta.5] - 2026-05-17
4
12
 
5
13
  ### Changed
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "masterSwitch": {
48
48
  "title": "Master Switch",
49
- "description": "Add a master switch that turns all switches on or off at once. Only available in Single mode.",
49
+ "description": "Add a master switch that turns all switches on or off at once. Uses the same type as the device.",
50
50
  "type": "boolean",
51
51
  "default": false
52
52
  },
@@ -289,22 +289,11 @@
289
289
  input.addEventListener('change', () => {
290
290
  const di = parseInt(input.dataset.dev);
291
291
  config.devices[di].masterSwitch = input.checked;
292
- if (!input.checked) {
293
- delete config.devices[di].masterSwitchType;
294
- }
295
292
  render();
296
293
  save();
297
294
  });
298
295
  });
299
296
 
300
- // Master switch type
301
- document.querySelectorAll('.master-type-field').forEach(input => {
302
- input.addEventListener('change', () => {
303
- const di = parseInt(input.dataset.dev);
304
- config.devices[di].masterSwitchType = input.value;
305
- save();
306
- });
307
- });
308
297
 
309
298
  document.querySelectorAll('.btn-remove-device').forEach(btn => {
310
299
  btn.addEventListener('click', (e) => {
@@ -424,20 +413,12 @@
424
413
 
425
414
  ${isIndependent ? `
426
415
  <div class="master-option">
427
- <div style="display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap">
428
- <div class="toggle-wrap" style="flex:1;min-width:0">
429
- <input type="checkbox" class="master-toggle" data-dev="${di}" ${dev.masterSwitch ? 'checked' : ''}>
430
- <div>
431
- <label style="margin-bottom:0">${t.masterSwitch || 'Master Switch'}</label>
432
- <div class="desc" style="margin-bottom:0">${t.masterSwitchDesc || ''}</div>
433
- </div>
416
+ <div class="toggle-wrap">
417
+ <input type="checkbox" class="master-toggle" data-dev="${di}" ${dev.masterSwitch ? 'checked' : ''}>
418
+ <div>
419
+ <label style="margin-bottom:0">${t.masterSwitch || 'Master Switch'}</label>
420
+ <div class="desc" style="margin-bottom:0">${t.masterSwitchDesc || ''}</div>
434
421
  </div>
435
- ${dev.masterSwitch ? `
436
- <select class="master-type-field" data-dev="${di}" style="width:auto;min-width:120px;flex-shrink:0">
437
- <option value="switch" ${dev.masterSwitchType === 'switch' || !dev.masterSwitchType ? 'selected' : ''}>${t.typeSwitch || 'Switch'}</option>
438
- <option value="outlet" ${dev.masterSwitchType === 'outlet' ? 'selected' : ''}>${t.typeOutlet || 'Outlet'}</option>
439
- </select>
440
- ` : ''}
441
422
  </div>
442
423
  </div>
443
424
  ` : ''}
package/index.js CHANGED
@@ -119,7 +119,7 @@ class MultipleSwitchPlatform {
119
119
 
120
120
  // Create master switch if enabled
121
121
  if (hasMaster) {
122
- const MasterServiceClass = this.getServiceClass(device.masterSwitchType || 'switch');
122
+ const MasterServiceClass = this.getServiceClass(device.switchType || 'outlet');
123
123
  const masterService = accessory.addService(MasterServiceClass, 'Master', MASTER_SUBTYPE);
124
124
 
125
125
  this.setServiceName(masterService, 'Master');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-multiple-switch",
3
- "version": "1.7.0-beta.5",
3
+ "version": "1.7.0-beta.6",
4
4
  "description": "Multiple switch platform for Homebridge",
5
5
  "homepage": "https://github.com/azadaydinli/homebridge-multiple-switch",
6
6
  "main": "index.js",