From 63dcd35b177f8e4aeb6ceec9d22cb252a3bc1445 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sat, 22 Apr 2023 21:54:35 -0700 Subject: [PATCH] dummy-switch: friendly names on extensions --- plugins/dummy-switch/package-lock.json | 4 ++-- plugins/dummy-switch/package.json | 2 +- plugins/dummy-switch/src/main.ts | 13 ++++++++++++- plugins/dummy-switch/src/replace-binary-sensor.ts | 2 +- plugins/dummy-switch/src/replace-motion-sensor.ts | 2 +- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/plugins/dummy-switch/package-lock.json b/plugins/dummy-switch/package-lock.json index 83ed18b6b6..32e0f82af6 100644 --- a/plugins/dummy-switch/package-lock.json +++ b/plugins/dummy-switch/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/dummy-switch", - "version": "0.0.19", + "version": "0.0.21", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/dummy-switch", - "version": "0.0.19", + "version": "0.0.21", "dependencies": { "@types/node": "^16.6.1", "axios": "^1.3.6" diff --git a/plugins/dummy-switch/package.json b/plugins/dummy-switch/package.json index 293cb92832..2eb93c14db 100644 --- a/plugins/dummy-switch/package.json +++ b/plugins/dummy-switch/package.json @@ -38,5 +38,5 @@ "@scrypted/common": "file:../../common", "@scrypted/sdk": "file:../../sdk" }, - "version": "0.0.19" + "version": "0.0.21" } diff --git a/plugins/dummy-switch/src/main.ts b/plugins/dummy-switch/src/main.ts index 39fc18760e..efa2ccb51a 100644 --- a/plugins/dummy-switch/src/main.ts +++ b/plugins/dummy-switch/src/main.ts @@ -92,13 +92,24 @@ class DummyDeviceProvider extends ScryptedDeviceBase implements DeviceProvider, (async () => { await deviceManager.onDeviceDiscovered( { - name: 'Replace Motion Sensor', + name: 'Custom Motion Sensor', nativeId: ReplaceMotionSensorNativeId, interfaces: [ScryptedInterface.MixinProvider], type: ScryptedDeviceType.Builtin, }, ); })(); + + (async () => { + await deviceManager.onDeviceDiscovered( + { + name: 'Custom Doorbell Button', + nativeId: ReplaceBinarySensorNativeId, + interfaces: [ScryptedInterface.MixinProvider], + type: ScryptedDeviceType.Builtin, + }, + ); + })(); } async getCreateDeviceSettings(): Promise { diff --git a/plugins/dummy-switch/src/replace-binary-sensor.ts b/plugins/dummy-switch/src/replace-binary-sensor.ts index c30417f8f8..cefdf656fb 100644 --- a/plugins/dummy-switch/src/replace-binary-sensor.ts +++ b/plugins/dummy-switch/src/replace-binary-sensor.ts @@ -65,7 +65,7 @@ export class ReplaceBinarySensor extends ScryptedDeviceBase implements MixinProv async getMixin(mixinDevice: any, mixinDeviceInterfaces: ScryptedInterface[], mixinDeviceState: DeviceState): Promise { return new ReplaceBinarySensorMixin({ - group: 'Replace Binary Sensor', + group: 'Custom Doorbell Button', groupKey: 'replaceBinarySensor', mixinDevice, mixinDeviceInterfaces, diff --git a/plugins/dummy-switch/src/replace-motion-sensor.ts b/plugins/dummy-switch/src/replace-motion-sensor.ts index c571303876..e1f0ba2e23 100644 --- a/plugins/dummy-switch/src/replace-motion-sensor.ts +++ b/plugins/dummy-switch/src/replace-motion-sensor.ts @@ -65,7 +65,7 @@ export class ReplaceMotionSensor extends ScryptedDeviceBase implements MixinProv async getMixin(mixinDevice: any, mixinDeviceInterfaces: ScryptedInterface[], mixinDeviceState: DeviceState): Promise { return new ReplaceMotionSensorMixin({ - group: 'Replace Motion Sensor', + group: 'Custom Motion Sensor', groupKey: 'replaceMotionSensor', mixinDevice, mixinDeviceInterfaces,