homebridge-multiple-switch 1.1.5 → 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
|
+

|
|
3
4
|
[](https://www.npmjs.com/package/homebridge-multiple-switch)
|
|
4
5
|
[](https://github.com/azadaydinli/homebridge-multiple-switch/issues)
|
|
5
6
|
[](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
|
|
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
|
-
-
|
|
14
|
-
-
|
|
15
|
-
- **Independent Mode** –
|
|
16
|
-
- **Master Mode** –
|
|
17
|
-
- **Single Mode** –
|
|
18
|
-
-
|
|
19
|
-
-
|
|
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
|
|
29
|
+
Install via Homebridge UI:
|
|
26
30
|
|
|
27
|
-
1.
|
|
31
|
+
1. Open **Plugins**
|
|
28
32
|
2. Search for `homebridge-multiple-switch`
|
|
29
33
|
3. Click **Install**
|
|
30
34
|
|
|
31
|
-
Or
|
|
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
|
-
|
|
45
|
+
Configure from Homebridge UI or manually edit `config.json` like below:
|
|
42
46
|
|
|
43
|
-
```
|
|
47
|
+
```json
|
|
44
48
|
{
|
|
45
|
-
"
|
|
46
|
-
"name": "
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
|
|
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
|
|
63
|
-
|
|
64
|
-
| `name`
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
67
|
-
| `
|
|
68
|
-
| `autoTurnOff`
|
|
69
|
-
| `defaultState
|
|
70
|
-
|
|
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.
|
|
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
|
+
}
|