@blueharford/scrypted-spatial-awareness 0.1.14 → 0.1.15
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/dist/main.nodejs.js +1 -1
- package/dist/main.nodejs.js.map +1 -1
- package/dist/plugin.zip +0 -0
- package/out/main.nodejs.js +23 -2
- package/out/main.nodejs.js.map +1 -1
- package/out/plugin.zip +0 -0
- package/package.json +1 -1
- package/src/alerts/alert-manager.ts +18 -0
- package/src/main.ts +4 -2
package/out/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -186,6 +186,24 @@ export class AlertManager {
|
|
|
186
186
|
*/
|
|
187
187
|
private getDefaultNotifiers(): string[] {
|
|
188
188
|
try {
|
|
189
|
+
// Try new multiple notifiers setting first
|
|
190
|
+
const notifiers = this.storage.getItem('defaultNotifiers');
|
|
191
|
+
if (notifiers) {
|
|
192
|
+
// Could be JSON array or comma-separated string
|
|
193
|
+
try {
|
|
194
|
+
const parsed = JSON.parse(notifiers);
|
|
195
|
+
if (Array.isArray(parsed)) {
|
|
196
|
+
return parsed;
|
|
197
|
+
}
|
|
198
|
+
} catch {
|
|
199
|
+
// Not JSON, might be comma-separated or single value
|
|
200
|
+
if (notifiers.includes(',')) {
|
|
201
|
+
return notifiers.split(',').map(s => s.trim()).filter(Boolean);
|
|
202
|
+
}
|
|
203
|
+
return [notifiers];
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// Fallback to old single notifier setting
|
|
189
207
|
const defaultNotifier = this.storage.getItem('defaultNotifier');
|
|
190
208
|
return defaultNotifier ? [defaultNotifier] : [];
|
|
191
209
|
} catch {
|
package/src/main.ts
CHANGED
|
@@ -123,10 +123,12 @@ export class SpatialAwarenessPlugin extends ScryptedDeviceBase
|
|
|
123
123
|
defaultValue: true,
|
|
124
124
|
group: 'Alerts',
|
|
125
125
|
},
|
|
126
|
-
|
|
127
|
-
title: '
|
|
126
|
+
defaultNotifiers: {
|
|
127
|
+
title: 'Notifiers',
|
|
128
128
|
type: 'device',
|
|
129
|
+
multiple: true,
|
|
129
130
|
deviceFilter: `interfaces.includes('${ScryptedInterface.Notifier}')`,
|
|
131
|
+
description: 'Select one or more notifiers to receive alerts',
|
|
130
132
|
group: 'Alerts',
|
|
131
133
|
},
|
|
132
134
|
|