@homebridge-eufy-security/eufy-security-client 3.7.2-dev.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.
Files changed (129) hide show
  1. package/.prettierignore/342/200/216 +8 -0
  2. package/.prettierrc +11 -0
  3. package/LICENSE +21 -0
  4. package/README.md +970 -0
  5. package/build/error.d.ts +138 -0
  6. package/build/error.js +190 -0
  7. package/build/error.js.map +1 -0
  8. package/build/eufysecurity.d.ts +180 -0
  9. package/build/eufysecurity.js +3148 -0
  10. package/build/eufysecurity.js.map +1 -0
  11. package/build/http/api.d.ts +119 -0
  12. package/build/http/api.js +1877 -0
  13. package/build/http/api.js.map +1 -0
  14. package/build/http/cache.d.ts +8 -0
  15. package/build/http/cache.js +34 -0
  16. package/build/http/cache.js.map +1 -0
  17. package/build/http/const.d.ts +8 -0
  18. package/build/http/const.js +3054 -0
  19. package/build/http/const.js.map +1 -0
  20. package/build/http/device.d.ts +490 -0
  21. package/build/http/device.js +5256 -0
  22. package/build/http/device.js.map +1 -0
  23. package/build/http/error.d.ts +73 -0
  24. package/build/http/error.js +101 -0
  25. package/build/http/error.js.map +1 -0
  26. package/build/http/index.d.ts +10 -0
  27. package/build/http/index.js +30 -0
  28. package/build/http/index.js.map +1 -0
  29. package/build/http/interfaces.d.ts +248 -0
  30. package/build/http/interfaces.js +3 -0
  31. package/build/http/interfaces.js.map +1 -0
  32. package/build/http/models.d.ts +608 -0
  33. package/build/http/models.js +3 -0
  34. package/build/http/models.js.map +1 -0
  35. package/build/http/parameter.d.ts +7 -0
  36. package/build/http/parameter.js +119 -0
  37. package/build/http/parameter.js.map +1 -0
  38. package/build/http/station.d.ts +382 -0
  39. package/build/http/station.js +15735 -0
  40. package/build/http/station.js.map +1 -0
  41. package/build/http/types.d.ts +1358 -0
  42. package/build/http/types.js +10333 -0
  43. package/build/http/types.js.map +1 -0
  44. package/build/http/utils.d.ts +89 -0
  45. package/build/http/utils.js +916 -0
  46. package/build/http/utils.js.map +1 -0
  47. package/build/index.d.ts +8 -0
  48. package/build/index.js +29 -0
  49. package/build/index.js.map +1 -0
  50. package/build/interfaces.d.ts +147 -0
  51. package/build/interfaces.js +7 -0
  52. package/build/interfaces.js.map +1 -0
  53. package/build/logging.d.ts +36 -0
  54. package/build/logging.js +119 -0
  55. package/build/logging.js.map +1 -0
  56. package/build/mqtt/interface.d.ts +6 -0
  57. package/build/mqtt/interface.js +3 -0
  58. package/build/mqtt/interface.js.map +1 -0
  59. package/build/mqtt/model.d.ts +24 -0
  60. package/build/mqtt/model.js +3 -0
  61. package/build/mqtt/model.js.map +1 -0
  62. package/build/mqtt/mqtt-eufy.crt +79 -0
  63. package/build/mqtt/proto/lock.proto +33 -0
  64. package/build/mqtt/service.d.ts +28 -0
  65. package/build/mqtt/service.js +196 -0
  66. package/build/mqtt/service.js.map +1 -0
  67. package/build/p2p/ble.d.ts +59 -0
  68. package/build/p2p/ble.js +281 -0
  69. package/build/p2p/ble.js.map +1 -0
  70. package/build/p2p/error.d.ts +49 -0
  71. package/build/p2p/error.js +69 -0
  72. package/build/p2p/error.js.map +1 -0
  73. package/build/p2p/index.d.ts +8 -0
  74. package/build/p2p/index.js +28 -0
  75. package/build/p2p/index.js.map +1 -0
  76. package/build/p2p/interfaces.d.ts +423 -0
  77. package/build/p2p/interfaces.js +3 -0
  78. package/build/p2p/interfaces.js.map +1 -0
  79. package/build/p2p/models.d.ts +295 -0
  80. package/build/p2p/models.js +3 -0
  81. package/build/p2p/models.js.map +1 -0
  82. package/build/p2p/session.d.ts +186 -0
  83. package/build/p2p/session.js +3737 -0
  84. package/build/p2p/session.js.map +1 -0
  85. package/build/p2p/talkback.d.ts +8 -0
  86. package/build/p2p/talkback.js +23 -0
  87. package/build/p2p/talkback.js.map +1 -0
  88. package/build/p2p/types.d.ts +1164 -0
  89. package/build/p2p/types.js +1219 -0
  90. package/build/p2p/types.js.map +1 -0
  91. package/build/p2p/utils.d.ts +72 -0
  92. package/build/p2p/utils.js +865 -0
  93. package/build/p2p/utils.js.map +1 -0
  94. package/build/push/client.d.ts +49 -0
  95. package/build/push/client.js +344 -0
  96. package/build/push/client.js.map +1 -0
  97. package/build/push/error.d.ts +73 -0
  98. package/build/push/error.js +101 -0
  99. package/build/push/error.js.map +1 -0
  100. package/build/push/index.d.ts +6 -0
  101. package/build/push/index.js +26 -0
  102. package/build/push/index.js.map +1 -0
  103. package/build/push/interfaces.d.ts +19 -0
  104. package/build/push/interfaces.js +3 -0
  105. package/build/push/interfaces.js.map +1 -0
  106. package/build/push/models.d.ts +328 -0
  107. package/build/push/models.js +38 -0
  108. package/build/push/models.js.map +1 -0
  109. package/build/push/parser.d.ts +25 -0
  110. package/build/push/parser.js +231 -0
  111. package/build/push/parser.js.map +1 -0
  112. package/build/push/proto/checkin.proto +266 -0
  113. package/build/push/proto/mcs.proto +328 -0
  114. package/build/push/service.d.ts +46 -0
  115. package/build/push/service.js +965 -0
  116. package/build/push/service.js.map +1 -0
  117. package/build/push/types.d.ts +220 -0
  118. package/build/push/types.js +244 -0
  119. package/build/push/types.js.map +1 -0
  120. package/build/push/utils.d.ts +7 -0
  121. package/build/push/utils.js +116 -0
  122. package/build/push/utils.js.map +1 -0
  123. package/build/utils.d.ts +115 -0
  124. package/build/utils.js +438 -0
  125. package/build/utils.js.map +1 -0
  126. package/eslint.config.mts +68 -0
  127. package/jest.config.js +14 -0
  128. package/package.json +85 -0
  129. package/scripts/cut_release.sh +31 -0
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ParameterHelper = void 0;
4
+ const p2p_1 = require("../p2p");
5
+ const utils_1 = require("../p2p/utils");
6
+ const utils_2 = require("../utils");
7
+ const types_1 = require("./types");
8
+ const utils_3 = require("./utils");
9
+ const error_1 = require("../error");
10
+ class ParameterHelper {
11
+ static JSON_PARSE_BASE64_PARAMS = new Set([
12
+ types_1.ParamType.SNOOZE_MODE,
13
+ types_1.ParamType.CAMERA_MOTION_ZONES,
14
+ p2p_1.CommandType.CMD_SET_DOORSENSOR_ALWAYS_OPEN_DELAY,
15
+ p2p_1.CommandType.CMD_SET_DOORSENSOR_ALWAYS_OPEN,
16
+ p2p_1.CommandType.ARM_DELAY_HOME,
17
+ p2p_1.CommandType.ARM_DELAY_AWAY,
18
+ p2p_1.CommandType.ARM_DELAY_CUS1,
19
+ p2p_1.CommandType.ARM_DELAY_CUS2,
20
+ p2p_1.CommandType.ARM_DELAY_CUS3,
21
+ p2p_1.CommandType.ARM_DELAY_OFF,
22
+ p2p_1.CommandType.CELLULAR_INFO,
23
+ p2p_1.CommandType.CMD_WALL_LIGHT_SETTINGS_MANUAL_COLORED_LIGHTING,
24
+ p2p_1.CommandType.CMD_WALL_LIGHT_SETTINGS_SCHEDULE_COLORED_LIGHTING,
25
+ p2p_1.CommandType.CMD_WALL_LIGHT_SETTINGS_COLORED_LIGHTING_COLORS,
26
+ p2p_1.CommandType.CMD_WALL_LIGHT_SETTINGS_DYNAMIC_LIGHTING_THEMES,
27
+ p2p_1.CommandType.CMD_INDOOR_DET_SET_ACTIVE_ZONE,
28
+ p2p_1.CommandType.CMD_SET_PRIVACYPARAM,
29
+ p2p_1.CommandType.CMD_BAT_DOORBELL_VIDEO_QUALITY2,
30
+ p2p_1.CommandType.CMD_BAT_DOORBELL_RECORD_QUALITY2,
31
+ p2p_1.CommandType.CMD_SET_CROSS_TRACKING_CAMERA_LIST,
32
+ p2p_1.CommandType.CMD_SET_CROSS_TRACKING_GROUP_LIST,
33
+ p2p_1.CommandType.CMD_FLOODLIGHT_SET_DETECTION_RANGE_T8425,
34
+ p2p_1.CommandType.CMD_SET_LIGHT_CTRL_BRIGHT_PIR_T8425,
35
+ p2p_1.CommandType.CMD_SET_LIGHT_CTRL_BRIGHT_SCH_T8425,
36
+ ]);
37
+ static JSON_PARSE_PLAIN_PARAMS = new Set([
38
+ p2p_1.CommandType.CMD_BAT_DOORBELL_SET_NOTIFICATION_MODE,
39
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_DETECTION_SENSITIVITY,
40
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_AUTO_RESPONSE,
41
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_PACKAGE_STRAND_TIME,
42
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_RING_AUTO_RESPONSE,
43
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_PACKAGE_GUARD_TIME,
44
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_DISTANCE,
45
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_RADAR_WD_TIME,
46
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_DELIVERY_GUARD_SWITCH,
47
+ p2p_1.CommandType.CMD_DOORBELL_DUAL_PACKAGE_GUARD_VOICE,
48
+ p2p_1.CommandType.CMD_CAMERA_GARAGE_DOOR_SENSORS,
49
+ p2p_1.CommandType.CMD_MOTION_SET_LEAVING_REACTIONS,
50
+ ]);
51
+ static readValue(serialNumber, type, value, log) {
52
+ if (value) {
53
+ // TODO: investigate why the value can be a object
54
+ //
55
+ //if (typeof value !== "string") return value;
56
+ if (typeof value !== "string") {
57
+ log.debug("Watch out for this object! .", {
58
+ value: JSON.stringify(value, null, 2),
59
+ });
60
+ return value;
61
+ }
62
+ if (ParameterHelper.JSON_PARSE_BASE64_PARAMS.has(type)) {
63
+ const parsedValue = (0, utils_2.parseJSON)((0, utils_1.getNullTerminatedString)((0, utils_1.decodeBase64)(value), "utf-8"), log);
64
+ if (parsedValue === undefined) {
65
+ log.debug("Non-parsable parameter value received from eufy cloud. Will be ignored.", {
66
+ serialNumber: serialNumber,
67
+ type: type,
68
+ value: value,
69
+ });
70
+ }
71
+ return parsedValue;
72
+ }
73
+ else if (ParameterHelper.JSON_PARSE_PLAIN_PARAMS.has(type)) {
74
+ const parsedValue = (0, utils_2.parseJSON)(value, log);
75
+ if (parsedValue === undefined) {
76
+ log.debug("Non-parsable parameter value received from eufy cloud. Will be ignored.", {
77
+ serialNumber: serialNumber,
78
+ type: type,
79
+ value: value,
80
+ });
81
+ }
82
+ return parsedValue;
83
+ }
84
+ else if (type === p2p_1.TrackerCommandType.COMMAND_NEW_LOCATION || type === p2p_1.TrackerCommandType.LOCATION_NEW_ADDRESS) {
85
+ try {
86
+ const decrypted = (0, utils_3.decryptTrackerData)(Buffer.from(value, "hex"), Buffer.from(serialNumber));
87
+ if (decrypted !== undefined) {
88
+ return decrypted.toString("utf8").trim();
89
+ }
90
+ }
91
+ catch (err) {
92
+ const error = (0, error_1.ensureError)(err);
93
+ log.debug("Non-parsable parameter value received from eufy cloud. Will be ignored.", {
94
+ serialNumber: serialNumber,
95
+ type: type,
96
+ value: value,
97
+ error: (0, utils_2.getError)(error),
98
+ });
99
+ }
100
+ return "";
101
+ }
102
+ }
103
+ return value;
104
+ }
105
+ static writeValue(type, value) {
106
+ if (value) {
107
+ if (type === types_1.ParamType.SNOOZE_MODE ||
108
+ type === types_1.ParamType.CAMERA_MOTION_ZONES ||
109
+ type === p2p_1.CommandType.CMD_SET_DOORSENSOR_ALWAYS_OPEN_DELAY ||
110
+ type === p2p_1.CommandType.CMD_SET_DOORSENSOR_ALWAYS_OPEN) {
111
+ return Buffer.from(JSON.stringify(value)).toString("base64");
112
+ }
113
+ return value;
114
+ }
115
+ return "";
116
+ }
117
+ }
118
+ exports.ParameterHelper = ParameterHelper;
119
+ //# sourceMappingURL=parameter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parameter.js","sourceRoot":"","sources":["../../src/http/parameter.ts"],"names":[],"mappings":";;;AAEA,gCAAyD;AACzD,wCAAqE;AACrE,oCAA+C;AAC/C,mCAAoC;AACpC,mCAA6C;AAC7C,oCAAuC;AAEvC,MAAa,eAAe;IAClB,MAAM,CAAU,wBAAwB,GAAG,IAAI,GAAG,CAAS;QACjE,iBAAS,CAAC,WAAW;QACrB,iBAAS,CAAC,mBAAmB;QAC7B,iBAAW,CAA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,YAAY,CAAC,CAAC,CAAC;oBAC3F,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;wBAC5B,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;oBAC3C,CAAC;gBACH,CAAC;gBAAC,OAAO,GAAG,EAAE,CAAC;oBACb,MAAM,KAAK,GAAG,IAAA,mBAAW,EAAC,GAAG,CAAC,CAAC;oBAC/B,GAAG,CAAC,KAAK,CAAC,yEAAyE,EAAE;wBACnF,YAAY,EAAE,YAAY;wBAC1B,IAAI,EAAE,IAAI;wBACV,KAAK,EAAE,KAAK;wBACZ,KAAK,EAAE,IAAA,gBAAQ,EAAC,KAAK,CAAC;qBACvB,CAAC,CAAC;gBACL,CAAC;gBACD,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,IAAY,EAAE,KAAa;QAClD,IAAI,KAAK,EAAE,CAAC;YACV,IACE,IAAI,KAAK,iBAAS,CAAC,WAAW;gBAC9B,IAAI,KAAK,iBAAS,CAAC,mBAAmB;gBACtC,IAAI,KAAK,iBAAW,CAAC,oCAAoC;gBACzD,IAAI,KAAK,iBAAW,CAAC,8BAA8B,EACnD,CAAC;gBACD,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YAC/D,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;;AA5GH,0CA6GC"}
@@ -0,0 +1,382 @@
1
+ import { TypedEmitter } from "tiny-typed-emitter";
2
+ import { HTTPApi } from "./api";
3
+ import { AlarmTone, NotificationSwitchMode, DeviceType, FloodlightMotionTriggeredDistance, GuardMode, NotificationType, PowerSource, PropertyName, TimeFormat, CommandName, VideoTypeStoreToNAS, HB3DetectionTypes, WalllightNotificationType, DailyLightingType, MotionActivationMode, LightingActiveMode, SourceType, T8170DetectionTypes, IndoorS350NotificationTypes, SoloCameraDetectionTypes, MotionDetectionRangeType, ViewModeType, FloodlightT8425NotificationTypes, PresetPositionType, IndoorS350DetectionTypes, EufyCamC35DetectionTypes } from "./types";
4
+ import { SnoozeDetail, StationListResponse } from "./models";
5
+ import { IndexedProperty, PropertyMetadataAny, PropertyValue, PropertyValues, RawValues, StationEvents, Schedule } from "./interfaces";
6
+ import { CrossTrackingGroupEntry, DynamicLighting, MotionZone, RGBColor } from "../p2p/interfaces";
7
+ import { CalibrateGarageType, FilterDetectType, FilterEventType, FilterStorageType, P2PConnectionType, PanTiltDirection, VideoCodec, WatermarkSetting1, WatermarkSetting2, WatermarkSetting3, WatermarkSetting4, WatermarkSetting5 } from "../p2p/types";
8
+ import { Device } from "./device";
9
+ import { PushMessage } from "../push/models";
10
+ export declare class Station extends TypedEmitter<StationEvents> {
11
+ private api;
12
+ private rawStation;
13
+ private p2pSession;
14
+ private properties;
15
+ private rawProperties;
16
+ private ready;
17
+ private lockPublicKey;
18
+ private currentDelay;
19
+ private reconnectTimeout?;
20
+ private terminating;
21
+ private p2pConnectionType;
22
+ static readonly CHANNEL: number;
23
+ static readonly CHANNEL_INDOOR: number;
24
+ private pinVerified;
25
+ protected constructor(api: HTTPApi, station: StationListResponse, ipAddress?: string, listeningPort?: number, publicKey?: string, enableEmbeddedPKCS1Support?: boolean);
26
+ protected initializeState(): void;
27
+ initialize(): void;
28
+ static getInstance(api: HTTPApi, stationData: StationListResponse, ipAddress?: string, listeningPort?: number, enableEmbeddedPKCS1Support?: boolean): Promise<Station>;
29
+ getStateID(state: string, level?: number): string;
30
+ getStateChannel(): string;
31
+ getRawStation(): StationListResponse;
32
+ update(station: StationListResponse): void;
33
+ updateProperty(name: string, value: PropertyValue, force?: boolean): boolean;
34
+ updateRawProperties(values: RawValues): void;
35
+ protected handlePropertyChange(metadata: PropertyMetadataAny, oldValue: PropertyValue, newValue: PropertyValue): void;
36
+ updateRawProperty(type: number, value: string, source: SourceType): boolean;
37
+ protected convertRawPropertyValue(property: PropertyMetadataAny, value: string): PropertyValue;
38
+ getPropertyMetadata(name: string, hidden?: boolean): PropertyMetadataAny;
39
+ getPropertyValue(name: string): PropertyValue;
40
+ hasPropertyValue(name: string): boolean;
41
+ getRawProperty(type: number): string | undefined;
42
+ getRawProperties(): RawValues;
43
+ getProperties(): PropertyValues;
44
+ getPropertiesMetadata(hidden?: boolean): IndexedProperty;
45
+ hasProperty(name: string, hidden?: boolean): boolean;
46
+ getCommands(): Array<CommandName>;
47
+ hasCommand(name: CommandName): boolean;
48
+ static getChannel(type: number): number;
49
+ static isStation(type: number): boolean;
50
+ isStation(): boolean;
51
+ static isStationHomeBase2OrOlder(type: number): boolean;
52
+ static isStationHomeBase3(type: number): boolean;
53
+ static isStationHomeBaseMini(type: number): boolean;
54
+ static isStationHomeBase3BySn(sn: string): boolean;
55
+ static isStationHomeBaseMiniBySn(sn: string): boolean;
56
+ isStationHomeBase2OrOlder(): boolean;
57
+ isStationHomeBase3(): boolean;
58
+ isStationHomeBaseMini(): boolean;
59
+ /**
60
+ * Checks if the station is a HomeBase 3 or HomeBase mini for determining if SoloDevices are connected to a supported HomeBase.
61
+ * @returns Returns true, if this is a HomeBase 3 or a HomeBase mini, otherwise false.
62
+ */
63
+ isDeviceControlledByHomeBase(): boolean;
64
+ /**
65
+ * Checks if the station is a HomeBase 3 or HomeBase mini for determining if SoloDevices are connected to a supported HomeBase The check will be done by the given serial number.
66
+ * @param sn The serial of the station to check.
67
+ * @returns Returns true, if this is a HomeBase 3 or a HomeBase mini, otherwise false.
68
+ */
69
+ static isDeviceControlledByHomeBaseBySn(sn: string): boolean;
70
+ isIntegratedDevice(): boolean;
71
+ isP2PConnectableDevice(): boolean;
72
+ getDeviceType(): number;
73
+ getHardwareVersion(): string;
74
+ getMACAddress(): string;
75
+ getModel(): string;
76
+ getName(): string;
77
+ getSerial(): string;
78
+ getSoftwareVersion(): string;
79
+ getIPAddress(): string;
80
+ getLANIPAddress(): PropertyValue;
81
+ getGuardMode(): PropertyValue;
82
+ getCurrentMode(): PropertyValue;
83
+ processPushNotification(message: PushMessage): void;
84
+ isConnected(): boolean;
85
+ close(): void;
86
+ isEnergySavingDevice(): boolean;
87
+ connect(): Promise<void>;
88
+ private onFinishDownload;
89
+ private onStartDownload;
90
+ private onStopLivestream;
91
+ private onErrorLivestream;
92
+ private onStartLivestream;
93
+ private onStopRTSPLivestream;
94
+ private onStartRTSPLivestream;
95
+ private onWifiRssiChanged;
96
+ private onRTSPUrl;
97
+ private onParameter;
98
+ private onAlarmDelay;
99
+ private onAlarmArmed;
100
+ private onAlarmEvent;
101
+ setGuardMode(mode: GuardMode): void;
102
+ getCameraInfo(): void;
103
+ getStorageInfoEx(): void;
104
+ private onAlarmMode;
105
+ private getArmDelay;
106
+ private _getDeviceSerial;
107
+ private _handleCameraInfoParameters;
108
+ private onCameraInfo;
109
+ private onCommandResponse;
110
+ private onSecondaryCommandResponse;
111
+ private onConnect;
112
+ private onDisconnect;
113
+ private onTimeout;
114
+ private getCurrentDelay;
115
+ private resetCurrentDelay;
116
+ private scheduleReconnect;
117
+ rebootHUB(): void;
118
+ setStatusLed(device: Device, value: boolean): void;
119
+ setAutoNightVision(device: Device, value: boolean): void;
120
+ setNightVision(device: Device, value: number): void;
121
+ setMotionDetection(device: Device, value: boolean): void;
122
+ setSoundDetection(device: Device, value: boolean): void;
123
+ setSoundDetectionType(device: Device, value: number): void;
124
+ setSoundDetectionSensitivity(device: Device, value: number): void;
125
+ setPetDetection(device: Device, value: boolean): void;
126
+ panAndTilt(device: Device, direction: PanTiltDirection, command?: number): void;
127
+ switchLight(device: Device, value: boolean): void;
128
+ setMotionDetectionSensitivity(device: Device, value: number): void;
129
+ setMotionDetectionType(device: Device, value: number): void;
130
+ setMotionDetectionTypeHB3(device: Device, type: HB3DetectionTypes | T8170DetectionTypes | SoloCameraDetectionTypes | IndoorS350DetectionTypes | EufyCamC35DetectionTypes, value: boolean): void;
131
+ setMotionZone(device: Device, value: MotionZone): void;
132
+ setMotionTracking(device: Device, value: boolean): void;
133
+ setPanAndTiltRotationSpeed(device: Device, value: number): void;
134
+ setMicMute(device: Device, value: boolean): void;
135
+ setAudioRecording(device: Device, value: boolean): void;
136
+ enableSpeaker(device: Device, value: boolean): void;
137
+ setSpeakerVolume(device: Device, value: number): void;
138
+ setRingtoneVolume(device: Device, value: number): void;
139
+ enableIndoorChime(device: Device, value: boolean): void;
140
+ enableHomebaseChime(device: Device, value: boolean): void;
141
+ setHomebaseChimeRingtoneVolume(device: Device, value: number): void;
142
+ setHomebaseChimeRingtoneType(device: Device, value: number): void;
143
+ setNotificationType(device: Device, value: NotificationType | WalllightNotificationType): void;
144
+ setNotificationPerson(device: Device, value: boolean): void;
145
+ setNotificationPet(device: Device, value: boolean): void;
146
+ setNotificationAllOtherMotion(device: Device, value: boolean): void;
147
+ setNotificationAllSound(device: Device, value: boolean): void;
148
+ setNotificationCrying(device: Device, value: boolean): void;
149
+ setNotificationRing(device: Device, value: boolean): void;
150
+ setNotificationMotion(device: Device, value: boolean): void;
151
+ setPowerSource(device: Device, value: PowerSource): void;
152
+ setPowerWorkingMode(device: Device, value: number): void;
153
+ setRecordingClipLength(device: Device, value: number): void;
154
+ setRecordingRetriggerInterval(device: Device, value: number): void;
155
+ setRecordingEndClipMotionStops(device: Device, value: boolean): void;
156
+ setVideoStreamingQuality(device: Device, value: number): void;
157
+ setVideoRecordingQuality(device: Device, value: number): void;
158
+ setWDR(device: Device, value: boolean): void;
159
+ setFloodlightLightSettingsEnable(device: Device, value: boolean): void;
160
+ setFloodlightLightSettingsBrightnessManual(device: Device, value: number): void;
161
+ setFloodlightLightSettingsBrightnessMotion(device: Device, value: number): void;
162
+ setFloodlightLightSettingsBrightnessSchedule(device: Device, value: number): void;
163
+ setFloodlightLightSettingsMotionTriggered(device: Device, value: boolean): void;
164
+ setFloodlightLightSettingsMotionTriggeredDistance(device: Device, value: FloodlightMotionTriggeredDistance): void;
165
+ setFloodlightLightSettingsMotionTriggeredTimer(device: Device, seconds: number): void;
166
+ triggerStationAlarmSound(seconds: number): void;
167
+ resetStationAlarmSound(): void;
168
+ triggerDeviceAlarmSound(device: Device, seconds: number): void;
169
+ resetDeviceAlarmSound(device: Device): void;
170
+ setStationAlarmRingtoneVolume(value: number): void;
171
+ setStationAlarmTone(value: AlarmTone): void;
172
+ setStationPromptVolume(value: number): void;
173
+ setStationNotificationSwitchMode(mode: NotificationSwitchMode, value: boolean): void;
174
+ setStationNotificationStartAlarmDelay(value: boolean): void;
175
+ setStationTimeFormat(value: TimeFormat): void;
176
+ setRTSPStream(device: Device, value: boolean): void;
177
+ setAntiTheftDetection(device: Device, value: boolean): void;
178
+ setWatermark(device: Device, value: WatermarkSetting1 | WatermarkSetting2 | WatermarkSetting3 | WatermarkSetting4 | WatermarkSetting5): void;
179
+ enableDevice(device: Device, value: boolean): void;
180
+ startDownload(device: Device, path: string, cipher_id?: number): Promise<void>;
181
+ cancelDownload(device: Device): void;
182
+ startLivestream(device: Device, videoCodec?: VideoCodec): void;
183
+ stopLivestream(device: Device): void;
184
+ isLiveStreaming(device: Device): boolean;
185
+ isDownloading(device: Device): boolean;
186
+ quickResponse(device: Device, voice_id: number): void;
187
+ setChirpVolume(device: Device, value: number): void;
188
+ setChirpTone(device: Device, value: number): void;
189
+ setHDR(device: Device, value: boolean): void;
190
+ setDistortionCorrection(device: Device, value: boolean): void;
191
+ setRingRecord(device: Device, value: number): void;
192
+ lockDevice(device: Device, value: boolean): void;
193
+ setStationSwitchModeWithAccessCode(value: boolean): void;
194
+ setStationAutoEndAlarm(value: boolean): void;
195
+ setStationTurnOffAlarmWithButton(value: boolean): void;
196
+ startRTSPStream(device: Device): void;
197
+ stopRTSPStream(device: Device): void;
198
+ setMotionDetectionRange(device: Device, type: MotionDetectionRangeType): void;
199
+ setMotionDetectionRangeStandardSensitivity(device: Device, sensitivity: number): void;
200
+ setMotionDetectionRangeAdvancedLeftSensitivity(device: Device, sensitivity: number): void;
201
+ setMotionDetectionRangeAdvancedMiddleSensitivity(device: Device, sensitivity: number): void;
202
+ setMotionDetectionRangeAdvancedRightSensitivity(device: Device, sensitivity: number): void;
203
+ setMotionDetectionTestMode(device: Device, enabled: boolean): void;
204
+ setMotionTrackingSensitivity(device: Device, sensitivity: number): void;
205
+ setMotionAutoCruise(device: Device, enabled: boolean): void;
206
+ setMotionOutOfViewDetection(device: Device, enabled: boolean): void;
207
+ setLightSettingsColorTemperatureManual(device: Device, value: number): void;
208
+ setLightSettingsColorTemperatureMotion(device: Device, value: number): void;
209
+ setLightSettingsColorTemperatureSchedule(device: Device, value: number): void;
210
+ setLightSettingsMotionActivationMode(device: Device, value: MotionActivationMode): void;
211
+ setVideoNightvisionImageAdjustment(device: Device, enabled: boolean): void;
212
+ setVideoColorNightvision(device: Device, enabled: boolean): void;
213
+ setAutoCalibration(device: Device, enabled: boolean): void;
214
+ isRTSPLiveStreaming(device: Device): boolean;
215
+ setConnectionType(type: P2PConnectionType): void;
216
+ getConnectionType(): P2PConnectionType;
217
+ private onRuntimeState;
218
+ private onChargingState;
219
+ hasDevice(deviceSN: string): boolean;
220
+ hasDeviceWithType(deviceType: DeviceType): boolean;
221
+ private onFloodlightManualSwitch;
222
+ calibrateLock(device: Device): void;
223
+ private convertAdvancedLockSettingValue;
224
+ private convertAdvancedLockSettingValueT8530;
225
+ private getAdvancedLockSettingsPayload;
226
+ private getAdvancedLockSettingsPayloadT8530;
227
+ private getAdvancedLockSettingName;
228
+ private getAdvancedLockSettingNameT8530;
229
+ setAdvancedLockParams(device: Device, property: PropertyName, value: PropertyValue): void;
230
+ setLoiteringDetection(device: Device, value: boolean): void;
231
+ setLoiteringDetectionRange(device: Device, value: number): void;
232
+ setLoiteringDetectionLength(device: Device, value: number): void;
233
+ private _setMotionDetectionSensitivity;
234
+ private _getMotionDetectionSensitivityAdvanced;
235
+ setMotionDetectionSensitivityMode(device: Device, value: number): void;
236
+ setMotionDetectionSensitivityStandard(device: Device, value: number): void;
237
+ setMotionDetectionSensitivityAdvancedA(device: Device, value: number): void;
238
+ setMotionDetectionSensitivityAdvancedB(device: Device, value: number): void;
239
+ setMotionDetectionSensitivityAdvancedC(device: Device, value: number): void;
240
+ setMotionDetectionSensitivityAdvancedD(device: Device, value: number): void;
241
+ setMotionDetectionSensitivityAdvancedE(device: Device, value: number): void;
242
+ setMotionDetectionSensitivityAdvancedF(device: Device, value: number): void;
243
+ setMotionDetectionSensitivityAdvancedG(device: Device, value: number): void;
244
+ setMotionDetectionSensitivityAdvancedH(device: Device, value: number): void;
245
+ private _setLoiteringCustomResponse;
246
+ setLoiteringCustomResponseAutoVoiceResponse(device: Device, value: boolean): void;
247
+ setLoiteringCustomResponseAutoVoiceResponseVoice(device: Device, value: number): void;
248
+ setLoiteringCustomResponseHomeBaseNotification(device: Device, value: boolean): void;
249
+ setLoiteringCustomResponsePhoneNotification(device: Device, value: boolean): void;
250
+ setLoiteringCustomResponseTimeFrom(device: Device, value: string): void;
251
+ setLoiteringCustomResponseTimeTo(device: Device, value: string): void;
252
+ setDeliveryGuard(device: Device, value: boolean): void;
253
+ setDeliveryGuardPackageGuarding(device: Device, value: boolean): void;
254
+ setDeliveryGuardPackageGuardingVoiceResponseVoice(device: Device, value: number): void;
255
+ private setDeliveryGuardPackageGuardingActivatedTime;
256
+ setDeliveryGuardPackageGuardingActivatedTimeFrom(device: Device, value: string): void;
257
+ setDeliveryGuardPackageGuardingActivatedTimeTo(device: Device, value: string): void;
258
+ setDeliveryGuardUncollectedPackageAlert(device: Device, value: boolean): void;
259
+ setDeliveryGuardUncollectedPackageAlertTimeToCheck(device: Device, value: string): void;
260
+ setDeliveryGuardPackageLiveCheckAssistance(device: Device, value: boolean): void;
261
+ setDualCamWatchViewMode(device: Device, value: ViewModeType): void;
262
+ private _setRingAutoResponse;
263
+ setRingAutoResponse(device: Device, value: boolean): void;
264
+ setRingAutoResponseVoiceResponse(device: Device, value: boolean): void;
265
+ setRingAutoResponseVoiceResponseVoice(device: Device, value: number): void;
266
+ setRingAutoResponseTimeFrom(device: Device, value: string): void;
267
+ setRingAutoResponseTimeTo(device: Device, value: string): void;
268
+ setNotificationRadarDetector(device: Device, value: boolean): void;
269
+ calibrate(device: Device): void;
270
+ setContinuousRecording(device: Device, value: boolean): void;
271
+ setContinuousRecordingType(device: Device, value: number): void;
272
+ enableDefaultAngle(device: Device, value: boolean): void;
273
+ setDefaultAngleIdleTime(device: Device, value: number): void;
274
+ setDefaultAngle(device: Device): void;
275
+ setPrivacyAngle(device: Device): void;
276
+ setNotificationIntervalTime(device: Device, value: number): void;
277
+ setSoundDetectionRoundLook(device: Device, value: boolean): void;
278
+ startTalkback(device: Device): void;
279
+ stopTalkback(device: Device): void;
280
+ private onTalkbackStarted;
281
+ private onTalkbackStopped;
282
+ private onTalkbackError;
283
+ isTalkbackOngoing(device: Device): boolean;
284
+ setScramblePasscode(device: Device, value: boolean): void;
285
+ setWrongTryProtection(device: Device, value: boolean): void;
286
+ setWrongTryAttempts(device: Device, value: number): void;
287
+ setWrongTryLockdownTime(device: Device, value: number): void;
288
+ private _sendSmartSafeCommand;
289
+ setSmartSafeParams(device: Device, property: PropertyName, value: PropertyValue): void;
290
+ unlock(device: Device): void;
291
+ verifyPIN(device: Device, pin: string): void;
292
+ private onDeviceShakeAlarm;
293
+ private onDevice911Alarm;
294
+ private onDeviceJammed;
295
+ private onDeviceLowBattery;
296
+ private onDeviceWrongTryProtectAlarm;
297
+ private onSdInfoEx;
298
+ setVideoTypeStoreToNAS(device: Device, value: VideoTypeStoreToNAS): void;
299
+ snooze(device: Device, value: SnoozeDetail): void;
300
+ addUser(device: Device, username: string, shortUserId: string, passcode: string, schedule?: Schedule): void;
301
+ deleteUser(device: Device, username: string, shortUserId: string): void;
302
+ updateUserSchedule(device: Device, username: string, shortUserId: string, schedule: Schedule): void;
303
+ updateUserPasscode(device: Device, username: string, passwordId: string, passcode: string): void;
304
+ setLockV12Params(device: Device, property: PropertyName, value: PropertyValue): void;
305
+ setSmartLockParams(device: Device, property: PropertyName, value: PropertyValue): void;
306
+ setAutoLock(device: Device, value: boolean): void;
307
+ setAutoLockSchedule(device: Device, value: boolean): void;
308
+ setAutoLockScheduleStartTime(device: Device, value: string): void;
309
+ setAutoLockScheduleEndTime(device: Device, value: string): void;
310
+ setAutoLockTimer(device: Device, value: number): void;
311
+ setOneTouchLocking(device: Device, value: boolean): void;
312
+ setSound(device: Device, value: number): void;
313
+ setNotification(device: Device, value: boolean): void;
314
+ setNotificationLocked(device: Device, value: boolean): void;
315
+ setNotificationUnlocked(device: Device, value: boolean): void;
316
+ private _sendLockV12P2PCommand;
317
+ queryAllUserId(device: Device): void;
318
+ chimeHomebase(value: number): void;
319
+ private onImageDownload;
320
+ downloadImage(cover_path: string): void;
321
+ private onTFCardStatus;
322
+ databaseQueryLatestInfo(failureCallback?: () => void): void;
323
+ databaseQueryLocal(serialNumbers: Array<string>, startDate: Date, endDate: Date, eventType?: FilterEventType, detectionType?: FilterDetectType, storageType?: FilterStorageType): void;
324
+ databaseQueryByDate(serialNumbers: Array<string>, startDate: Date, endDate: Date, eventType?: FilterEventType, detectionType?: FilterDetectType, storageType?: FilterStorageType): void;
325
+ databaseDelete(ids: Array<number>): void;
326
+ databaseCountByDate(startDate: Date, endDate: Date): void;
327
+ private onDatabaseQueryLatest;
328
+ private onDatabaseQueryLocal;
329
+ private onDatabaseQueryByDate;
330
+ private onDatabaseCountByDate;
331
+ private onDatabaseDelete;
332
+ private onSensorStatus;
333
+ setMotionDetectionTypeHuman(device: Device, value: boolean): void;
334
+ setMotionDetectionTypeAllOtherMotions(device: Device, value: boolean): void;
335
+ private _setLightSettingsLightingActiveMode;
336
+ setLightSettingsManualLightingActiveMode(device: Device, value: LightingActiveMode): void;
337
+ setLightSettingsManualDailyLighting(device: Device, value: DailyLightingType): void;
338
+ setLightSettingsManualColoredLighting(device: Device, value: RGBColor): void;
339
+ setLightSettingsManualDynamicLighting(device: Device, value: number): void;
340
+ setLightSettingsMotionLightingActiveMode(device: Device, value: LightingActiveMode): void;
341
+ setLightSettingsMotionDailyLighting(device: Device, value: DailyLightingType): void;
342
+ setLightSettingsMotionColoredLighting(device: Device, value: RGBColor): void;
343
+ setLightSettingsMotionDynamicLighting(device: Device, value: number): void;
344
+ setLightSettingsScheduleLightingActiveMode(device: Device, value: LightingActiveMode): void;
345
+ setLightSettingsScheduleDailyLighting(device: Device, value: DailyLightingType): void;
346
+ setLightSettingsScheduleColoredLighting(device: Device, value: RGBColor): void;
347
+ setLightSettingsScheduleDynamicLighting(device: Device, value: number): void;
348
+ setLightSettingsColoredLightingColors(device: Device, value: Array<RGBColor>): void;
349
+ setLightSettingsDynamicLightingThemes(device: Device, value: Array<DynamicLighting>): void;
350
+ setDoorControlWarning(device: Device, value: boolean): void;
351
+ openDoor(device: Device, value: boolean, doorId?: number): void;
352
+ private onGarageDoorStatus;
353
+ calibrateGarageDoor(device: Device, doorId: number, type: CalibrateGarageType): void;
354
+ private onStorageInfoHB3;
355
+ setMirrorMode(device: Device, value: boolean): void;
356
+ setFlickerAdjustment(device: Device, value: number): void;
357
+ setCrossCameraTracking(value: boolean): void;
358
+ setContinuousTrackingTime(value: number): void;
359
+ setTrackingAssistance(value: boolean): void;
360
+ setCrossTrackingCameraList(value: Array<string>): void;
361
+ setCrossTrackingGroupList(value: Array<CrossTrackingGroupEntry>): void;
362
+ setNotificationIndoor(device: Device, type: IndoorS350NotificationTypes, value: boolean): void;
363
+ setNotificationFloodlightT8425(device: Device, type: FloodlightT8425NotificationTypes, value: boolean): void;
364
+ presetPosition(device: Device, position: PresetPositionType): void;
365
+ savePresetPosition(device: Device, position: PresetPositionType): void;
366
+ deletePresetPosition(device: Device, position: PresetPositionType): void;
367
+ setLeavingDetection(device: Device, value: boolean): void;
368
+ private _setLeavingReactions;
369
+ setLeavingReactionNotification(device: Device, value: boolean): void;
370
+ setLeavingReactionStartTime(device: Device, value: string): void;
371
+ setLeavingReactionEndTime(device: Device, value: string): void;
372
+ setBeepVolume(device: Device, value: number): void;
373
+ setNightvisionOptimization(device: Device, value: boolean): void;
374
+ setNightvisionOptimizationSide(device: Device, value: number): void;
375
+ getLockParameters(): void;
376
+ getLockStatus(): void;
377
+ private onSequenceError;
378
+ updateUsername(device: Device, username: string, passwordId: string): void;
379
+ setOpenMethod(device: Device, value: number): void;
380
+ setMotionActivatedPrompt(device: Device, value: boolean): void;
381
+ open(device: Device): void;
382
+ }