homebridge-multiple-switch 1.6.0-beta.1 → 1.6.0-beta.2

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.
@@ -22,7 +22,17 @@ jobs:
22
22
  - name: Install dependencies
23
23
  run: npm install
24
24
 
25
+ - name: Determine npm tag
26
+ id: npm-tag
27
+ run: |
28
+ VERSION=$(node -p "require('./package.json').version")
29
+ if echo "$VERSION" | grep -q "beta"; then
30
+ echo "tag=beta" >> $GITHUB_OUTPUT
31
+ else
32
+ echo "tag=latest" >> $GITHUB_OUTPUT
33
+ fi
34
+
25
35
  - name: Publish to npm
26
- run: npm publish
36
+ run: npm publish --tag ${{ steps.npm-tag.outputs.tag }}
27
37
  env:
28
38
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.6.0-beta.2] - 2026-03-21
4
+
5
+ ### Fixed
6
+ - Master Switch now available in Independent mode (was incorrectly in Single mode)
7
+ - Behavior description now appears below the select dropdown instead of above
8
+
3
9
  ## [1.6.0-beta.1] - 2026-03-21
4
10
 
5
11
  ### Removed
@@ -268,8 +268,8 @@
268
268
  const di = parseInt(input.dataset.dev);
269
269
  const field = input.dataset.field;
270
270
  config.devices[di][field] = input.value;
271
- // If switching away from single, disable masterSwitch
272
- if (field === 'switchBehavior' && input.value !== 'single') {
271
+ // If switching away from independent, disable masterSwitch
272
+ if (field === 'switchBehavior' && input.value !== 'independent') {
273
273
  delete config.devices[di].masterSwitch;
274
274
  }
275
275
  render();
@@ -362,6 +362,8 @@
362
362
  const devLabel = dev.name || `${t.device || 'Device'} #${di + 1}`;
363
363
  const switchCount = switches.length;
364
364
  const isSingle = dev.switchBehavior === 'single';
365
+ const isIndependent = dev.switchBehavior === 'independent' || !dev.switchBehavior;
366
+ const behaviorDesc = isSingle ? (t.behaviorSingleDesc || '') : (t.behaviorIndependentDesc || '');
365
367
 
366
368
  return `
367
369
  <div class="device-card">
@@ -384,15 +386,15 @@
384
386
  </div>
385
387
  <div class="form-group">
386
388
  <label>${t.switchBehavior || 'Switch Behavior Mode'}</label>
387
- <div class="desc">${isSingle ? (t.behaviorSingleDesc || '') : (t.behaviorIndependentDesc || '')}</div>
388
389
  <select class="dev-field" data-dev="${di}" data-field="switchBehavior">
389
- <option value="independent" ${dev.switchBehavior === 'independent' || !dev.switchBehavior ? 'selected' : ''}>${t.behaviorIndependent || 'Independent'}</option>
390
+ <option value="independent" ${isIndependent ? 'selected' : ''}>${t.behaviorIndependent || 'Independent'}</option>
390
391
  <option value="single" ${isSingle ? 'selected' : ''}>${t.behaviorSingle || 'Single'}</option>
391
392
  </select>
393
+ <div class="desc" style="margin-top:6px">${behaviorDesc}</div>
392
394
  </div>
393
395
  </div>
394
396
 
395
- ${isSingle ? `
397
+ ${isIndependent ? `
396
398
  <div class="master-option">
397
399
  <div class="toggle-wrap">
398
400
  <input type="checkbox" class="master-toggle" data-dev="${di}" ${dev.masterSwitch ? 'checked' : ''}>
package/index.js CHANGED
@@ -75,7 +75,7 @@ class MultipleSwitchPlatform {
75
75
 
76
76
  const name = device.name || 'Multiple Switch Panel';
77
77
  const behavior = device.switchBehavior || 'independent';
78
- const hasMaster = behavior === 'single' && device.masterSwitch === true;
78
+ const hasMaster = behavior === 'independent' && device.masterSwitch === true;
79
79
  const uuid = this.api.hap.uuid.generate(name);
80
80
 
81
81
  let accessory = this.cachedAccessories.get(uuid);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-multiple-switch",
3
- "version": "1.6.0-beta.1",
3
+ "version": "1.6.0-beta.2",
4
4
  "description": "Multiple switch platform for Homebridge",
5
5
  "homepage": "https://github.com/azadaydinli/homebridge-multiple-switch",
6
6
  "main": "index.js",