eufy-security-client 2.2.0 → 2.2.1

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.
@@ -682,6 +682,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
682
682
  if (!device.hasProperty(propertyData.name)) {
683
683
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
684
684
  }
685
+ const property = device.getPropertyMetadata(propertyData.name);
686
+ (0, utils_3.validValue)(property, value);
685
687
  this.log.debug(`Sending status led command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
686
688
  if (device.isCamera2Product() || device.isCamera3Product() || device.getDeviceType() === types_1.DeviceType.CAMERA || device.getDeviceType() === types_1.DeviceType.CAMERA_E) {
687
689
  await this.p2pSession.sendCommandWithIntString({
@@ -703,7 +705,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
703
705
  property: propertyData
704
706
  });
705
707
  }
706
- else if (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423 || device.getDeviceType() === types_1.DeviceType.FLOODLIGHT) {
708
+ else if (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423 || (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT && !device.isFloodLightT8420X())) {
707
709
  await this.p2pSession.sendCommandWithIntString({
708
710
  commandType: types_2.CommandType.CMD_DEV_LED_SWITCH,
709
711
  value: value === true ? 1 : 0,
@@ -826,6 +828,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
826
828
  if (!device.hasProperty(propertyData.name)) {
827
829
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
828
830
  }
831
+ const property = device.getPropertyMetadata(propertyData.name);
832
+ (0, utils_3.validValue)(property, value);
829
833
  this.log.debug(`Sending autonightvision command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
830
834
  await this.p2pSession.sendCommandWithIntString({
831
835
  commandType: types_2.CommandType.CMD_IRCUT_SWITCH,
@@ -847,6 +851,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
847
851
  if (!device.hasProperty(propertyData.name)) {
848
852
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
849
853
  }
854
+ const property = device.getPropertyMetadata(propertyData.name);
855
+ (0, utils_3.validValue)(property, value);
850
856
  this.log.debug(`Sending nightvision command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
851
857
  await this.p2pSession.sendCommandWithStringPayload({
852
858
  commandType: types_2.CommandType.CMD_SET_PAYLOAD,
@@ -875,8 +881,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
875
881
  if (!device.hasProperty(propertyData.name)) {
876
882
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
877
883
  }
884
+ const property = device.getPropertyMetadata(propertyData.name);
885
+ (0, utils_3.validValue)(property, value);
878
886
  this.log.debug(`Sending motion detection command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
879
- if (device.isIndoorCamera() || (device.isFloodLight() && device.getDeviceType() !== types_1.DeviceType.FLOODLIGHT)) {
887
+ if (device.isIndoorCamera() || (device.isFloodLight() && device.getDeviceType() !== types_1.DeviceType.FLOODLIGHT) || device.isFloodLightT8420X()) {
880
888
  await this.p2pSession.sendCommandWithStringPayload({
881
889
  commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
882
890
  value: JSON.stringify({
@@ -954,6 +962,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
954
962
  if (!device.hasProperty(propertyData.name)) {
955
963
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
956
964
  }
965
+ const property = device.getPropertyMetadata(propertyData.name);
966
+ (0, utils_3.validValue)(property, value);
957
967
  this.log.debug(`Sending sound detection command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
958
968
  await this.p2pSession.sendCommandWithStringPayload({
959
969
  commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
@@ -1051,6 +1061,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1051
1061
  if (!device.hasProperty(propertyData.name)) {
1052
1062
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
1053
1063
  }
1064
+ const property = device.getPropertyMetadata(propertyData.name);
1065
+ (0, utils_3.validValue)(property, value);
1054
1066
  this.log.debug(`Sending pet detection command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
1055
1067
  await this.p2pSession.sendCommandWithStringPayload({
1056
1068
  commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
@@ -1131,6 +1143,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1131
1143
  if (!device.hasProperty(propertyData.name)) {
1132
1144
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
1133
1145
  }
1146
+ const property = device.getPropertyMetadata(propertyData.name);
1147
+ (0, utils_3.validValue)(property, value);
1134
1148
  this.log.debug(`Sending switch light command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
1135
1149
  if (device.isFloodLight() || device.isSoloCameraSpotlight1080() || device.isSoloCameraSpotlight2k() ||
1136
1150
  device.isSoloCameraSpotlightSolar() || device.isCamera2C() || device.isCamera2CPro() ||
@@ -1163,7 +1177,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1163
1177
  const property = device.getPropertyMetadata(propertyData.name);
1164
1178
  (0, utils_3.validValue)(property, value);
1165
1179
  this.log.debug(`Sending motion detection sensitivity command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
1166
- if ((device.isFloodLight() && device.getDeviceType() !== types_1.DeviceType.FLOODLIGHT) || device.isIndoorCamera()) {
1180
+ if ((device.isFloodLight() && device.getDeviceType() !== types_1.DeviceType.FLOODLIGHT) || device.isIndoorCamera() || device.isFloodLightT8420X()) {
1167
1181
  await this.p2pSession.sendCommandWithStringPayload({
1168
1182
  commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
1169
1183
  value: JSON.stringify({
@@ -1429,6 +1443,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1429
1443
  if (!device.hasProperty(propertyData.name)) {
1430
1444
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
1431
1445
  }
1446
+ const property = device.getPropertyMetadata(propertyData.name);
1447
+ (0, utils_3.validValue)(property, value);
1432
1448
  this.log.debug(`Sending motion zone command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
1433
1449
  await this.p2pSession.sendCommandWithStringPayload({
1434
1450
  commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
@@ -1452,6 +1468,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1452
1468
  if (!device.hasProperty(propertyData.name)) {
1453
1469
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
1454
1470
  }
1471
+ const property = device.getPropertyMetadata(propertyData.name);
1472
+ (0, utils_3.validValue)(property, value);
1455
1473
  this.log.debug(`Sending motion tracking command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
1456
1474
  await this.p2pSession.sendCommandWithStringPayload({
1457
1475
  commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
@@ -1518,6 +1536,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1518
1536
  if (!device.hasProperty(propertyData.name)) {
1519
1537
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
1520
1538
  }
1539
+ const property = device.getPropertyMetadata(propertyData.name);
1540
+ (0, utils_3.validValue)(property, value);
1521
1541
  this.log.debug(`Sending mic mute command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
1522
1542
  await this.p2pSession.sendCommandWithIntString({
1523
1543
  commandType: types_2.CommandType.CMD_SET_DEV_MIC_MUTE,
@@ -1540,6 +1560,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1540
1560
  if (!device.hasProperty(propertyData.name)) {
1541
1561
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
1542
1562
  }
1563
+ const property = device.getPropertyMetadata(propertyData.name);
1564
+ (0, utils_3.validValue)(property, value);
1543
1565
  this.log.debug(`Sending audio recording command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
1544
1566
  if (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8423) {
1545
1567
  await this.p2pSession.sendCommandWithStringPayload({
@@ -1565,7 +1587,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1565
1587
  property: propertyData
1566
1588
  });
1567
1589
  }
1568
- else if (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT) {
1590
+ else if (device.getDeviceType() === types_1.DeviceType.FLOODLIGHT && !device.isFloodLightT8420X()) {
1569
1591
  await this.p2pSession.sendCommandWithStringPayload({
1570
1592
  commandType: types_2.CommandType.CMD_SET_PAYLOAD,
1571
1593
  value: JSON.stringify({
@@ -1647,6 +1669,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1647
1669
  if (!device.hasProperty(propertyData.name)) {
1648
1670
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
1649
1671
  }
1672
+ const property = device.getPropertyMetadata(propertyData.name);
1673
+ (0, utils_3.validValue)(property, value);
1650
1674
  this.log.debug(`Sending enable speaker command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
1651
1675
  await this.p2pSession.sendCommandWithIntString({
1652
1676
  commandType: types_2.CommandType.CMD_SET_DEV_SPEAKER_MUTE,
@@ -1736,6 +1760,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1736
1760
  if (!device.hasProperty(propertyData.name)) {
1737
1761
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
1738
1762
  }
1763
+ const property = device.getPropertyMetadata(propertyData.name);
1764
+ (0, utils_3.validValue)(property, value);
1739
1765
  this.log.debug(`Sending enable indoor chime command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
1740
1766
  if (device.isBatteryDoorbell()) {
1741
1767
  await this.p2pSession.sendCommandWithIntString({
@@ -1777,6 +1803,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1777
1803
  if (!device.hasProperty(propertyData.name)) {
1778
1804
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
1779
1805
  }
1806
+ const property = device.getPropertyMetadata(propertyData.name);
1807
+ (0, utils_3.validValue)(property, value);
1780
1808
  this.log.debug(`Sending enable homebase chime command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
1781
1809
  if (device.isBatteryDoorbell()) {
1782
1810
  await this.p2pSession.sendCommandWithIntString({
@@ -1959,6 +1987,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1959
1987
  if (!device.hasProperty(propertyData.name)) {
1960
1988
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
1961
1989
  }
1990
+ const property = device.getPropertyMetadata(propertyData.name);
1991
+ (0, utils_3.validValue)(property, value);
1962
1992
  this.log.debug(`Sending notification person command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
1963
1993
  if (device.isIndoorCamera()) {
1964
1994
  await this.p2pSession.sendCommandWithStringPayload({
@@ -1996,6 +2026,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
1996
2026
  if (!device.hasProperty(propertyData.name)) {
1997
2027
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
1998
2028
  }
2029
+ const property = device.getPropertyMetadata(propertyData.name);
2030
+ (0, utils_3.validValue)(property, value);
1999
2031
  this.log.debug(`Sending notification pet command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
2000
2032
  if (device.isIndoorCamera()) {
2001
2033
  await this.p2pSession.sendCommandWithStringPayload({
@@ -2033,6 +2065,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2033
2065
  if (!device.hasProperty(propertyData.name)) {
2034
2066
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
2035
2067
  }
2068
+ const property = device.getPropertyMetadata(propertyData.name);
2069
+ (0, utils_3.validValue)(property, value);
2036
2070
  this.log.debug(`Sending notification all other motion command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
2037
2071
  if (device.isIndoorCamera()) {
2038
2072
  await this.p2pSession.sendCommandWithStringPayload({
@@ -2070,6 +2104,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2070
2104
  if (!device.hasProperty(propertyData.name)) {
2071
2105
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
2072
2106
  }
2107
+ const property = device.getPropertyMetadata(propertyData.name);
2108
+ (0, utils_3.validValue)(property, value);
2073
2109
  this.log.debug(`Sending notification all sound command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
2074
2110
  if (device.isIndoorCamera()) {
2075
2111
  await this.p2pSession.sendCommandWithStringPayload({
@@ -2107,6 +2143,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2107
2143
  if (!device.hasProperty(propertyData.name)) {
2108
2144
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
2109
2145
  }
2146
+ const property = device.getPropertyMetadata(propertyData.name);
2147
+ (0, utils_3.validValue)(property, value);
2110
2148
  this.log.debug(`Sending notification crying command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
2111
2149
  if (device.isIndoorCamera()) {
2112
2150
  await this.p2pSession.sendCommandWithStringPayload({
@@ -2144,6 +2182,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2144
2182
  if (!device.hasProperty(propertyData.name)) {
2145
2183
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
2146
2184
  }
2185
+ const property = device.getPropertyMetadata(propertyData.name);
2186
+ (0, utils_3.validValue)(property, value);
2147
2187
  this.log.debug(`Sending notification ring command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
2148
2188
  if (device.isBatteryDoorbell() || device.isWiredDoorbellDual()) {
2149
2189
  await this.p2pSession.sendCommandWithStringPayload({
@@ -2192,6 +2232,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2192
2232
  if (!device.hasProperty(propertyData.name)) {
2193
2233
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
2194
2234
  }
2235
+ const property = device.getPropertyMetadata(propertyData.name);
2236
+ (0, utils_3.validValue)(property, value);
2195
2237
  this.log.debug(`Sending notification motion command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
2196
2238
  if (device.isBatteryDoorbell() || device.isWiredDoorbellDual()) {
2197
2239
  await this.p2pSession.sendCommandWithStringPayload({
@@ -2339,6 +2381,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2339
2381
  if (!device.hasProperty(propertyData.name)) {
2340
2382
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
2341
2383
  }
2384
+ const property = device.getPropertyMetadata(propertyData.name);
2385
+ (0, utils_3.validValue)(property, value);
2342
2386
  this.log.debug(`Sending recording end clip motion stops command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
2343
2387
  await this.p2pSession.sendCommandWithInt({
2344
2388
  commandType: types_2.CommandType.CMD_DEV_RECORD_AUTOSTOP,
@@ -2451,6 +2495,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2451
2495
  if (!device.hasProperty(propertyData.name)) {
2452
2496
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
2453
2497
  }
2498
+ const property = device.getPropertyMetadata(propertyData.name);
2499
+ (0, utils_3.validValue)(property, value);
2454
2500
  this.log.debug(`Sending wdr command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
2455
2501
  await this.p2pSession.sendCommandWithIntString({
2456
2502
  commandType: types_2.CommandType.CMD_BAT_DOORBELL_WDR_SWITCH,
@@ -2473,6 +2519,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2473
2519
  if (!device.hasProperty(propertyData.name)) {
2474
2520
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
2475
2521
  }
2522
+ const property = device.getPropertyMetadata(propertyData.name);
2523
+ (0, utils_3.validValue)(property, value);
2476
2524
  this.log.debug(`Sending floodlight light settings enable command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
2477
2525
  await this.p2pSession.sendCommandWithIntString({
2478
2526
  commandType: types_2.CommandType.CMD_SET_FLOODLIGHT_TOTAL_SWITCH,
@@ -2584,6 +2632,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2584
2632
  if (!device.hasProperty(propertyData.name)) {
2585
2633
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
2586
2634
  }
2635
+ const property = device.getPropertyMetadata(propertyData.name);
2636
+ (0, utils_3.validValue)(property, value);
2587
2637
  this.log.debug(`Sending floodlight light settings motion triggered command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
2588
2638
  if (device.isFloodLight()) {
2589
2639
  await this.p2pSession.sendCommandWithIntString({
@@ -2827,6 +2877,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2827
2877
  name: mode === types_1.NotificationSwitchMode.APP ? types_1.PropertyName.StationNotificationSwitchModeApp : mode === types_1.NotificationSwitchMode.GEOFENCE ? types_1.PropertyName.StationNotificationSwitchModeGeofence : mode === types_1.NotificationSwitchMode.KEYPAD ? types_1.PropertyName.StationNotificationSwitchModeKeypad : mode === types_1.NotificationSwitchMode.SCHEDULE ? types_1.PropertyName.StationNotificationSwitchModeSchedule : "",
2828
2878
  value: value
2829
2879
  };
2880
+ const property = this.getPropertyMetadata(propertyData.name);
2881
+ (0, utils_3.validValue)(property, value);
2830
2882
  this.log.debug(`Sending station notification switch mode command to station ${this.getSerial()} with value: ${value}`);
2831
2883
  if ((0, utils_1.isGreaterEqualMinVersion)("2.1.1.6", this.getSoftwareVersion())) {
2832
2884
  let oldvalue = 0;
@@ -2891,6 +2943,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2891
2943
  catch (error) {
2892
2944
  }
2893
2945
  }
2946
+ const property = this.getPropertyMetadata(propertyData.name);
2947
+ (0, utils_3.validValue)(property, value);
2894
2948
  this.log.debug(`Sending station notification start alarm delay command to station ${this.getSerial()} with value: ${value}`);
2895
2949
  if ((0, utils_1.isGreaterEqualMinVersion)("2.1.1.6", this.getSoftwareVersion())) {
2896
2950
  await this.p2pSession.sendCommandWithStringPayload({
@@ -2960,6 +3014,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2960
3014
  if (!device.hasProperty(propertyData.name)) {
2961
3015
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
2962
3016
  }
3017
+ const property = device.getPropertyMetadata(propertyData.name);
3018
+ (0, utils_3.validValue)(property, value);
2963
3019
  this.log.debug(`Sending rtsp stream command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
2964
3020
  await this.p2pSession.sendCommandWithIntString({
2965
3021
  commandType: types_2.CommandType.CMD_NAS_SWITCH,
@@ -2982,6 +3038,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
2982
3038
  if (!device.hasProperty(propertyData.name)) {
2983
3039
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
2984
3040
  }
3041
+ const property = device.getPropertyMetadata(propertyData.name);
3042
+ (0, utils_3.validValue)(property, value);
2985
3043
  this.log.debug(`Sending antitheft detection command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
2986
3044
  await this.p2pSession.sendCommandWithIntString({
2987
3045
  commandType: types_2.CommandType.CMD_EAS_SWITCH,
@@ -3085,8 +3143,10 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
3085
3143
  if (!device.hasProperty(propertyData.name)) {
3086
3144
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
3087
3145
  }
3146
+ const property = device.getPropertyMetadata(propertyData.name);
3147
+ (0, utils_3.validValue)(property, value);
3088
3148
  let param_value = value === true ? 0 : 1;
3089
- if ((device.isIndoorCamera() && !device.isIndoorCamMini()) || device.isWiredDoorbell() || device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8422 || device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8424)
3149
+ if ((device.isIndoorCamera() && !device.isIndoorCamMini()) || device.isWiredDoorbell() || device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8422 || device.getDeviceType() === types_1.DeviceType.FLOODLIGHT_CAMERA_8424 || device.isFloodLightT8420X())
3090
3150
  param_value = value === true ? 1 : 0;
3091
3151
  this.log.debug(`Sending enable device command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
3092
3152
  if (device.isIndoorCamMini()) {
@@ -3150,7 +3210,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
3150
3210
  command: commandData
3151
3211
  });
3152
3212
  }
3153
- else if (this.getDeviceType() === types_1.DeviceType.STATION && cipher_id !== undefined) {
3213
+ else if (cipher_id !== undefined) {
3154
3214
  const cipher = await this.api.getCipher(cipher_id, this.rawStation.member.admin_user_id);
3155
3215
  if (Object.keys(cipher).length > 0) {
3156
3216
  this.log.debug(`Sending start download command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${path}`);
@@ -3176,6 +3236,17 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
3176
3236
  });
3177
3237
  }
3178
3238
  }
3239
+ else {
3240
+ this.log.warn(`Cancelled download of video "${path}" from Station ${this.getSerial()}, because cipher_id is missing`);
3241
+ this.emit("command result", this, {
3242
+ channel: device.getChannel(),
3243
+ command_type: types_2.CommandType.CMD_DOWNLOAD_VIDEO,
3244
+ return_code: types_2.ErrorCode.ERROR_INVALID_PARAM,
3245
+ customData: {
3246
+ command: commandData
3247
+ }
3248
+ });
3249
+ }
3179
3250
  }
3180
3251
  async cancelDownload(device) {
3181
3252
  const commandData = {
@@ -3230,7 +3301,7 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
3230
3301
  command: commandData
3231
3302
  });
3232
3303
  }
3233
- else if (device.isWiredDoorbell() || (device.isFloodLight() && device.getDeviceType() !== types_1.DeviceType.FLOODLIGHT) || device.isIndoorCamera() || (device.getSerial().startsWith("T8420") && (0, utils_1.isGreaterEqualMinVersion)('2.0.4.8', this.getSoftwareVersion()))) {
3304
+ else if (device.isWiredDoorbell() || (device.isFloodLight() && device.getDeviceType() !== types_1.DeviceType.FLOODLIGHT) || device.isIndoorCamera() || (device.getSerial().startsWith("T8420") && (0, utils_1.isGreaterEqualMinVersion)("2.0.4.8", this.getSoftwareVersion()))) {
3234
3305
  this.log.debug(`Using CMD_DOORBELL_SET_PAYLOAD for station ${this.getSerial()} (main_sw_version: ${this.getSoftwareVersion()})`);
3235
3306
  await this.p2pSession.sendCommandWithStringPayload({
3236
3307
  commandType: types_2.CommandType.CMD_DOORBELL_SET_PAYLOAD,
@@ -3430,6 +3501,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
3430
3501
  if (!device.hasProperty(propertyData.name)) {
3431
3502
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
3432
3503
  }
3504
+ const property = device.getPropertyMetadata(propertyData.name);
3505
+ (0, utils_3.validValue)(property, value);
3433
3506
  this.log.debug(`Sending hdr command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
3434
3507
  if (device.isWiredDoorbell()) {
3435
3508
  await this.p2pSession.sendCommandWithStringPayload({
@@ -3460,6 +3533,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
3460
3533
  if (!device.hasProperty(propertyData.name)) {
3461
3534
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
3462
3535
  }
3536
+ const property = device.getPropertyMetadata(propertyData.name);
3537
+ (0, utils_3.validValue)(property, value);
3463
3538
  this.log.debug(`Sending distortion correction command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
3464
3539
  if (device.isWiredDoorbell()) {
3465
3540
  await this.p2pSession.sendCommandWithStringPayload({
@@ -3522,6 +3597,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
3522
3597
  if (!device.hasProperty(propertyData.name)) {
3523
3598
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
3524
3599
  }
3600
+ const property = device.getPropertyMetadata(propertyData.name);
3601
+ (0, utils_3.validValue)(property, value);
3525
3602
  this.log.debug(`Sending lock device command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
3526
3603
  if (device.isLockBleNoFinger() || device.isLockBle()) {
3527
3604
  const key = (0, utils_2.generateBasicLockAESKey)(this.rawStation.member.admin_user_id, this.getSerial());
@@ -3584,6 +3661,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
3584
3661
  if (!this.hasProperty(propertyData.name)) {
3585
3662
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${this.getSerial()}`);
3586
3663
  }
3664
+ const property = this.getPropertyMetadata(propertyData.name);
3665
+ (0, utils_3.validValue)(property, value);
3587
3666
  this.log.debug(`Sending station switch mode with access code command to station ${this.getSerial()} with value: ${value}`);
3588
3667
  if (this.isStation()) {
3589
3668
  await this.p2pSession.sendCommandWithStringPayload({
@@ -3613,6 +3692,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
3613
3692
  if (!this.hasProperty(propertyData.name)) {
3614
3693
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${this.getSerial()}`);
3615
3694
  }
3695
+ const property = this.getPropertyMetadata(propertyData.name);
3696
+ (0, utils_3.validValue)(property, value);
3616
3697
  this.log.debug(`Sending station auto end alarm command to station ${this.getSerial()} with value: ${value}`);
3617
3698
  if (this.isStation()) {
3618
3699
  await this.p2pSession.sendCommandWithStringPayload({
@@ -3642,6 +3723,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
3642
3723
  if (!this.hasProperty(propertyData.name)) {
3643
3724
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${this.getSerial()}`);
3644
3725
  }
3726
+ const property = this.getPropertyMetadata(propertyData.name);
3727
+ (0, utils_3.validValue)(property, value);
3645
3728
  this.log.debug(`Sending station turn off alarm with button command to station ${this.getSerial()} with value: ${value}`);
3646
3729
  if (this.isStation()) {
3647
3730
  await this.p2pSession.sendCommandWithStringPayload({
@@ -4413,6 +4496,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
4413
4496
  if (!device.hasProperty(propertyData.name)) {
4414
4497
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
4415
4498
  }
4499
+ const property = device.getPropertyMetadata(propertyData.name);
4500
+ (0, utils_3.validValue)(property, value);
4416
4501
  this.log.debug(`Sending loitering detection command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
4417
4502
  if (device.isBatteryDoorbellDual()) {
4418
4503
  await this.p2pSession.sendCommandWithStringPayload({
@@ -4739,6 +4824,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
4739
4824
  if (!device.hasProperty(propertyData.name)) {
4740
4825
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
4741
4826
  }
4827
+ const property = device.getPropertyMetadata(propertyData.name);
4828
+ (0, utils_3.validValue)(property, value);
4742
4829
  this.log.debug(`Sending delivery guard command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
4743
4830
  if (device.isBatteryDoorbellDual() || device.isWiredDoorbellDual()) {
4744
4831
  await this.p2pSession.sendCommandWithStringPayload({
@@ -4773,6 +4860,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
4773
4860
  if (!device.hasProperty(propertyData.name)) {
4774
4861
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
4775
4862
  }
4863
+ const property = device.getPropertyMetadata(propertyData.name);
4864
+ (0, utils_3.validValue)(property, value);
4776
4865
  this.log.debug(`Sending delivery guard package guarding command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
4777
4866
  if (device.isBatteryDoorbellDual() || device.isWiredDoorbellDual()) {
4778
4867
  await this.p2pSession.sendCommandWithStringPayload({
@@ -4890,6 +4979,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
4890
4979
  if (!device.hasProperty(propertyData.name)) {
4891
4980
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
4892
4981
  }
4982
+ const property = device.getPropertyMetadata(propertyData.name);
4983
+ (0, utils_3.validValue)(property, value);
4893
4984
  this.log.debug(`Sending delivery guard uncollected package alert command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
4894
4985
  if (device.isBatteryDoorbellDual() || device.isWiredDoorbellDual()) {
4895
4986
  await this.p2pSession.sendCommandWithStringPayload({
@@ -4959,6 +5050,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
4959
5050
  if (!device.hasProperty(propertyData.name)) {
4960
5051
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
4961
5052
  }
5053
+ const property = device.getPropertyMetadata(propertyData.name);
5054
+ (0, utils_3.validValue)(property, value);
4962
5055
  this.log.debug(`Sending delivery guard package live check assistance command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
4963
5056
  if (device.isBatteryDoorbellDual() || device.isWiredDoorbellDual()) {
4964
5057
  await this.p2pSession.sendCommandWithStringPayload({
@@ -5105,6 +5198,8 @@ class Station extends tiny_typed_emitter_1.TypedEmitter {
5105
5198
  if (!device.hasProperty(propertyData.name)) {
5106
5199
  throw new error_1.NotSupportedError(`This functionality is not implemented or supported by ${device.getSerial()}`);
5107
5200
  }
5201
+ const property = device.getPropertyMetadata(propertyData.name);
5202
+ (0, utils_3.validValue)(property, value);
5108
5203
  this.log.debug(`Sending notification radar detector command to station ${this.getSerial()} for device ${device.getSerial()} with value: ${value}`);
5109
5204
  if (device.isBatteryDoorbellDual()) {
5110
5205
  await this.p2pSession.sendCommandWithStringPayload({