diff --git a/plugins/rtsp/src/rtsp.ts b/plugins/rtsp/src/rtsp.ts index 0fa298719..2657c4c01 100644 --- a/plugins/rtsp/src/rtsp.ts +++ b/plugins/rtsp/src/rtsp.ts @@ -153,8 +153,8 @@ export abstract class RtspSmartCamera extends RtspCamera { this.motionDetected = false; if (this.interfaces.includes(ScryptedInterface.AudioSensor)) this.audioDetected = false; - if (this.interfaces.includes(ScryptedInterface.IntrusionSensor)) - this.intrusionDetected = false; + if (this.interfaces.includes(ScryptedInterface.TamperSensor)) + this.tampered = false; if (this.interfaces.includes(ScryptedInterface.BinarySensor)) this.binaryState = false; } diff --git a/plugins/zwave/src/CommandClasses/IntrusionSensorToHomeSecurity.ts b/plugins/zwave/src/CommandClasses/TamperSensorToHomeSecurity.ts similarity index 58% rename from plugins/zwave/src/CommandClasses/IntrusionSensorToHomeSecurity.ts rename to plugins/zwave/src/CommandClasses/TamperSensorToHomeSecurity.ts index c3e8165d0..da0c11313 100644 --- a/plugins/zwave/src/CommandClasses/IntrusionSensorToHomeSecurity.ts +++ b/plugins/zwave/src/CommandClasses/TamperSensorToHomeSecurity.ts @@ -1,15 +1,14 @@ -import { IntrusionSensor } from "@scrypted/sdk"; -import { ValueID } from "@zwave-js/core"; +import { TamperSensor } from "@scrypted/sdk"; import { ZWaveNodeValueUpdatedArgs } from "zwave-js"; import { Notification } from "./Notification"; -import { containsAny, ZwaveDeviceBase } from "./ZwaveDeviceBase"; +import { ZwaveDeviceBase } from "./ZwaveDeviceBase"; -export class IntrusionSensorToHomeSecurity extends Notification implements IntrusionSensor { +export class TamperSensorToHomeSecurity extends Notification implements TamperSensor { static updateState(zwaveDevice: ZwaveDeviceBase, valueId: ZWaveNodeValueUpdatedArgs) { const notification = Notification.lookupNotification(zwaveDevice, 'Home Security'); const value = notification.lookupValue(valueId.newValue as number); // unset with any noninstrusion value - zwaveDevice.intrusionDetected = !!value; + zwaveDevice.tampered = !!value; } } diff --git a/plugins/zwave/src/CommandClasses/index.ts b/plugins/zwave/src/CommandClasses/index.ts index 8a5ce21f4..90d0909df 100644 --- a/plugins/zwave/src/CommandClasses/index.ts +++ b/plugins/zwave/src/CommandClasses/index.ts @@ -16,10 +16,11 @@ import { NotificationType } from './Notification'; import { EntrySensorToAccessControl } from './EntrySensorToAccessControl'; import { FloodSensorToWaterAlarm } from './FloodSensorToWaterAlarm'; import { PasswordStoreToUserCode } from './PasswordStoreToUserCode'; -import { IntrusionSensorToHomeSecurity } from './IntrusionSensorToHomeSecurity'; +import { TamperSensorToHomeSecurity } from './TamperSensorToHomeSecurity'; import { PowerSensorToPowerManagement } from './PowerSensorToPowerManagement'; import { ZWaveNode } from 'zwave-js'; import {CommandClasses, ValueID} from '@zwave-js/core' +import { ScryptedInterface } from '@scrypted/sdk'; var CommandClassMap: {[ccId: string]: CommandClassInfo} = {}; @@ -85,7 +86,7 @@ addCommandClassIndex(CommandClasses['Multilevel Sensor'], 'Ultraviolet', Ultravi addCommandClassIndex(CommandClasses['Notification'], 'Access Control', EntrySensorToAccessControl, 'EntrySensor'); addCommandClassIndex(CommandClasses['Notification'], 'Water Alarm', FloodSensorToWaterAlarm, 'FloodSensor'); -addCommandClassIndex(CommandClasses['Notification'], 'Home Security', IntrusionSensorToHomeSecurity, 'IntrusionSensor'); +addCommandClassIndex(CommandClasses['Notification'], 'Home Security', TamperSensorToHomeSecurity, ScryptedInterface.TamperSensor); addCommandClassIndex(CommandClasses['Notification'], 'Power Management', PowerSensorToPowerManagement, 'PowerSensor'); addCommandClassIndex(CommandClasses['Barrier Operator'], 'currentState', EntryToBarrierOperator, 'Entry');