homebridge-multiple-switch 1.1.6 → 1.2.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.
@@ -0,0 +1,28 @@
1
+ name: 📦 Publish to npm
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: 📥 Repo-nu klonla
14
+ uses: actions/checkout@v3
15
+
16
+ - name: ⚙️ Node.js qur
17
+ uses: actions/setup-node@v3
18
+ with:
19
+ node-version: '18'
20
+ registry-url: 'https://registry.npmjs.org/'
21
+
22
+ - name: 📦 Asılılıqları qur
23
+ run: npm install
24
+
25
+ - name: 🚀 NPM-ə yüklə
26
+ run: npm publish
27
+ env:
28
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,28 @@
1
+ name: 📦 Publish to npm
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: 📥 Repo-nu klonla
14
+ uses: actions/checkout@v3
15
+
16
+ - name: ⚙️ Node.js qur
17
+ uses: actions/setup-node@v3
18
+ with:
19
+ node-version: '18'
20
+ registry-url: 'https://registry.npmjs.org/'
21
+
22
+ - name: 📦 Asılılıqları qur
23
+ run: npm install
24
+
25
+ - name: 🚀 NPM-ə yüklə
26
+ run: npm publish
27
+ env:
28
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,28 @@
1
+ name: 📦 Publish to npm
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*.*.*'
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: 📥 Repo-nu klonla
14
+ uses: actions/checkout@v3
15
+
16
+ - name: ⚙️ Node.js qur
17
+ uses: actions/setup-node@v3
18
+ with:
19
+ node-version: '18'
20
+ registry-url: 'https://registry.npmjs.org/'
21
+
22
+ - name: 📦 Asılılıqları qur
23
+ run: npm install
24
+
25
+ - name: 🚀 NPM-ə yüklə
26
+ run: npm publish
27
+ env:
28
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/README.md CHANGED
@@ -1,34 +1,38 @@
1
1
  # homebridge-multiple-switch
2
2
 
3
+ ![CI](https://github.com/azadaydinli/homebridge-multiple-switch/actions/workflows/ci.yml/badge.svg)
3
4
  [![npm](https://img.shields.io/npm/v/homebridge-multiple-switch)](https://www.npmjs.com/package/homebridge-multiple-switch)
4
5
  [![GitHub issues](https://img.shields.io/github/issues/azadaydinli/homebridge-multiple-switch)](https://github.com/azadaydinli/homebridge-multiple-switch/issues)
5
6
  [![GitHub license](https://img.shields.io/github/license/azadaydinli/homebridge-multiple-switch)](https://github.com/azadaydinli/homebridge-multiple-switch/blob/master/LICENSE)
6
7
 
7
- A lightweight Homebridge plugin that lets you create multiple customizable dummy switches (Outlet/Fan/Light/Switch) with different behavior modes including Independent, Master, and Single-Switch Mode.
8
+ A lightweight Homebridge plugin that lets you create multiple customizable dummy switches under a single accessory configurable as `Switch`, `Outlet`, `Lightbulb`, or `Fan`.
9
+ Supports `Independent`, `Master`, and `Single` switch modes.
8
10
 
9
11
  ---
10
12
 
11
13
  ## ✨ Features
12
14
 
13
- - Multiple switches in a single accessory
14
- - Each switch can be `switch`, `outlet`, `lightbulb`, or `fan`
15
- - **Independent Mode** – all switches work separately
16
- - **Master Mode** – adds a master switch that controls all other switches
17
- - **Single Mode** – only one switch can be on at any time
18
- - Auto turn-off (in milliseconds)
19
- - Works seamlessly with HomeKit and Siri
15
+ - Grouped multiple switches in one HomeKit tile
16
+ - Accessory type: `switch`, `outlet`, `lightbulb`, or `fan`
17
+ - **Independent Mode** – All switches operate separately
18
+ - **Master Mode** – One master switch controls the rest
19
+ - **Single Mode** – Only one switch can be active at a time
20
+ - Per-switch config support (type, auto-off, default state)
21
+ - Switch states are preserved after Homebridge restart
22
+ - Fully dynamic config reload (no need to restart Homebridge)
23
+ - Compatible with HomeKit and Siri
20
24
 
21
25
  ---
22
26
 
23
27
  ## 📦 Installation
24
28
 
25
- Install the plugin via the Homebridge UI:
29
+ Install via Homebridge UI:
26
30
 
27
- 1. Go to **Plugins**
31
+ 1. Open **Plugins**
28
32
  2. Search for `homebridge-multiple-switch`
29
33
  3. Click **Install**
30
34
 
31
- Or use the command line:
35
+ Or install via terminal:
32
36
 
33
37
  ```bash
34
38
  npm install -g homebridge-multiple-switch
@@ -36,35 +40,73 @@ npm install -g homebridge-multiple-switch
36
40
 
37
41
  ---
38
42
 
39
- ## ⚙️ Configuration
43
+ ## ⚙️ Configuration (Platform Mode)
40
44
 
41
- You can configure the plugin directly via the Homebridge UI, or manually in config.json:
45
+ Configure from Homebridge UI or manually edit `config.json` like below:
42
46
 
43
- ```bash
47
+ ```json
44
48
  {
45
- "accessory": "MultipleSwitchAccessory",
46
- "name": "My Multi Switch",
47
- "switchCount": 3,
48
- "type": "outlet",
49
- "mode": "independent",
50
- "autoTurnOff": 1000,
51
- "defaultState": false,
52
- "states": [
53
- { "type": "switch", "autoTurnOff": 3000 },
54
- { "type": "fan" },
55
- { "type": "lightbulb", "defaultState": true }
56
- ]
49
+ "platform": "MultipleSwitchPlatform",
50
+ "name": "Multiple Switches",
51
+ "switches": [
52
+ {
53
+ "name": "Heater",
54
+ "type": "outlet",
55
+ "defaultState": true,
56
+ "autoTurnOff": 10000
57
+ },
58
+ {
59
+ "name": "Fan",
60
+ "type": "fan"
61
+ },
62
+ {
63
+ "name": "Light",
64
+ "type": "lightbulb",
65
+ "autoTurnOff": 5000
66
+ }
67
+ ],
68
+ "mode": "single"
57
69
  }
58
70
  ```
59
71
 
72
+ ---
73
+
60
74
  ### 🔧 Configuration Options
61
75
 
62
- | Field | Type | Required | Description |
63
- |---------------|---------|----------|-----------------------------------------------------------------------------|
64
- | `name` | string | ✅ | Name of the accessory |
65
- | `switchCount` | number | ✅ | Number of switches to create (max depends on HomeKit limits) |
66
- | `type` | string | ❌ | Default type: `switch`, `outlet`, `lightbulb`, or `fan` |
67
- | `mode` | string | ❌ | `independent`, `master`, or `single` |
68
- | `autoTurnOff` | number | ❌ | Global auto-off in milliseconds |
69
- | `defaultState`| boolean | ❌ | Default on/off state on restart |
70
- | `states` | array | ❌ | Per-switch custom settings (overrides global config) |
76
+ | Field | Type | Required | Description |
77
+ |----------------|---------|----------|-------------------------------------------------------------------------|
78
+ | `name` | string | ✅ | Name of the platform instance |
79
+ | `switches` | array | ✅ | List of switches to create |
80
+ | `mode` | string | ❌ | `independent`, `master`, or `single` |
81
+ | `type` | string | ❌ | Switch type: `switch`, `outlet`, `lightbulb`, `fan` (overridden per switch) |
82
+ | `autoTurnOff` | number | ❌ | Global auto-off (ms) – can be overridden per switch |
83
+ | `defaultState` | boolean | ❌ | Default power state on restart – can be overridden per switch |
84
+
85
+ Each object inside `switches[]` can include:
86
+ - `name`: Name of the switch
87
+ - `type`: Optional (`switch`, `outlet`, etc.)
88
+ - `autoTurnOff`: Optional (in ms)
89
+ - `defaultState`: Optional (true/false)
90
+
91
+ ---
92
+
93
+ ## 📣 Example Use Cases
94
+
95
+ - Simulate smart plugs for automation testing
96
+ - Trigger HomeKit scenes manually
97
+ - Create virtual switches for non-HomeKit devices
98
+ - Combine several virtual accessories under one tile
99
+
100
+ ---
101
+
102
+ ## 🔗 Links
103
+
104
+ - [NPM Package](https://www.npmjs.com/package/homebridge-multiple-switch)
105
+ - [Homebridge](https://homebridge.io/)
106
+ - [Plugin Issues](https://github.com/azadaydinli/homebridge-multiple-switch/issues)
107
+
108
+ ---
109
+
110
+ ## 📜 License
111
+
112
+ MIT © [Azad Aydınlı](https://github.com/azadaydinli)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-multiple-switch",
3
- "version": "1.1.6",
3
+ "version": "1.2.0",
4
4
  "description": "Multiple switch platform for Homebridge",
5
5
  "homepage": "https://github.com/azadaydinli/homebridge-multiple-switch",
6
6
  "main": "index.js",
@@ -29,4 +29,4 @@
29
29
  "node": ">=14.17.0",
30
30
  "homebridge": ">=1.3.0"
31
31
  }
32
- }
32
+ }