homebridge-securitysystem 6.6.1 → 6.6.2-beta.2

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.
@@ -17,4 +17,4 @@ jobs:
17
17
  - name: 'Checkout Repository'
18
18
  uses: actions/checkout@v3
19
19
  - name: 'Dependency Review'
20
- uses: actions/dependency-review-action@v2
20
+ uses: actions/dependency-review-action@v3
@@ -17,7 +17,7 @@ jobs:
17
17
  pull-requests: write
18
18
 
19
19
  steps:
20
- - uses: actions/stale@v6
20
+ - uses: actions/stale@v7
21
21
  with:
22
22
  repo-token: ${{ secrets.GITHUB_TOKEN }}
23
23
  stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a few days if no further activity occurs. Thank you for your contributions.'
package/SECURITY.md CHANGED
@@ -9,4 +9,4 @@
9
9
 
10
10
  ## Reporting a Vulnerability
11
11
 
12
- Please email findings to miguelripoll23@outlook.com.
12
+ Please report any findings using GitHub.
@@ -281,14 +281,14 @@
281
281
  "minimum": 0
282
282
  },
283
283
  "arming_lock_switch": {
284
- "title": "Show Arming Lock Switch (beta)",
284
+ "title": "Show Arming Lock Switch (experimental)",
285
285
  "description": "Adds a global switch that will prevent arming the security system.",
286
286
  "type": "boolean",
287
287
  "default": false,
288
288
  "required": false
289
289
  },
290
290
  "arming_lock_switches": {
291
- "title": "Show Arming Lock Mode Switches (beta)",
291
+ "title": "Show Arming Lock Mode Switches (experimental)",
292
292
  "description": "Adds switches that will prevent arming the security system when their mode is set.",
293
293
  "type": "boolean",
294
294
  "default": false,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-securitysystem",
3
3
  "displayName": "Homebridge Security System",
4
- "version": "6.6.1",
4
+ "version": "6.6.2-beta.2",
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
@@ -9,6 +9,9 @@ const rateLimit = require("express-rate-limit");
9
9
  const packageJson = require("../package.json");
10
10
  const options = require("./utils/options.js");
11
11
 
12
+ // HomeKit error
13
+ const HK_NOT_ALLOWED_IN_CURRENT_STATE = -70412;
14
+
12
15
  const originTypes = {
13
16
  REGULAR_SWITCH: 0,
14
17
  SPECIAL_SWITCH: 1,
@@ -828,6 +831,7 @@ SecuritySystem.prototype.updateTargetState = function (
828
831
 
829
832
  if (callback !== null) {
830
833
  // Tip: this will revert the original state
834
+ // HomeKit error
831
835
  callback(Characteristic.SecuritySystemTargetState.DISARM);
832
836
  }
833
837
 
@@ -848,6 +852,7 @@ SecuritySystem.prototype.updateTargetState = function (
848
852
 
849
853
  if (callback !== null) {
850
854
  // Tip: this will revert the original state
855
+ // HomeKit error
851
856
  callback(Characteristic.SecuritySystemTargetState.DISARM);
852
857
  }
853
858
 
@@ -979,7 +984,7 @@ SecuritySystem.prototype.updateSiren = function (
979
984
  this.log.warn("Siren Switch (Not armed)");
980
985
 
981
986
  if (callback !== null) {
982
- callback(-70412, false);
987
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
983
988
  }
984
989
 
985
990
  return false;
@@ -990,7 +995,7 @@ SecuritySystem.prototype.updateSiren = function (
990
995
  this.log.warn("Siren Switch (Still arming)");
991
996
 
992
997
  if (callback !== null) {
993
- callback(-70412, false);
998
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
994
999
  }
995
1000
 
996
1001
  return false;
@@ -1043,7 +1048,8 @@ SecuritySystem.prototype.updateSiren = function (
1043
1048
  }, doubleKnockSeconds * 1000);
1044
1049
 
1045
1050
  if (callback !== null) {
1046
- callback(-70412, false);
1051
+
1052
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
1047
1053
  }
1048
1054
 
1049
1055
  return false;
@@ -1068,7 +1074,7 @@ SecuritySystem.prototype.updateSiren = function (
1068
1074
  this.log.warn("Siren Switch (Already triggered)");
1069
1075
 
1070
1076
  if (callback !== null) {
1071
- callback(-70412, false);
1077
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
1072
1078
  }
1073
1079
 
1074
1080
  return false;
@@ -1079,7 +1085,7 @@ SecuritySystem.prototype.updateSiren = function (
1079
1085
  this.log.warn("Siren Switch (Already on)");
1080
1086
 
1081
1087
  if (callback !== null) {
1082
- callback(-70412, false);
1088
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
1083
1089
  }
1084
1090
 
1085
1091
  return false;
@@ -1802,7 +1808,7 @@ SecuritySystem.prototype.triggerIfModeSet = function (
1802
1808
  this.updateSiren(value, originTypes.REGULAR_SWITCH, false, callback);
1803
1809
  } else {
1804
1810
  this.log.debug("Siren (Mode switch not set)");
1805
- callback(-70412, false);
1811
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
1806
1812
  }
1807
1813
  } else {
1808
1814
  this.updateSiren(value, originTypes.REGULAR_SWITCH, false, callback);
@@ -2059,7 +2065,7 @@ SecuritySystem.prototype.getModeHomeSwitch = function (callback) {
2059
2065
 
2060
2066
  SecuritySystem.prototype.setModeHomeSwitch = function (value, callback) {
2061
2067
  if (value === false) {
2062
- callback(-70412, false);
2068
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
2063
2069
  return;
2064
2070
  }
2065
2071
 
@@ -2081,7 +2087,7 @@ SecuritySystem.prototype.getModeAwaySwitch = function (callback) {
2081
2087
 
2082
2088
  SecuritySystem.prototype.setModeAwaySwitch = function (value, callback) {
2083
2089
  if (value === false) {
2084
- callback(-70412, false);
2090
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
2085
2091
  return;
2086
2092
  }
2087
2093
 
@@ -2103,7 +2109,7 @@ SecuritySystem.prototype.getModeNightSwitch = function (callback) {
2103
2109
 
2104
2110
  SecuritySystem.prototype.setModeNightSwitch = function (value, callback) {
2105
2111
  if (value === false) {
2106
- callback(-70412, false);
2112
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
2107
2113
  return;
2108
2114
  }
2109
2115
 
@@ -2125,7 +2131,7 @@ SecuritySystem.prototype.getModeOffSwitch = function (callback) {
2125
2131
 
2126
2132
  SecuritySystem.prototype.setModeOffSwitch = function (value, callback) {
2127
2133
  if (value === false) {
2128
- callback(-70412, false);
2134
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
2129
2135
  return;
2130
2136
  }
2131
2137
 
@@ -2150,7 +2156,7 @@ SecuritySystem.prototype.setModeAwayExtendedSwitch = function (
2150
2156
  callback
2151
2157
  ) {
2152
2158
  if (value === false) {
2153
- callback(-70412, false);
2159
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
2154
2160
  return;
2155
2161
  }
2156
2162
 
@@ -2176,7 +2182,7 @@ SecuritySystem.prototype.setModePauseSwitch = function (value, callback) {
2176
2182
  Characteristic.SecuritySystemCurrentState.ALARM_TRIGGERED
2177
2183
  ) {
2178
2184
  this.log.warn("Mode pause (Alarm is triggered)");
2179
- callback(-70412, false);
2185
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
2180
2186
  return;
2181
2187
  }
2182
2188
 
@@ -2185,7 +2191,7 @@ SecuritySystem.prototype.setModePauseSwitch = function (value, callback) {
2185
2191
  this.currentState === Characteristic.SecuritySystemCurrentState.DISARMED
2186
2192
  ) {
2187
2193
  this.log.warn("Mode pause (Not armed)");
2188
- callback(-70412, false);
2194
+ callback(HK_NOT_ALLOWED_IN_CURRENT_STATE, false);
2189
2195
  return;
2190
2196
  }
2191
2197