Skip to content

Commit

Permalink
dummy-switch: friendly names on extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Apr 23, 2023
1 parent 951c3b9 commit 63dcd35
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions plugins/dummy-switch/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/dummy-switch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
"@scrypted/common": "file:../../common",
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.0.19"
"version": "0.0.21"
}
13 changes: 12 additions & 1 deletion plugins/dummy-switch/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Setting[]> {
Expand Down
2 changes: 1 addition & 1 deletion plugins/dummy-switch/src/replace-binary-sensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class ReplaceBinarySensor extends ScryptedDeviceBase implements MixinProv

async getMixin(mixinDevice: any, mixinDeviceInterfaces: ScryptedInterface[], mixinDeviceState: DeviceState): Promise<any> {
return new ReplaceBinarySensorMixin({
group: 'Replace Binary Sensor',
group: 'Custom Doorbell Button',
groupKey: 'replaceBinarySensor',
mixinDevice,
mixinDeviceInterfaces,
Expand Down
2 changes: 1 addition & 1 deletion plugins/dummy-switch/src/replace-motion-sensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class ReplaceMotionSensor extends ScryptedDeviceBase implements MixinProv

async getMixin(mixinDevice: any, mixinDeviceInterfaces: ScryptedInterface[], mixinDeviceState: DeviceState): Promise<any> {
return new ReplaceMotionSensorMixin({
group: 'Replace Motion Sensor',
group: 'Custom Motion Sensor',
groupKey: 'replaceMotionSensor',
mixinDevice,
mixinDeviceInterfaces,
Expand Down

0 comments on commit 63dcd35

Please sign in to comment.