homebridge-virtual-accessories 3.16.1 → 3.16.3
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/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
<div>
|
|
2
2
|
<a href="https://www.npmjs.com/package/homebridge-virtual-accessories"><img src="https://img.shields.io/github/package-json/v/justjam2013/homebridge-virtual-accessories?color=F99211" /></a>
|
|
3
3
|
<a href="https://www.npmjs.com/package/homebridge-virtual-accessories"><img src="https://img.shields.io/github/v/release/justjam2013/homebridge-virtual-accessories?color=FFd461" /></a>
|
|
4
|
-
<!-- <a href="https://github.com/homebridge/homebridge/wiki/Verified-Plugins"><img src="https://badgen.net/badge/homebridge/verified/purple" /></a> -->
|
|
5
|
-
<!-- a href="https://github.com/homebridge/homebridge/wiki/Verified-Plugins"><img src="https://img.shields.io/badge/_homebridge_-_verified_-6A5ACD" /></a -->
|
|
6
4
|
<a href="https://github.com/homebridge/homebridge/wiki/Verified-Plugins"><img src="https://img.shields.io/badge/homebridge-verified-blueviolet?color=%23491F59&style=flat" /></a>
|
|
7
5
|
<a href="https://github.com/justjam2013/homebridge-virtual-accessories"><img src="https://img.shields.io/badge/_homebridge_v2.0_-_ready_-4CAF50" /></a>
|
|
8
6
|
<a href="https://discord.gg/Z8jmyvb"><img src="https://img.shields.io/badge/discord-%23virtual--accessories-737CF8" /></a>
|
|
@@ -10,8 +8,8 @@
|
|
|
10
8
|
|
|
11
9
|
<br/><br/>
|
|
12
10
|
<p align="center" vertical-align="middle">
|
|
13
|
-
<a href="https://github.com/justjam2013/homebridge-virtual-accessories"><img src="assets/icon/VirtualAccessories.png" height="
|
|
14
|
-
<a href="https://github.com/homebridge/homebridge"><img src="https://raw.githubusercontent.com/homebridge/branding/master/logos/homebridge-color-round-stylized.png" height="
|
|
11
|
+
<a href="https://github.com/justjam2013/homebridge-virtual-accessories"><img src="assets/icon/VirtualAccessories.png" height="180" /></a>
|
|
12
|
+
<a href="https://github.com/homebridge/homebridge"><img src="https://raw.githubusercontent.com/homebridge/branding/master/logos/homebridge-color-round-stylized.png" height="180" /></a>
|
|
15
13
|
</p>
|
|
16
14
|
|
|
17
15
|
<span align="center">
|
|
@@ -20,7 +18,13 @@
|
|
|
20
18
|
|
|
21
19
|
</span>
|
|
22
20
|
|
|
23
|
-
###
|
|
21
|
+
### Plugin for Homebridge that provides the ability to create virtual Apple Home accessories.
|
|
22
|
+
|
|
23
|
+
## <!-- Thin separator line -->
|
|
24
|
+
|
|
25
|
+
#### Matter Support
|
|
26
|
+
|
|
27
|
+
Now that Homebridge supports publishing devices as Matter devices, I have been considering adding the ability to create virtual Matter accessories. However, after considering the pros and cons, I have chose not to bloat this plugin or muddy its scope. So I will be keeping it strictly for creating HomeKit-only virtual devices. If you are interested in virtual Matter devices, I am currently in the process of writing a separate plugin, [Virtual Matter Accessories For Homebridge](https://github.com/justjam2013/homebridge-virtual-matter-accessories), whose scope will be to create Matter-only virtual devices.
|
|
24
28
|
|
|
25
29
|
## <!-- Thin separator line -->
|
|
26
30
|
|
|
@@ -149,7 +153,7 @@ Currently, these are the implemented virtual accessories:
|
|
|
149
153
|
- **Timer.** To create a timer, create a timed switch.
|
|
150
154
|
|
|
151
155
|
> [!NOTE]
|
|
152
|
-
> When a timed switch is restored after a restart, if the the time remaining on the timer after correction is 0 seconds (i.e. the timer expired while Homebridge was not running), this would leave the switch in a bad state. So the timer will always be restored to at least 1 second, thus allowing the timer to end, reset the switch to its default state, and the switch flip event to occur in Apple Home for any automations
|
|
156
|
+
> When a timed switch is restored after a restart, if the the time remaining on the timer after correction is 0 seconds (i.e. the timer expired while Homebridge was not running), this would leave the switch in a bad state. So the timer will always be restored to at least 1 second, thus allowing the timer to end, reset the switch to its default state, and the switch flip event to occur in Apple Home for any automations depending on it. This is a tradeoff wherein a late event is preferred to a lost event.
|
|
153
157
|
|
|
154
158
|
<span align="right">
|
|
155
159
|
<h6>
|
package/config.schema.json
CHANGED
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
|
+
"required": [ "name" ],
|
|
77
78
|
"properties": {
|
|
78
79
|
"name": {
|
|
79
80
|
"title": "Platform Name",
|
|
80
81
|
"type": "string",
|
|
81
|
-
"required": true,
|
|
82
82
|
"default": "Virtual Accessories Platform",
|
|
83
83
|
"readonly": true
|
|
84
84
|
},
|
|
@@ -111,25 +111,23 @@
|
|
|
111
111
|
"type": "object",
|
|
112
112
|
"expandable": true,
|
|
113
113
|
"expanded": false,
|
|
114
|
+
"required": [ "accessoryID", "accessoryName", "accessoryType" ],
|
|
114
115
|
"properties": {
|
|
115
116
|
"accessoryID": {
|
|
116
117
|
"title": "Accessory ID",
|
|
117
118
|
"description": "Unique ID for the Accessory (https://www.random.org/). Do not modify once assigned!",
|
|
118
119
|
"type": "string",
|
|
119
|
-
"required": true,
|
|
120
120
|
"pattern": "^[A-Za-z0-9\\-]{5,}$"
|
|
121
121
|
},
|
|
122
122
|
"accessoryName": {
|
|
123
123
|
"title": "Accessory Name",
|
|
124
124
|
"description": "Accessory name as it will be displayed in HomeKit",
|
|
125
125
|
"type": "string",
|
|
126
|
-
"required": true,
|
|
127
126
|
"pattern": "^(?=[\\p{L}\\p{N}])[\\p{L}\\p{N}\\s']*(?<=[\\p{L}\\p{N}])$"
|
|
128
127
|
},
|
|
129
128
|
"accessoryType": {
|
|
130
129
|
"title": "Accessory Type",
|
|
131
130
|
"type": "string",
|
|
132
|
-
"required": true,
|
|
133
131
|
"oneOf": [
|
|
134
132
|
{ "title": "Air Purifier", "enum": ["airpurifier"] },
|
|
135
133
|
{ "title": "Battery", "enum": ["battery"] },
|
|
@@ -52,10 +52,14 @@ export class PingTrigger extends Trigger {
|
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
this.log.debug(`[${this.accessoryName}] Protocol: ${ping.NetworkProtocol[protocol]}`);
|
|
55
|
-
const intervalBetweenPingsMillis = triggerConfig.interval * 60 * 1000;
|
|
55
|
+
const intervalBetweenPingsMillis = triggerConfig.interval * 60 * 1000; // minutes to milliseconds
|
|
56
56
|
this.log.info(`[${this.accessoryName}] Setting interval between pings to ${intervalBetweenPingsMillis / 1000 / 60} minute(s)`);
|
|
57
|
-
const pingTimeoutMillis =
|
|
58
|
-
setInterval(
|
|
57
|
+
const pingTimeoutMillis = 1000; // 1 second timeout
|
|
58
|
+
setInterval(
|
|
59
|
+
// function, delay
|
|
60
|
+
this.ping, intervalBetweenPingsMillis,
|
|
61
|
+
// function params
|
|
62
|
+
this, triggerConfig, protocol, pingTimeoutMillis)
|
|
59
63
|
.unref();
|
|
60
64
|
}
|
|
61
65
|
/**
|
|
@@ -69,10 +73,11 @@ export class PingTrigger extends Trigger {
|
|
|
69
73
|
// const host = await getIP(hostname: string);
|
|
70
74
|
// protocol = ping.NetworkProtocol.IPv4;
|
|
71
75
|
// Create a helper class for protocol, so the value can be updated
|
|
76
|
+
// With "retries = 3" it pings 3 times before it counts it as a failure
|
|
72
77
|
const options = {
|
|
73
78
|
networkProtocol: protocol,
|
|
74
79
|
packetSize: 16,
|
|
75
|
-
retries:
|
|
80
|
+
retries: 3,
|
|
76
81
|
sessionId: Math.floor(Math.random() * 65534) + 1,
|
|
77
82
|
timeout: pingTimeoutMillis,
|
|
78
83
|
ttl: 128,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triggerPing.js","sourceRoot":"","sources":["../../../src/sensors/triggers/triggerPing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAEzC;;GAEG;AACH,MAAM,O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I,CAAC,CAAC,MAAyB,EAAE,EAAE;YAClC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,aAAa,+BAA+B,QAAQ,SAAS,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC;YACvH,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAY,EAAE,EAAE;YACtB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,aAAa,sCAAsC,QAAQ,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC5H,CAAC,CAAC,CAAC;QAEL,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "homebridge-virtual-accessories",
|
|
3
3
|
"displayName": "Virtual Accessories for Homebridge",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "3.16.
|
|
5
|
+
"version": "3.16.3",
|
|
6
6
|
"description": "Virtual HomeKit accessories for Homebridge.",
|
|
7
7
|
"author": "justjam2023 (Renzo Zanelli - renzo.zanelli6@gmail.com)",
|
|
8
8
|
"license": "MIT",
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
|
+
"required": [ "name" ],
|
|
77
78
|
"properties": {
|
|
78
79
|
"name": {
|
|
79
80
|
"title": "Nombre de la Plataforma",
|
|
80
81
|
"type": "string",
|
|
81
|
-
"required": true,
|
|
82
82
|
"default": "Virtual Accessories Platform",
|
|
83
83
|
"readonly": true
|
|
84
84
|
},
|
|
@@ -111,25 +111,23 @@
|
|
|
111
111
|
"type": "object",
|
|
112
112
|
"expandable": true,
|
|
113
113
|
"expanded": false,
|
|
114
|
+
"required": [ "accessoryID", "accessoryName", "accessoryType" ],
|
|
114
115
|
"properties": {
|
|
115
116
|
"accessoryID": {
|
|
116
117
|
"title": "ID del Accesorio",
|
|
117
118
|
"description": "ID único del accesorio (https://www.random.org/). ¡No lo modifique una vez asignado!",
|
|
118
119
|
"type": "string",
|
|
119
|
-
"required": true,
|
|
120
120
|
"pattern": "^[A-Za-z0-9\\-]{5,}$"
|
|
121
121
|
},
|
|
122
122
|
"accessoryName": {
|
|
123
123
|
"title": "Nombre del Accesorio",
|
|
124
124
|
"description": "Nombre del accesorio tal como se mostrará en HomeKit",
|
|
125
125
|
"type": "string",
|
|
126
|
-
"required": true,
|
|
127
126
|
"pattern": "^(?=[\\p{L}\\p{N}])[\\p{L}\\p{N}\\s']*(?<=[\\p{L}\\p{N}])$"
|
|
128
127
|
},
|
|
129
128
|
"accessoryType": {
|
|
130
129
|
"title": "Tipo de Accesorio",
|
|
131
130
|
"type": "string",
|
|
132
|
-
"required": true,
|
|
133
131
|
"oneOf": [
|
|
134
132
|
{ "title": "Purificador de Aire", "enum": ["airpurifier"] },
|
|
135
133
|
{ "title": "Batería", "enum": ["battery"] },
|
|
@@ -74,11 +74,11 @@
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
|
+
"required": [ "name" ],
|
|
77
78
|
"properties": {
|
|
78
79
|
"name": {
|
|
79
80
|
"title": "Platform Naam",
|
|
80
81
|
"type": "string",
|
|
81
|
-
"required": true,
|
|
82
82
|
"default": "Virtual Accessories Platform",
|
|
83
83
|
"readonly": true
|
|
84
84
|
},
|
|
@@ -111,25 +111,23 @@
|
|
|
111
111
|
"type": "object",
|
|
112
112
|
"expandable": true,
|
|
113
113
|
"expanded": false,
|
|
114
|
+
"required": [ "accessoryID", "accessoryName", "accessoryType" ],
|
|
114
115
|
"properties": {
|
|
115
116
|
"accessoryID": {
|
|
116
117
|
"title": "Accessoire ID",
|
|
117
118
|
"description": "Uniek ID voor het Accessoire (https://www.random.org/). Niet meer veranderen als het toegewezen is!",
|
|
118
119
|
"type": "string",
|
|
119
|
-
"required": true,
|
|
120
120
|
"pattern": "^[A-Za-z0-9\\-]{5,}$"
|
|
121
121
|
},
|
|
122
122
|
"accessoryName": {
|
|
123
123
|
"title": "Accessoire Naam",
|
|
124
124
|
"description": "Accessoire naam zoals het wordt weergegeven in HomeKit",
|
|
125
125
|
"type": "string",
|
|
126
|
-
"required": true,
|
|
127
126
|
"pattern": "^(?=[\\p{L}\\p{N}])[\\p{L}\\p{N}\\s']*(?<=[\\p{L}\\p{N}])$"
|
|
128
127
|
},
|
|
129
128
|
"accessoryType": {
|
|
130
129
|
"title": "Accessoire Type",
|
|
131
130
|
"type": "string",
|
|
132
|
-
"required": true,
|
|
133
131
|
"oneOf": [
|
|
134
132
|
{ "title": "Luchtreiniger", "enum": ["airpurifier"] },
|
|
135
133
|
{ "title": "Batterij", "enum": ["battery"] },
|