homebridge-securitysystem 6.3.0-beta.0 → 6.3.0
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.
- package/package.json +2 -2
- package/src/index.js +30 -13
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-securitysystem",
|
|
3
3
|
"displayName": "Homebridge Security System",
|
|
4
|
-
"version": "6.3.0
|
|
4
|
+
"version": "6.3.0",
|
|
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": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"express": "^4.17.1",
|
|
44
44
|
"express-rate-limit": "^6.2.1",
|
|
45
|
-
"node-fetch": "^2.6.
|
|
45
|
+
"node-fetch": "^2.6.7",
|
|
46
46
|
"node-persist": "^3.0.5"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
package/src/index.js
CHANGED
|
@@ -835,7 +835,7 @@ SecuritySystem.prototype.updateSiren = function (value, origin, stateChanged, ca
|
|
|
835
835
|
const isNotSpecialSwitch = origin !== originTypes.SPECIAL_SWITCH;
|
|
836
836
|
|
|
837
837
|
if (isCurrentStateDisarmed && isNotOverridingOff && isNotSpecialSwitch) {
|
|
838
|
-
this.log.warn('Siren (Not armed)');
|
|
838
|
+
this.log.warn('Siren Switch (Not armed)');
|
|
839
839
|
|
|
840
840
|
if (callback !== null) {
|
|
841
841
|
callback(-70412, false);
|
|
@@ -846,7 +846,7 @@ SecuritySystem.prototype.updateSiren = function (value, origin, stateChanged, ca
|
|
|
846
846
|
|
|
847
847
|
// Check if arming
|
|
848
848
|
if (this.isArming) {
|
|
849
|
-
this.log.warn('Siren (Still arming)');
|
|
849
|
+
this.log.warn('Siren Switch (Still arming)');
|
|
850
850
|
|
|
851
851
|
if (callback !== null) {
|
|
852
852
|
callback(-70412, false);
|
|
@@ -866,7 +866,7 @@ SecuritySystem.prototype.updateSiren = function (value, origin, stateChanged, ca
|
|
|
866
866
|
const isStateKnockable = doubleKnockStates.includes(this.currentState);
|
|
867
867
|
|
|
868
868
|
if (value && isStateKnockable && isFirstKnock && isSpecialSwitch === false) {
|
|
869
|
-
this.log.warn('Siren (Knock)');
|
|
869
|
+
this.log.warn('Siren Switch (Knock)');
|
|
870
870
|
this.isKnocked = true;
|
|
871
871
|
|
|
872
872
|
// Custom mode seconds
|
|
@@ -886,7 +886,7 @@ SecuritySystem.prototype.updateSiren = function (value, origin, stateChanged, ca
|
|
|
886
886
|
this.doubleKnockTimeout = null;
|
|
887
887
|
this.isKnocked = false;
|
|
888
888
|
|
|
889
|
-
this.log.info('Siren (Reset)');
|
|
889
|
+
this.log.info('Siren Switch (Reset)');
|
|
890
890
|
}, doubleKnockSeconds * 1000);
|
|
891
891
|
|
|
892
892
|
if (callback !== null) {
|
|
@@ -912,7 +912,7 @@ SecuritySystem.prototype.updateSiren = function (value, origin, stateChanged, ca
|
|
|
912
912
|
if (value) {
|
|
913
913
|
// Already triggered
|
|
914
914
|
if (isCurrentStateAlarmTriggered) {
|
|
915
|
-
this.log.warn('Siren (Already triggered)');
|
|
915
|
+
this.log.warn('Siren Switch (Already triggered)');
|
|
916
916
|
|
|
917
917
|
if (callback !== null) {
|
|
918
918
|
callback(-70412, false);
|
|
@@ -923,7 +923,7 @@ SecuritySystem.prototype.updateSiren = function (value, origin, stateChanged, ca
|
|
|
923
923
|
|
|
924
924
|
// Already about to trigger
|
|
925
925
|
if (this.triggerTimeout !== null) {
|
|
926
|
-
this.log.warn('Siren (Already on)');
|
|
926
|
+
this.log.warn('Siren Switch (Already on)');
|
|
927
927
|
|
|
928
928
|
if (callback !== null) {
|
|
929
929
|
callback(-70412, false);
|
|
@@ -932,7 +932,7 @@ SecuritySystem.prototype.updateSiren = function (value, origin, stateChanged, ca
|
|
|
932
932
|
return false;
|
|
933
933
|
}
|
|
934
934
|
|
|
935
|
-
this.log.info('Siren (On)');
|
|
935
|
+
this.log.info('Siren Switch (On)');
|
|
936
936
|
|
|
937
937
|
// Update siren tripped sensor
|
|
938
938
|
if (options.trippedSensor) {
|
|
@@ -989,7 +989,7 @@ SecuritySystem.prototype.updateSiren = function (value, origin, stateChanged, ca
|
|
|
989
989
|
}
|
|
990
990
|
else {
|
|
991
991
|
// Off
|
|
992
|
-
this.log.info('Siren (Off)');
|
|
992
|
+
this.log.info('Siren Switch (Off)');
|
|
993
993
|
this.stopAudio();
|
|
994
994
|
|
|
995
995
|
if (isCurrentStateAlarmTriggered) {
|
|
@@ -1536,26 +1536,30 @@ SecuritySystem.prototype.setSirenOverrideSwitch = function (value, callback) {
|
|
|
1536
1536
|
};
|
|
1537
1537
|
|
|
1538
1538
|
SecuritySystem.prototype.resetSirenSwitches = function () {
|
|
1539
|
-
const sirenOverrideOnCharacteristic = this.sirenOverrideSwitchService.getCharacteristic(Characteristic.On);
|
|
1540
|
-
|
|
1541
1539
|
const sirenHomeOnCharacteristic = this.sirenHomeSwitchService.getCharacteristic(Characteristic.On);
|
|
1542
1540
|
const sirenAwayOnCharacteristic = this.sirenAwaySwitchService.getCharacteristic(Characteristic.On);
|
|
1543
1541
|
const sirenNightOnCharacteristic = this.sirenNightSwitchService.getCharacteristic(Characteristic.On);
|
|
1544
1542
|
|
|
1545
|
-
|
|
1546
|
-
sirenOverrideOnCharacteristic.updateValue(false);
|
|
1547
|
-
}
|
|
1543
|
+
const sirenOverrideOnCharacteristic = this.sirenOverrideSwitchService.getCharacteristic(Characteristic.On);
|
|
1548
1544
|
|
|
1549
1545
|
if (sirenHomeOnCharacteristic.value) {
|
|
1550
1546
|
sirenHomeOnCharacteristic.updateValue(false);
|
|
1547
|
+
this.log.debug('Siren Home Switch (Off)');
|
|
1551
1548
|
}
|
|
1552
1549
|
|
|
1553
1550
|
if (sirenAwayOnCharacteristic.value) {
|
|
1554
1551
|
sirenAwayOnCharacteristic.updateValue(false);
|
|
1552
|
+
this.log.debug('Siren Away Switch (Off)');
|
|
1555
1553
|
}
|
|
1556
1554
|
|
|
1557
1555
|
if (sirenNightOnCharacteristic.value) {
|
|
1558
1556
|
sirenNightOnCharacteristic.updateValue(false);
|
|
1557
|
+
this.log.debug('Siren Night Switch (Off)');
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
if (sirenOverrideOnCharacteristic.value) {
|
|
1561
|
+
sirenOverrideOnCharacteristic.updateValue(false);
|
|
1562
|
+
this.log.debug('Siren Override Switch (Off)');
|
|
1559
1563
|
}
|
|
1560
1564
|
};
|
|
1561
1565
|
|
|
@@ -1583,6 +1587,7 @@ SecuritySystem.prototype.getSirenHomeSwitch = function (callback) {
|
|
|
1583
1587
|
};
|
|
1584
1588
|
|
|
1585
1589
|
SecuritySystem.prototype.setSirenHomeSwitch = function (value, callback) {
|
|
1590
|
+
this.log.debug('Siren Home Switch (On)');
|
|
1586
1591
|
this.triggerIfModeSet(Characteristic.SecuritySystemCurrentState.STAY_ARM, value, callback);
|
|
1587
1592
|
};
|
|
1588
1593
|
|
|
@@ -1592,6 +1597,7 @@ SecuritySystem.prototype.getSirenAwaySwitch = function (callback) {
|
|
|
1592
1597
|
};
|
|
1593
1598
|
|
|
1594
1599
|
SecuritySystem.prototype.setSirenAwaySwitch = function (value, callback) {
|
|
1600
|
+
this.log.debug('Siren Away Switch (On)');
|
|
1595
1601
|
this.triggerIfModeSet(Characteristic.SecuritySystemCurrentState.AWAY_ARM, value, callback);
|
|
1596
1602
|
};
|
|
1597
1603
|
|
|
@@ -1601,6 +1607,7 @@ SecuritySystem.prototype.getSirenNightSwitch = function (callback) {
|
|
|
1601
1607
|
};
|
|
1602
1608
|
|
|
1603
1609
|
SecuritySystem.prototype.setSirenNightSwitch = function (value, callback) {
|
|
1610
|
+
this.log.debug('Siren Night Switch (On)');
|
|
1604
1611
|
this.triggerIfModeSet(Characteristic.SecuritySystemCurrentState.NIGHT_ARM, value, callback);
|
|
1605
1612
|
};
|
|
1606
1613
|
|
|
@@ -1722,26 +1729,32 @@ SecuritySystem.prototype.resetModeSwitches = function () {
|
|
|
1722
1729
|
|
|
1723
1730
|
if (modeHomeSwitchCharacteristicOn.value) {
|
|
1724
1731
|
modeHomeSwitchCharacteristicOn.updateValue(false);
|
|
1732
|
+
this.log.debug('Mode Home Switch (Off)');
|
|
1725
1733
|
}
|
|
1726
1734
|
|
|
1727
1735
|
if (modeAwaySwitchCharacteristicOn.value) {
|
|
1728
1736
|
modeAwaySwitchCharacteristicOn.updateValue(false);
|
|
1737
|
+
this.log.debug('Mode Away Switch (Off)');
|
|
1729
1738
|
}
|
|
1730
1739
|
|
|
1731
1740
|
if (modeNightSwitchCharacteristicOn.value) {
|
|
1732
1741
|
modeNightSwitchCharacteristicOn.updateValue(false);
|
|
1742
|
+
this.log.debug('Mode Night Switch (Off)');
|
|
1733
1743
|
}
|
|
1734
1744
|
|
|
1735
1745
|
if (modeOffSwitchCharacteristicOn.value) {
|
|
1736
1746
|
modeOffSwitchCharacteristicOn.updateValue(false);
|
|
1747
|
+
this.log.debug('Mode Off Switch (Off)');
|
|
1737
1748
|
}
|
|
1738
1749
|
|
|
1739
1750
|
if (modeAwayExtendedSwitchCharacteristicOn.value) {
|
|
1740
1751
|
modeAwayExtendedSwitchCharacteristicOn.updateValue(false);
|
|
1752
|
+
this.log.debug('Mode Away Extended Switch (Off)');
|
|
1741
1753
|
}
|
|
1742
1754
|
|
|
1743
1755
|
if (modePauseSwitchCharacteristicOn.value) {
|
|
1744
1756
|
modePauseSwitchCharacteristicOn.updateValue(false);
|
|
1757
|
+
this.log.debug('Mode Pause Switch (Off)');
|
|
1745
1758
|
}
|
|
1746
1759
|
};
|
|
1747
1760
|
|
|
@@ -1749,18 +1762,22 @@ SecuritySystem.prototype.updateModeSwitches = function () {
|
|
|
1749
1762
|
switch (this.targetState) {
|
|
1750
1763
|
case Characteristic.SecuritySystemTargetState.STAY_ARM:
|
|
1751
1764
|
this.modeHomeSwitchService.updateCharacteristic(Characteristic.On, true);
|
|
1765
|
+
this.log.debug('Mode Home Switch (On)');
|
|
1752
1766
|
break;
|
|
1753
1767
|
|
|
1754
1768
|
case Characteristic.SecuritySystemTargetState.AWAY_ARM:
|
|
1755
1769
|
this.modeAwaySwitchService.updateCharacteristic(Characteristic.On, true);
|
|
1770
|
+
this.log.debug('Mode Away Switch (On)');
|
|
1756
1771
|
break;
|
|
1757
1772
|
|
|
1758
1773
|
case Characteristic.SecuritySystemTargetState.NIGHT_ARM:
|
|
1759
1774
|
this.modeNightSwitchService.updateCharacteristic(Characteristic.On, true);
|
|
1775
|
+
this.log.debug('Mode Night Switch (On)');
|
|
1760
1776
|
break;
|
|
1761
1777
|
|
|
1762
1778
|
case Characteristic.SecuritySystemTargetState.DISARM:
|
|
1763
1779
|
this.modeOffSwitchService.updateCharacteristic(Characteristic.On, true);
|
|
1780
|
+
this.log.debug('Mode Off Switch (On)');
|
|
1764
1781
|
break;
|
|
1765
1782
|
}
|
|
1766
1783
|
};
|