generated from homebridge/homebridge-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.schema.json
122 lines (122 loc) · 6.61 KB
/
config.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{
"pluginAlias": "HomebridgeShortcutsButtons",
"pluginType": "platform",
"singular": true,
"headerDisplay": "Please refer to the <a target=\"_README\" rel=\"noreferrer\" rel=\"noopener\" href=\"https://github.com/duddu/homebridge-shortcuts-buttons#readme\">plugin documentation</a> for a more comprehensive explanation on this configuration.",
"footerDisplay": "Please refer to the <a target=\"_README\" rel=\"noreferrer\" rel=\"noopener\" href=\"https://github.com/duddu/homebridge-shortcuts-buttons#readme\">plugin documentation</a> for a more comprehensive explanation on this configuration.",
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Display name of the platform bridge.",
"default": "ShortcutsButtons"
},
"accessoryName": {
"type": "string",
"description": "Display name of the platform accessory.",
"default": "Shortcuts"
},
"serviceType": {
"type": "string",
"title": "Display buttons as",
"enum": ["Outlet", "Switch"],
"description": "Display the shortcuts buttons as Outlets or as Switches. See the <a target=\"_README\" rel=\"noreferrer\" rel=\"noopener\" href=\"https://github.com/duddu/homebridge-shortcuts-buttons/tree/latest?tab=readme-ov-file#how-does-it-look-like\">related documentation</a> for a visual preview of the two options in the Apple Home app.",
"default": "Outlet"
},
"services": {
"type": "array",
"title": "Shortcuts buttons",
"description": "Add a new item to this list for every Apple Shortcut you want to be able to launch.<br>\nThe machine running Homebridge must have access to every shortcut listed here (i.e. the macOS user must be logged into the iCloud account where the shortcuts are stored). If you change the name of a shortcut from the Shortcuts app remember to update it here too.",
"uniqueItems": true,
"minItems": 1,
"items": {
"type": "object",
"properties": {
"serviceName": {
"type": "string",
"title": "Button title",
"description": "A title to display for this button."
},
"shortcutName": {
"type": "string",
"title": "Shortcut name",
"description": "The name of the Apple Shortcut to launch, as displayed in your Shortcuts app."
}
},
"required": ["serviceName", "shortcutName"]
}
},
"callbackServerEnabled": {
"type": "boolean",
"title": "Enable Callback",
"description": "The plugin will wait for the shortcut to complete its run, and will execute a callback action of your choice.",
"default": true
},
"callbackCommandType": {
"type": "string",
"title": "Callback Type",
"enum": ["Default (display notification)", "Custom unix command", "Shortcut name"],
"description": "With the default option, after the shortcut completion, a notification with the outcome of the shortcut run is displayed on the host running Homebrige.<br>\nIf you choose to customize the callback behaviour, you have two choices: use any unix command that your host is able to execute, or just use another shortcut to handle the callback if you like. Depending on your choice, you must complete the next field accordingly.<br>\nPlease see the <a target=\"_README\" rel=\"noreferrer\" rel=\"noopener\" href=\"https://github.com/duddu/homebridge-shortcuts-buttons/tree/latest?tab=readme-ov-file#callback-command\">related documentation</a> for more detail.",
"default": "Default (display notification)",
"condition": {
"functionBody": "return model.callbackServerEnabled === true;"
}
},
"callbackCustomCommand": {
"type": "string",
"title": "Custom callback command / callback shortcut name",
"description": "Either a unix command or the name of a shortcut to run, depending on the value selected in the previous field. In the former case, all the content of the field will be treated as a command and executed: in the latter, this field expects just the plain name of the shortcut as displayed in the Shortcuts app. If you left the previous field on the default value, any text inserted here will be ignored.<br>\nYou can also read input parameters from your custom command/shortcut. Please see the <a target=\"_README\" rel=\"noreferrer\" rel=\"noopener\" href=\"https://github.com/duddu/homebridge-shortcuts-buttons/tree/latest?tab=readme-ov-file#custom-unix-command\">related documentation</a> for more detail.",
"condition": {
"functionBody": "return model.callbackServerEnabled === true && model.callbackCommandType !== 'Default (display notification)';"
}
},
"callbackCommandTimeout": {
"type": "number",
"title": "Custom callback command timeout",
"description": "The time in milliseconds that the x-callback-url server should wait for the callback command execution to complete before timing out.",
"default": 5000,
"condition": {
"functionBody": "return model.callbackServerEnabled === true && model.callbackCommandType === 'Custom unix command';"
}
},
"callbackServerHostname": {
"type": "string",
"description": "IPv4 address or hostname to expose the internal x-callback-url http server (must be accessible from a browser on the machine running Homebridge).",
"default": "127.0.0.1",
"condition": {
"functionBody": "return model.callbackServerEnabled === true;"
}
},
"callbackServerPort": {
"type": "number",
"description": "A free port number for the internal x-callback-url HTTP server.",
"default": 63963,
"condition": {
"functionBody": "return model.callbackServerEnabled === true;"
}
},
"callbackServerProtocol": {
"type": "string",
"enum": ["http", "https"],
"description": "If you access other Homebridge services (e.g. UI) behind a reverse proxy with TLS certificate installed, you may want to access the x-callback-url server via https as well.",
"default": "http",
"condition": {
"functionBody": "return model.callbackServerEnabled === true;"
}
}
},
"required": [
"name",
"accessoryName",
"serviceType",
"services",
"callbackServerEnabled",
"callbackCommandType",
"callbackCommandTimeout",
"callbackServerHostname",
"callbackServerPort",
"callbackServerProtocol"
]
}
}