diff --git a/src/Manager.js b/src/Manager.js index 63f6ede..166504c 100644 --- a/src/Manager.js +++ b/src/Manager.js @@ -76,7 +76,7 @@ export default class Manager { /* Event Callbacks */ onMotionDetected = debounceStateUpdate((onvifDeviceId, motionState) => { const topicKey = 'motion'; - const boolMotionState = motionState.IsMotion; + const boolMotionState = motionState.IsMotion !== undefined ? motionState.IsMotion : motionState.State; this.publishTemplates(onvifDeviceId, topicKey, boolMotionState); this.publisher.publish(onvifDeviceId, topicKey, convertBooleanToSensorState(boolMotionState)); diff --git a/src/onvif/SubscriberGroup.js b/src/onvif/SubscriberGroup.js index f61c058..1a57709 100644 --- a/src/onvif/SubscriberGroup.js +++ b/src/onvif/SubscriberGroup.js @@ -12,7 +12,7 @@ export const CALLBACK_TYPES = { const EVENTS = { 'RuleEngine/CellMotionDetector/Motion': CALLBACK_TYPES.motion, 'RuleEngine/CellMotionDetector/Motion//.': CALLBACK_TYPES.motion, - 'VideoSoure/MotionAlarm': CALLBACK_TYPES.motion + 'VideoSource/MotionAlarm': CALLBACK_TYPES.motion }; const DEFAULT_CALLBACKS = {