homebridge-securitysystem 8.3.0-beta.2 → 8.3.0-beta.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +7 -7
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-securitysystem",
3
3
  "displayName": "Homebridge Security System",
4
- "version": "8.3.0-beta.2",
4
+ "version": "8.3.0-beta.3",
5
5
  "description": "Homebridge plugin that creates a security system accessory that can be triggered by HomeKit sensors.",
6
6
  "main": "src/index.js",
7
7
  "scripts": {
package/src/index.js CHANGED
@@ -700,10 +700,6 @@ SecuritySystem.prototype.identify = function (callback) {
700
700
 
701
701
  // Services
702
702
  SecuritySystem.prototype.addArmingMotionSensor = function () {
703
- if (options.armingMotionSensor === false) {
704
- return;
705
- }
706
-
707
703
  this.armingMotionSensorService = new Service.MotionSensor(
708
704
  "Arming",
709
705
  "arming-motion-sensor"
@@ -718,7 +714,9 @@ SecuritySystem.prototype.addArmingMotionSensor = function () {
718
714
  .getCharacteristic(Characteristic.MotionDetected)
719
715
  .on("get", this.getArmingMotionDetected.bind(this));
720
716
 
721
- this.services.push(this.armingMotionSensorService);
717
+ if (options.armingMotionSensor) {
718
+ this.services.push(this.armingMotionSensorService);
719
+ }
722
720
  };
723
721
 
724
722
  // Security system
@@ -834,6 +832,9 @@ SecuritySystem.prototype.handleCurrentStateChange = function (origin) {
834
832
  }
835
833
  }
836
834
 
835
+ // Reset trip switches if on
836
+ this.resetTripSwitches();
837
+
837
838
  // Commands
838
839
  this.executeCommand("current", this.currentState, origin);
839
840
 
@@ -871,8 +872,7 @@ SecuritySystem.prototype.handleTriggeredState = function () {
871
872
  }
872
873
 
873
874
  // Normal flow
874
- this.handleTargetStateChange(originTypes.EXTERNAL);
875
- this.setCurrentState(this.targetState, false);
875
+ this.setCurrentState(this.targetState, originTypes.EXTERNAL);
876
876
  }, options.resetMinutes * 60 * 1000);
877
877
  };
878
878