@rentlydev/rently-tuya 0.1.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/LICENSE +20 -0
- package/README.md +281 -0
- package/android/build.gradle +182 -0
- package/android/gradle.properties +7 -0
- package/android/libs/airbrake-android-1.4.0.jar +0 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/AndroidManifestNew.xml +25 -0
- package/android/src/main/java/com/rentlytuya/RentlyTuyaModule.kt +503 -0
- package/android/src/main/java/com/rentlytuya/RentlyTuyaPackage.kt +18 -0
- package/android/src/main/java/com/rentlytuya/TuyaActivity.kt +45 -0
- package/android/src/main/java/com/rentlytuya/alerts/FormatSDCardAlert.kt +83 -0
- package/android/src/main/java/com/rentlytuya/alerts/PermissionAlert.kt +91 -0
- package/android/src/main/java/com/rentlytuya/alerts/RemoveDoorbellAlert.kt +83 -0
- package/android/src/main/java/com/rentlytuya/alerts/RemoveDoorbellFailureAlert.kt +71 -0
- package/android/src/main/java/com/rentlytuya/alerts/ResetWifiAlert.kt +83 -0
- package/android/src/main/java/com/rentlytuya/alerts/SuccessAlert.kt +74 -0
- package/android/src/main/java/com/rentlytuya/components/Alert.kt +47 -0
- package/android/src/main/java/com/rentlytuya/components/AnchorButton.kt +125 -0
- package/android/src/main/java/com/rentlytuya/components/Button.kt +147 -0
- package/android/src/main/java/com/rentlytuya/components/CustomDatePicker.kt +275 -0
- package/android/src/main/java/com/rentlytuya/components/Divider.kt +53 -0
- package/android/src/main/java/com/rentlytuya/components/EncryptedImageView.kt +59 -0
- package/android/src/main/java/com/rentlytuya/components/Label.kt +155 -0
- package/android/src/main/java/com/rentlytuya/components/LoadingIndicator.kt +75 -0
- package/android/src/main/java/com/rentlytuya/components/Slider.kt +66 -0
- package/android/src/main/java/com/rentlytuya/components/Switch.kt +51 -0
- package/android/src/main/java/com/rentlytuya/components/VideoView.kt +45 -0
- package/android/src/main/java/com/rentlytuya/dashboard/AdvancedSettings.kt +259 -0
- package/android/src/main/java/com/rentlytuya/dashboard/Dashboard.kt +551 -0
- package/android/src/main/java/com/rentlytuya/dashboard/DoorbellSettings.kt +874 -0
- package/android/src/main/java/com/rentlytuya/dashboard/Messages.kt +463 -0
- package/android/src/main/java/com/rentlytuya/dashboard/NavController.kt +358 -0
- package/android/src/main/java/com/rentlytuya/dashboard/OfflineScreen.kt +160 -0
- package/android/src/main/java/com/rentlytuya/dashboard/Playback.kt +685 -0
- package/android/src/main/java/com/rentlytuya/tuya/Messages.kt +234 -0
- package/android/src/main/java/com/rentlytuya/tuya/Playback.kt +385 -0
- package/android/src/main/java/com/rentlytuya/tuya/ScreenCapture.kt +244 -0
- package/android/src/main/java/com/rentlytuya/tuya/Settings.kt +809 -0
- package/android/src/main/java/com/rentlytuya/tuya/Tuya.kt +497 -0
- package/android/src/main/java/com/rentlytuya/ui/theme/LocalColor.kt +80 -0
- package/android/src/main/java/com/rentlytuya/ui/theme/LocalFont.kt +35 -0
- package/android/src/main/java/com/rentlytuya/ui/theme/Theme.kt +34 -0
- package/android/src/main/java/com/rentlytuya/ui/theme/Type.kt +34 -0
- package/android/src/main/java/com/rentlytuya/util/Airbrake.kt +40 -0
- package/android/src/main/java/com/rentlytuya/util/DpConstants.kt +53 -0
- package/android/src/main/java/com/rentlytuya/util/FrescoManager.kt +86 -0
- package/android/src/main/java/com/rentlytuya/util/HeapAnalytics.kt +16 -0
- package/android/src/main/java/com/rentlytuya/util/KeylessModule.kt +81 -0
- package/android/src/main/java/com/rentlytuya/util/PermissionHandler.kt +75 -0
- package/android/src/main/java/com/rentlytuya/util/ReactParamsCheck.kt +152 -0
- package/android/src/main/java/com/rentlytuya/util/Util.kt +128 -0
- package/android/src/main/res/drawable/ic_close.xml +12 -0
- package/android/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/android/src/main/res/drawable/ic_launcher_foreground.xml +30 -0
- package/android/src/main/res/drawable/img_place_holder.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_action_arrow_backward.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_arrow_backward_white.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_arrow_blue_right.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_calendar.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_camera.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_message.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_pause.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_play.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_play_back.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_record.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_retry.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_setting.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_sound_off.png +0 -0
- package/android/src/main/res/drawable-hdpi/ic_sound_on.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_action_arrow_backward.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_arrow_backward_white.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_arrow_blue_right.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_battery_average.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_battery_charging.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_battery_full.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_battery_good.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_battery_low.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_calendar.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_camera.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_message.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_pause.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_play.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_play_back.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_record.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_retry.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_setting.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_sound_off.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_sound_on.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_action_arrow_backward.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_arrow_backward_white.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_arrow_blue_right.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_battery_average.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_battery_charging.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_battery_full.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_battery_good.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_battery_low.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_calendar.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_camera.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_message.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_pause.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_play.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_play_back.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_record.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_retry.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_setting.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_sound_off.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_sound_on.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_action_arrow_backward.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_arrow_backward_white.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_arrow_blue_right.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_battery_average.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_battery_charging.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_battery_full.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_battery_good.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_battery_low.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_calendar.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_camera.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_message.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_pause.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_play.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_play_back.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_record.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_retry.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_setting.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_sound_off.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_sound_on.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_action_arrow_backward.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_arrow_backward_white.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_arrow_blue_right.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_calendar.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_camera.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_message.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_pause.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_play.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_play_back.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_record.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_retry.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_setting.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_sound_off.png +0 -0
- package/android/src/main/res/drawable-xxxhdpi/ic_sound_on.png +0 -0
- package/android/src/main/res/font/quicksand_bold.ttf +0 -0
- package/android/src/main/res/font/quicksand_light.ttf +0 -0
- package/android/src/main/res/font/quicksand_medium.ttf +0 -0
- package/android/src/main/res/font/quicksand_regular.ttf +0 -0
- package/android/src/main/res/font/quicksand_semi_bold.ttf +0 -0
- package/android/src/main/res/values/strings.xml +121 -0
- package/android/thingMapping.gradle +200 -0
- package/android/thingMapping.json +2014 -0
- package/ios/components/Alert.swift +54 -0
- package/ios/components/AnchorButton.swift +100 -0
- package/ios/components/Button.swift +118 -0
- package/ios/components/CustomDatePicker.swift +275 -0
- package/ios/components/Divider.swift +28 -0
- package/ios/components/Image.swift +72 -0
- package/ios/components/Label.swift +105 -0
- package/ios/components/Switch.swift +61 -0
- package/ios/dashboard/AdvanceSettings.swift +127 -0
- package/ios/dashboard/Dashboard.swift +354 -0
- package/ios/dashboard/Messages.swift +361 -0
- package/ios/dashboard/NavigationController.swift +173 -0
- package/ios/dashboard/OfflineScreen.swift +109 -0
- package/ios/dashboard/Playback.swift +543 -0
- package/ios/dashboard/PreviewManager.swift +117 -0
- package/ios/dashboard/Settings.swift +672 -0
- package/ios/icons/Charging.png +0 -0
- package/ios/icons/Charging@2x.png +0 -0
- package/ios/icons/Charging@3x.png +0 -0
- package/ios/icons/back_arraow.png +0 -0
- package/ios/icons/back_arraow@2x.png +0 -0
- package/ios/icons/back_arraow@3x.png +0 -0
- package/ios/icons/battery_average.png +0 -0
- package/ios/icons/battery_average@2x.png +0 -0
- package/ios/icons/battery_average@3x.png +0 -0
- package/ios/icons/battery_full.png +0 -0
- package/ios/icons/battery_full@2x.png +0 -0
- package/ios/icons/battery_full@3x.png +0 -0
- package/ios/icons/battery_good.png +0 -0
- package/ios/icons/battery_good@2x.png +0 -0
- package/ios/icons/battery_good@3x.png +0 -0
- package/ios/icons/battery_low.png +0 -0
- package/ios/icons/battery_low@2x.png +0 -0
- package/ios/icons/battery_low@3x.png +0 -0
- package/ios/icons/calendar.png +0 -0
- package/ios/icons/calendar@2x.png +0 -0
- package/ios/icons/calendar@3x.png +0 -0
- package/ios/icons/cloud.png +0 -0
- package/ios/icons/cloud@2x.png +0 -0
- package/ios/icons/cloud@3x.png +0 -0
- package/ios/icons/down_update.png +0 -0
- package/ios/icons/down_update@2x.png +0 -0
- package/ios/icons/down_update@3x.png +0 -0
- package/ios/icons/exit_fullscreen.png +0 -0
- package/ios/icons/exit_fullscreen@2x.png +0 -0
- package/ios/icons/exit_fullscreen@3x.png +0 -0
- package/ios/icons/expand.png +0 -0
- package/ios/icons/fullscreen.png +0 -0
- package/ios/icons/fullscreen@2x.png +0 -0
- package/ios/icons/fullscreen@3x.png +0 -0
- package/ios/icons/image_placeholder.png +0 -0
- package/ios/icons/information.png +0 -0
- package/ios/icons/information@2x.png +0 -0
- package/ios/icons/information@3x.png +0 -0
- package/ios/icons/keyless_Setting.png +0 -0
- package/ios/icons/keyless_Setting@2x.png +0 -0
- package/ios/icons/keyless_Setting@3x.png +0 -0
- package/ios/icons/keyless_back@1x.png +0 -0
- package/ios/icons/keyless_back@2x.png +0 -0
- package/ios/icons/keyless_back@3x.png +0 -0
- package/ios/icons/keyless_filter.png +0 -0
- package/ios/icons/keyless_filter@2x.png +0 -0
- package/ios/icons/keyless_filter@3x.png +0 -0
- package/ios/icons/keyless_message.png +0 -0
- package/ios/icons/keyless_message@2x.png +0 -0
- package/ios/icons/keyless_message@3x.png +0 -0
- package/ios/icons/keyless_pause.png +0 -0
- package/ios/icons/keyless_pause@2x.png +0 -0
- package/ios/icons/keyless_pause@3x.png +0 -0
- package/ios/icons/keyless_photo.png +0 -0
- package/ios/icons/keyless_photo@2x.png +0 -0
- package/ios/icons/keyless_photo@3x.png +0 -0
- package/ios/icons/keyless_play.png +0 -0
- package/ios/icons/keyless_play@2x.png +0 -0
- package/ios/icons/keyless_play@3x.png +0 -0
- package/ios/icons/keyless_play_list.png +0 -0
- package/ios/icons/keyless_play_list@2x.png +0 -0
- package/ios/icons/keyless_play_list@3x.png +0 -0
- package/ios/icons/keyless_play_playback.png +0 -0
- package/ios/icons/keyless_play_playback@2x.png +0 -0
- package/ios/icons/keyless_play_playback@3x.png +0 -0
- package/ios/icons/keyless_record.png +0 -0
- package/ios/icons/keyless_record@2x.png +0 -0
- package/ios/icons/keyless_record@3x.png +0 -0
- package/ios/icons/keyless_record_on.png +0 -0
- package/ios/icons/keyless_record_on@2x.png +0 -0
- package/ios/icons/keyless_record_on@3x.png +0 -0
- package/ios/icons/keyless_sound_off.png +0 -0
- package/ios/icons/keyless_sound_off@2x.png +0 -0
- package/ios/icons/keyless_sound_off@3x.png +0 -0
- package/ios/icons/keyless_sound_on.png +0 -0
- package/ios/icons/keyless_sound_on@2x.png +0 -0
- package/ios/icons/keyless_sound_on@3x.png +0 -0
- package/ios/icons/keyless_speak_off.png +0 -0
- package/ios/icons/keyless_speak_off@2x.png +0 -0
- package/ios/icons/keyless_speak_on.png +0 -0
- package/ios/icons/keyless_speak_on@2x.png +0 -0
- package/ios/icons/keyless_speak_on@3x.png +0 -0
- package/ios/icons/refresh.png +0 -0
- package/ios/icons/refresh@2x.png +0 -0
- package/ios/icons/refresh@3x.png +0 -0
- package/ios/icons/ty_camera_control_hd_normal@2x.png +0 -0
- package/ios/icons/ty_camera_control_hd_normal@3x.png +0 -0
- package/ios/icons/ty_camera_control_sd_normal@2x.png +0 -0
- package/ios/icons/ty_camera_control_sd_normal@3x.png +0 -0
- package/ios/icons/upgrade_success.png +0 -0
- package/ios/icons/upgrade_success@2x.png +0 -0
- package/ios/icons/upgrade_success@3x.png +0 -0
- package/ios/listener/KeylessListener.m +8 -0
- package/ios/listener/KeylessListener.swift +56 -0
- package/ios/listener/RentlyTuya-Bridging-Header.h +5 -0
- package/ios/listener/RentlyTuya.mm +56 -0
- package/ios/listener/RentlyTuya.swift +544 -0
- package/ios/theme/LocalColor.swift +33 -0
- package/ios/theme/LocalFont.swift +32 -0
- package/ios/theme/Theme.swift +71 -0
- package/ios/tuya/CameraManager.swift +296 -0
- package/ios/tuya/SettingsManager.swift +475 -0
- package/ios/tuya/Tuya.swift +570 -0
- package/ios/tuya/TuyaMessages.swift +98 -0
- package/ios/utils/Airbrake.swift +31 -0
- package/ios/utils/AppUtility.swift +76 -0
- package/ios/utils/HeapAnalytics.swift +8 -0
- package/ios/utils/OrientationManager.swift +60 -0
- package/ios/utils/PromiseHandler.swift +36 -0
- package/lib/commonjs/index.js +90 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/index.js +83 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +75 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/index.d.ts +75 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/package.json +188 -0
- package/rently-tuya.podspec +52 -0
- package/src/index.tsx +158 -0
@@ -0,0 +1,76 @@
|
|
1
|
+
import UIKit
|
2
|
+
|
3
|
+
struct AppUtility {
|
4
|
+
|
5
|
+
static var shouldClose: Bool = false
|
6
|
+
|
7
|
+
static func disconnectAndClose() {
|
8
|
+
self.shouldClose = true
|
9
|
+
Tuya.shared.disconnect()
|
10
|
+
}
|
11
|
+
|
12
|
+
static func dismissRootViewController() {
|
13
|
+
guard let rootVC = UIApplication.shared.windows.first?.rootViewController else {
|
14
|
+
print("Tuya: No root view controller found to dismiss.")
|
15
|
+
return
|
16
|
+
}
|
17
|
+
|
18
|
+
rootVC.dismiss(animated: true, completion: nil)
|
19
|
+
|
20
|
+
self.shouldClose = false
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
struct DateUtil {
|
25
|
+
static let shared = DateUtil()
|
26
|
+
|
27
|
+
func convertToEpoch(isoDateString: String) -> Int {
|
28
|
+
let formatter = ISO8601DateFormatter()
|
29
|
+
formatter.formatOptions = [.withInternetDateTime]
|
30
|
+
formatter.timeZone = TimeZone(secondsFromGMT: 0)
|
31
|
+
|
32
|
+
if let date = formatter.date(from: isoDateString) {
|
33
|
+
return Int(date.timeIntervalSince1970)
|
34
|
+
} else {
|
35
|
+
return oneYearBackTimestamp()
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
func getStartOfDay(from date: Date) -> Date {
|
40
|
+
let calendar = Calendar.current
|
41
|
+
let startOfDay = calendar.startOfDay(for: date)
|
42
|
+
|
43
|
+
return startOfDay
|
44
|
+
}
|
45
|
+
|
46
|
+
func oneYearBackTimestamp() -> Int {
|
47
|
+
if let oneYearBackDate = Calendar.current.date(byAdding: .year, value: -1, to: Date()) {
|
48
|
+
return Int(oneYearBackDate.timeIntervalSince1970)
|
49
|
+
} else {
|
50
|
+
print("Tuya: Failed to calculate one year back date")
|
51
|
+
return 0
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
func updateAlertBackgroundColor() {
|
57
|
+
DispatchQueue.main.async {
|
58
|
+
if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
|
59
|
+
let keyWindow = scene.windows.first(where: { $0.isKeyWindow }),
|
60
|
+
let rootVC = keyWindow.rootViewController {
|
61
|
+
|
62
|
+
keyWindow.overrideUserInterfaceStyle = .light // Force light mode
|
63
|
+
|
64
|
+
for subview in rootVC.view.subviews {
|
65
|
+
for innerSubview in subview.subviews {
|
66
|
+
if let visualEffectView = innerSubview as? UIVisualEffectView {
|
67
|
+
visualEffectView.backgroundColor = .white
|
68
|
+
visualEffectView.effect = nil
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
72
|
+
} else {
|
73
|
+
print("Tuya: Could not find key window or rootViewController")
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import SwiftUI
|
2
|
+
import Combine
|
3
|
+
|
4
|
+
class OrientationManager: ObservableObject {
|
5
|
+
@Published var isLandscape: Bool = false
|
6
|
+
private var cancellables = Set<AnyCancellable>()
|
7
|
+
static let orientationDidChangeNotification = Notification.Name("OrientationDidChange")
|
8
|
+
|
9
|
+
init() {
|
10
|
+
UIDevice.current.beginGeneratingDeviceOrientationNotifications()
|
11
|
+
print("Tuya: Device orientation notifications started.")
|
12
|
+
|
13
|
+
NotificationCenter.default.publisher(for: UIDevice.orientationDidChangeNotification)
|
14
|
+
.sink { [weak self] _ in self?.updateOrientationFlag() }
|
15
|
+
.store(in: &cancellables)
|
16
|
+
|
17
|
+
NotificationCenter.default.publisher(for: UIApplication.willEnterForegroundNotification)
|
18
|
+
.sink { [weak self] _ in self?.updateOrientationFlag() }
|
19
|
+
.store(in: &cancellables)
|
20
|
+
|
21
|
+
updateOrientationFlag()
|
22
|
+
}
|
23
|
+
|
24
|
+
deinit {
|
25
|
+
UIDevice.current.endGeneratingDeviceOrientationNotifications()
|
26
|
+
cancellables.removeAll()
|
27
|
+
}
|
28
|
+
|
29
|
+
func updateOrientationFlag() {
|
30
|
+
let orientation = UIDevice.current.orientation
|
31
|
+
print("Tuya: Current device orientation is \(orientation.rawValue)")
|
32
|
+
|
33
|
+
if orientation.isLandscape {
|
34
|
+
isLandscape = true
|
35
|
+
} else if orientation.isPortrait {
|
36
|
+
isLandscape = false
|
37
|
+
} else if orientation == .unknown {
|
38
|
+
updateOrientationBasedOnScreen()
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
private func updateOrientationBasedOnScreen() {
|
43
|
+
let screenSize = UIScreen.main.bounds.size
|
44
|
+
isLandscape = screenSize.width > screenSize.height
|
45
|
+
print("Tuya: Screen dimensions indicate \(isLandscape ? "landscape" : "portrait") mode.")
|
46
|
+
}
|
47
|
+
|
48
|
+
public func toggleOrientation() {
|
49
|
+
guard #available(iOS 16.0, *), let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene else {
|
50
|
+
print("Tuya: Orientation change not supported on iOS 14 and earlier.")
|
51
|
+
return
|
52
|
+
}
|
53
|
+
|
54
|
+
let newOrientation: UIInterfaceOrientationMask = isLandscape ? .portrait : .landscapeRight
|
55
|
+
windowScene.requestGeometryUpdate(.iOS(interfaceOrientations: newOrientation))
|
56
|
+
isLandscape.toggle()
|
57
|
+
|
58
|
+
NotificationCenter.default.post(name: OrientationManager.orientationDidChangeNotification, object: nil)
|
59
|
+
}
|
60
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
class PromiseHandler {
|
2
|
+
|
3
|
+
static let shared = PromiseHandler()
|
4
|
+
private var resolverMap: [String: RCTPromiseResolveBlock] = [:]
|
5
|
+
private var rejecterMap: [String: RCTPromiseRejectBlock] = [:]
|
6
|
+
private init() {}
|
7
|
+
|
8
|
+
func setPromiseHandlers(for operation: String, resolver: @escaping RCTPromiseResolveBlock, rejecter: @escaping RCTPromiseRejectBlock) {
|
9
|
+
resolverMap[operation] = resolver
|
10
|
+
rejecterMap[operation] = rejecter
|
11
|
+
}
|
12
|
+
|
13
|
+
func resolve(_ operation: String, _ result: Any?) {
|
14
|
+
if let resolver = resolverMap[operation] {
|
15
|
+
resolver(result)
|
16
|
+
clearHandlers(for: operation)
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
func reject(_ operation: String, _ code: String, _ message: String, _ error: Error? = nil) {
|
21
|
+
if let rejecter = rejecterMap[operation] {
|
22
|
+
rejecter(code, message, error)
|
23
|
+
clearHandlers(for: operation)
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
private func clearHandlers(for operation: String) {
|
28
|
+
resolverMap.removeValue(forKey: operation)
|
29
|
+
rejecterMap.removeValue(forKey: operation)
|
30
|
+
}
|
31
|
+
|
32
|
+
func clearAllHandlers() {
|
33
|
+
resolverMap.removeAll()
|
34
|
+
rejecterMap.removeAll()
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,90 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.setTuyaHome = exports.resetDevice = exports.renameDevice = exports.registerForPushNotification = exports.openCameraLivePreview = exports.logout = exports.loginWithUid = exports.initAirbrake = exports.initActivatorForQRCode = exports.getTokenForQRCode = exports.getDeviceData = exports.getCurrentWifi = void 0;
|
7
|
+
var _reactNative = require("react-native");
|
8
|
+
const LINKING_ERROR = `The package 'rently-tuya' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
9
|
+
ios: "- You have run 'pod install'\n",
|
10
|
+
default: ''
|
11
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
12
|
+
const RentlyTuya = _reactNative.NativeModules.RentlyTuya ? _reactNative.NativeModules.RentlyTuya : new Proxy({}, {
|
13
|
+
get() {
|
14
|
+
throw new Error(LINKING_ERROR);
|
15
|
+
}
|
16
|
+
});
|
17
|
+
|
18
|
+
// Init Airbrake
|
19
|
+
|
20
|
+
const initAirbrake = params => {
|
21
|
+
return RentlyTuya.initAirbrake(params);
|
22
|
+
};
|
23
|
+
|
24
|
+
// Get Current Wi-Fi
|
25
|
+
exports.initAirbrake = initAirbrake;
|
26
|
+
const getCurrentWifi = () => {
|
27
|
+
return RentlyTuya.getCurrentWifi();
|
28
|
+
};
|
29
|
+
|
30
|
+
// Get Device Details
|
31
|
+
exports.getCurrentWifi = getCurrentWifi;
|
32
|
+
const getDeviceData = params => {
|
33
|
+
return RentlyTuya.getDeviceData(params);
|
34
|
+
};
|
35
|
+
|
36
|
+
// Get Home Details
|
37
|
+
exports.getDeviceData = getDeviceData;
|
38
|
+
const setTuyaHome = params => {
|
39
|
+
return RentlyTuya.setTuyaHome(params);
|
40
|
+
};
|
41
|
+
|
42
|
+
// Get Token for generating the QR Code
|
43
|
+
exports.setTuyaHome = setTuyaHome;
|
44
|
+
const getTokenForQRCode = async params => {
|
45
|
+
return RentlyTuya.getTokenForQRCode(params);
|
46
|
+
};
|
47
|
+
|
48
|
+
// Start pairing the device
|
49
|
+
exports.getTokenForQRCode = getTokenForQRCode;
|
50
|
+
const initActivatorForQRCode = params => {
|
51
|
+
return RentlyTuya.initActivatorForQRCode(params);
|
52
|
+
};
|
53
|
+
|
54
|
+
// Tuya login
|
55
|
+
exports.initActivatorForQRCode = initActivatorForQRCode;
|
56
|
+
const loginWithUid = params => {
|
57
|
+
return RentlyTuya.loginWithUid(params);
|
58
|
+
};
|
59
|
+
|
60
|
+
// Tuya logout
|
61
|
+
exports.loginWithUid = loginWithUid;
|
62
|
+
const logout = async () => {
|
63
|
+
return RentlyTuya.logout();
|
64
|
+
};
|
65
|
+
|
66
|
+
// Open Preview Screen
|
67
|
+
exports.logout = logout;
|
68
|
+
const openCameraLivePreview = params => {
|
69
|
+
return RentlyTuya.openCameraLivePreview(params);
|
70
|
+
};
|
71
|
+
|
72
|
+
// Register for push notifications
|
73
|
+
exports.openCameraLivePreview = openCameraLivePreview;
|
74
|
+
const registerForPushNotification = params => {
|
75
|
+
return RentlyTuya.registerForPushNotification(params);
|
76
|
+
};
|
77
|
+
|
78
|
+
// Rename Device
|
79
|
+
exports.registerForPushNotification = registerForPushNotification;
|
80
|
+
const renameDevice = params => {
|
81
|
+
return RentlyTuya.renameDevice(params);
|
82
|
+
};
|
83
|
+
|
84
|
+
// Reset Device
|
85
|
+
exports.renameDevice = renameDevice;
|
86
|
+
const resetDevice = params => {
|
87
|
+
return RentlyTuya.resetDevice(params);
|
88
|
+
};
|
89
|
+
exports.resetDevice = resetDevice;
|
90
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_reactNative","require","LINKING_ERROR","Platform","select","ios","default","RentlyTuya","NativeModules","Proxy","get","Error","initAirbrake","params","exports","getCurrentWifi","getDeviceData","setTuyaHome","getTokenForQRCode","initActivatorForQRCode","loginWithUid","logout","openCameraLivePreview","registerForPushNotification","renameDevice","resetDevice"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,MAAMC,aAAa,GACjB,sEAAsE,GACtEC,qBAAQ,CAACC,MAAM,CAAC;EAAEC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IAAmB;EAC/D,OAAON,UAAU,CAACa,YAAY,CAACP,MAAM,CAAC;AACxC,CAAC;;AAED;AAAAC,OAAA,CAAAM,YAAA,GAAAA,YAAA;AACO,MAAMC,MAAM,GAAG,MAAAA,CAAA,KAA0B;EAC9C,OAAOd,UAAU,CAACc,MAAM,CAAC,CAAC;AAC5B,CAAC;;AAED;AAAAP,OAAA,CAAAO,MAAA,GAAAA,MAAA;AA0BO,MAAMC,qBAAqB,GAChCT,MAAiC,IAChB;EACjB,OAAON,UAAU,CAACe,qBAAqB,CAACT,MAAM,CAAC;AACjD,CAAC;;AAED;AAAAC,OAAA,CAAAQ,qBAAA,GAAAA,qBAAA;AAKO,MAAMC,2BAA2B,GACtCV,MAAuC,IACtB;EACjB,OAAON,UAAU,CAACgB,2BAA2B,CAACV,MAAM,CAAC;AACvD,CAAC;;AAED;AAAAC,OAAA,CAAAS,2BAAA,GAAAA,2BAAA;AAMO,MAAMC,YAAY,GAAIX,MAAwB,IAAmB;EACtE,OAAON,UAAU,CAACiB,YAAY,CAACX,MAAM,CAAC;AACxC,CAAC;;AAED;AAAAC,OAAA,CAAAU,YAAA,GAAAA,YAAA;AASO,MAAMC,WAAW,GAAIZ,MAAuB,IAAmB;EACpE,OAAON,UAAU,CAACkB,WAAW,CAACZ,MAAM,CAAC;AACvC,CAAC;AAACC,OAAA,CAAAW,WAAA,GAAAA,WAAA","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"type":"commonjs"}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
import { NativeModules, Platform } from 'react-native';
|
4
|
+
const LINKING_ERROR = `The package 'rently-tuya' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
5
|
+
ios: "- You have run 'pod install'\n",
|
6
|
+
default: ''
|
7
|
+
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
8
|
+
const RentlyTuya = NativeModules.RentlyTuya ? NativeModules.RentlyTuya : new Proxy({}, {
|
9
|
+
get() {
|
10
|
+
throw new Error(LINKING_ERROR);
|
11
|
+
}
|
12
|
+
});
|
13
|
+
|
14
|
+
// Init Airbrake
|
15
|
+
|
16
|
+
export const initAirbrake = params => {
|
17
|
+
return RentlyTuya.initAirbrake(params);
|
18
|
+
};
|
19
|
+
|
20
|
+
// Get Current Wi-Fi
|
21
|
+
export const getCurrentWifi = () => {
|
22
|
+
return RentlyTuya.getCurrentWifi();
|
23
|
+
};
|
24
|
+
|
25
|
+
// Get Device Details
|
26
|
+
|
27
|
+
export const getDeviceData = params => {
|
28
|
+
return RentlyTuya.getDeviceData(params);
|
29
|
+
};
|
30
|
+
|
31
|
+
// Get Home Details
|
32
|
+
|
33
|
+
export const setTuyaHome = params => {
|
34
|
+
return RentlyTuya.setTuyaHome(params);
|
35
|
+
};
|
36
|
+
|
37
|
+
// Get Token for generating the QR Code
|
38
|
+
|
39
|
+
export const getTokenForQRCode = async params => {
|
40
|
+
return RentlyTuya.getTokenForQRCode(params);
|
41
|
+
};
|
42
|
+
|
43
|
+
// Start pairing the device
|
44
|
+
|
45
|
+
export const initActivatorForQRCode = params => {
|
46
|
+
return RentlyTuya.initActivatorForQRCode(params);
|
47
|
+
};
|
48
|
+
|
49
|
+
// Tuya login
|
50
|
+
|
51
|
+
export const loginWithUid = params => {
|
52
|
+
return RentlyTuya.loginWithUid(params);
|
53
|
+
};
|
54
|
+
|
55
|
+
// Tuya logout
|
56
|
+
export const logout = async () => {
|
57
|
+
return RentlyTuya.logout();
|
58
|
+
};
|
59
|
+
|
60
|
+
// Open Preview Screen
|
61
|
+
|
62
|
+
export const openCameraLivePreview = params => {
|
63
|
+
return RentlyTuya.openCameraLivePreview(params);
|
64
|
+
};
|
65
|
+
|
66
|
+
// Register for push notifications
|
67
|
+
|
68
|
+
export const registerForPushNotification = params => {
|
69
|
+
return RentlyTuya.registerForPushNotification(params);
|
70
|
+
};
|
71
|
+
|
72
|
+
// Rename Device
|
73
|
+
|
74
|
+
export const renameDevice = params => {
|
75
|
+
return RentlyTuya.renameDevice(params);
|
76
|
+
};
|
77
|
+
|
78
|
+
// Reset Device
|
79
|
+
|
80
|
+
export const resetDevice = params => {
|
81
|
+
return RentlyTuya.resetDevice(params);
|
82
|
+
};
|
83
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","LINKING_ERROR","select","ios","default","RentlyTuya","Proxy","get","Error","initAirbrake","params","getCurrentWifi","getDeviceData","setTuyaHome","getTokenForQRCode","initActivatorForQRCode","loginWithUid","logout","openCameraLivePreview","registerForPushNotification","renameDevice","resetDevice"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAEtD,MAAMC,aAAa,GACjB,sEAAsE,GACtED,QAAQ,CAACE,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,UAAU,GAAGN,aAAa,CAACM,UAAU,GACvCN,aAAa,CAACM,UAAU,GACxB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CAAC;;AAEL;;AAMA,OAAO,MAAMQ,YAAY,GAAIC,MAAwB,IAAmB;EACtE,OAAOL,UAAU,CAACI,YAAY,CAACC,MAAM,CAAC;AACxC,CAAC;;AAED;AACA,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAAoB;EAChD,OAAON,UAAU,CAACM,cAAc,CAAC,CAAC;AACpC,CAAC;;AAED;;AAKA,OAAO,MAAMC,aAAa,GAAIF,MAAyB,IAAmB;EACxE,OAAOL,UAAU,CAACO,aAAa,CAACF,MAAM,CAAC;AACzC,CAAC;;AAED;;AAKA,OAAO,MAAMG,WAAW,GAAIH,MAAuB,IAAmB;EACpE,OAAOL,UAAU,CAACQ,WAAW,CAACH,MAAM,CAAC;AACvC,CAAC;;AAED;;AAKA,OAAO,MAAMI,iBAAiB,GAAG,MAC/BJ,MAA6B,IACZ;EACjB,OAAOL,UAAU,CAACS,iBAAiB,CAACJ,MAAM,CAAC;AAC7C,CAAC;;AAED;;AAQA,OAAO,MAAMK,sBAAsB,GACjCL,MAAkC,IACjB;EACjB,OAAOL,UAAU,CAACU,sBAAsB,CAACL,MAAM,CAAC;AAClD,CAAC;;AAED;;AAOA,OAAO,MAAMM,YAAY,GAAIN,MAAiB,IAAmB;EAC/D,OAAOL,UAAU,CAACW,YAAY,CAACN,MAAM,CAAC;AACxC,CAAC;;AAED;AACA,OAAO,MAAMO,MAAM,GAAG,MAAAA,CAAA,KAA0B;EAC9C,OAAOZ,UAAU,CAACY,MAAM,CAAC,CAAC;AAC5B,CAAC;;AAED;;AA0BA,OAAO,MAAMC,qBAAqB,GAChCR,MAAiC,IAChB;EACjB,OAAOL,UAAU,CAACa,qBAAqB,CAACR,MAAM,CAAC;AACjD,CAAC;;AAED;;AAKA,OAAO,MAAMS,2BAA2B,GACtCT,MAAuC,IACtB;EACjB,OAAOL,UAAU,CAACc,2BAA2B,CAACT,MAAM,CAAC;AACvD,CAAC;;AAED;;AAMA,OAAO,MAAMU,YAAY,GAAIV,MAAwB,IAAmB;EACtE,OAAOL,UAAU,CAACe,YAAY,CAACV,MAAM,CAAC;AACxC,CAAC;;AAED;;AASA,OAAO,MAAMW,WAAW,GAAIX,MAAuB,IAAmB;EACpE,OAAOL,UAAU,CAACgB,WAAW,CAACX,MAAM,CAAC;AACvC,CAAC","ignoreList":[]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"type":"module"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"type":"commonjs"}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
export type initAirbrakeType = {
|
2
|
+
key: string;
|
3
|
+
id: string;
|
4
|
+
};
|
5
|
+
export declare const initAirbrake: (params: initAirbrakeType) => Promise<any>;
|
6
|
+
export declare const getCurrentWifi: () => Promise<any>;
|
7
|
+
export type getDeviceDataType = {
|
8
|
+
devId: string;
|
9
|
+
};
|
10
|
+
export declare const getDeviceData: (params: getDeviceDataType) => Promise<any>;
|
11
|
+
export type setTuyaHomeType = {
|
12
|
+
homeId: string;
|
13
|
+
};
|
14
|
+
export declare const setTuyaHome: (params: setTuyaHomeType) => Promise<any>;
|
15
|
+
export type getTokenForQRCodeType = {
|
16
|
+
homeId: string;
|
17
|
+
};
|
18
|
+
export declare const getTokenForQRCode: (params: getTokenForQRCodeType) => Promise<any>;
|
19
|
+
export type initActivatorForQRCodeType = {
|
20
|
+
ssid: string;
|
21
|
+
password: string;
|
22
|
+
time: string;
|
23
|
+
token: string;
|
24
|
+
};
|
25
|
+
export declare const initActivatorForQRCode: (params: initActivatorForQRCodeType) => Promise<any>;
|
26
|
+
export type loginType = {
|
27
|
+
uid: string;
|
28
|
+
password: string;
|
29
|
+
countryCode: string;
|
30
|
+
};
|
31
|
+
export declare const loginWithUid: (params: loginType) => Promise<any>;
|
32
|
+
export declare const logout: () => Promise<any>;
|
33
|
+
export type openCameraLivePreviewType = {
|
34
|
+
id: string;
|
35
|
+
countryCode: string;
|
36
|
+
uid: string;
|
37
|
+
passwd: string;
|
38
|
+
devId: string;
|
39
|
+
homeId: string;
|
40
|
+
last_moveout_at: string;
|
41
|
+
resetRequired: boolean;
|
42
|
+
options: any;
|
43
|
+
isResident: boolean;
|
44
|
+
display_remove_doorbell_button: boolean;
|
45
|
+
propertyCredentialUsername: string;
|
46
|
+
propertyCredentialPassword: string;
|
47
|
+
tuya_product_name: string;
|
48
|
+
device_uuid: string;
|
49
|
+
serial_no: string;
|
50
|
+
flavour: string;
|
51
|
+
doorbell_default_settings_updated: boolean;
|
52
|
+
motion_detection: boolean;
|
53
|
+
continuous_recording: boolean;
|
54
|
+
event_recording: boolean;
|
55
|
+
set_sensitivity_low: boolean;
|
56
|
+
};
|
57
|
+
export declare const openCameraLivePreview: (params: openCameraLivePreviewType) => Promise<any>;
|
58
|
+
export type registerForPushNotificationType = {
|
59
|
+
token: string;
|
60
|
+
};
|
61
|
+
export declare const registerForPushNotification: (params: registerForPushNotificationType) => Promise<any>;
|
62
|
+
export type renameDeviceType = {
|
63
|
+
deviceId: string;
|
64
|
+
name: string;
|
65
|
+
};
|
66
|
+
export declare const renameDevice: (params: renameDeviceType) => Promise<any>;
|
67
|
+
export type resetDeviceType = {
|
68
|
+
devId: string;
|
69
|
+
homeId: string;
|
70
|
+
username: string;
|
71
|
+
password: string;
|
72
|
+
countryCode: string;
|
73
|
+
};
|
74
|
+
export declare const resetDevice: (params: resetDeviceType) => Promise<any>;
|
75
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAoBA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,YAAY,WAAY,gBAAgB,KAAG,OAAO,CAAC,GAAG,CAElE,CAAC;AAGF,eAAO,MAAM,cAAc,QAAO,OAAO,CAAC,GAAG,CAE5C,CAAC;AAGF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,iBAAiB,KAAG,OAAO,CAAC,GAAG,CAEpE,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,WAAW,WAAY,eAAe,KAAG,OAAO,CAAC,GAAG,CAEhE,CAAC;AAGF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,iBAAiB,WACpB,qBAA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B,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,WACxB,yBAAyB,KAChC,OAAO,CAAC,GAAG,CAEb,CAAC;AAGF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,2BAA2B,WAC9B,+BAA+B,KACtC,OAAO,CAAC,GAAG,CAEb,CAAC;AAGF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,YAAY,WAAY,gBAAgB,KAAG,OAAO,CAAC,GAAG,CAElE,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,WAAW,WAAY,eAAe,KAAG,OAAO,CAAC,GAAG,CAEhE,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"type":"module"}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
export type initAirbrakeType = {
|
2
|
+
key: string;
|
3
|
+
id: string;
|
4
|
+
};
|
5
|
+
export declare const initAirbrake: (params: initAirbrakeType) => Promise<any>;
|
6
|
+
export declare const getCurrentWifi: () => Promise<any>;
|
7
|
+
export type getDeviceDataType = {
|
8
|
+
devId: string;
|
9
|
+
};
|
10
|
+
export declare const getDeviceData: (params: getDeviceDataType) => Promise<any>;
|
11
|
+
export type setTuyaHomeType = {
|
12
|
+
homeId: string;
|
13
|
+
};
|
14
|
+
export declare const setTuyaHome: (params: setTuyaHomeType) => Promise<any>;
|
15
|
+
export type getTokenForQRCodeType = {
|
16
|
+
homeId: string;
|
17
|
+
};
|
18
|
+
export declare const getTokenForQRCode: (params: getTokenForQRCodeType) => Promise<any>;
|
19
|
+
export type initActivatorForQRCodeType = {
|
20
|
+
ssid: string;
|
21
|
+
password: string;
|
22
|
+
time: string;
|
23
|
+
token: string;
|
24
|
+
};
|
25
|
+
export declare const initActivatorForQRCode: (params: initActivatorForQRCodeType) => Promise<any>;
|
26
|
+
export type loginType = {
|
27
|
+
uid: string;
|
28
|
+
password: string;
|
29
|
+
countryCode: string;
|
30
|
+
};
|
31
|
+
export declare const loginWithUid: (params: loginType) => Promise<any>;
|
32
|
+
export declare const logout: () => Promise<any>;
|
33
|
+
export type openCameraLivePreviewType = {
|
34
|
+
id: string;
|
35
|
+
countryCode: string;
|
36
|
+
uid: string;
|
37
|
+
passwd: string;
|
38
|
+
devId: string;
|
39
|
+
homeId: string;
|
40
|
+
last_moveout_at: string;
|
41
|
+
resetRequired: boolean;
|
42
|
+
options: any;
|
43
|
+
isResident: boolean;
|
44
|
+
display_remove_doorbell_button: boolean;
|
45
|
+
propertyCredentialUsername: string;
|
46
|
+
propertyCredentialPassword: string;
|
47
|
+
tuya_product_name: string;
|
48
|
+
device_uuid: string;
|
49
|
+
serial_no: string;
|
50
|
+
flavour: string;
|
51
|
+
doorbell_default_settings_updated: boolean;
|
52
|
+
motion_detection: boolean;
|
53
|
+
continuous_recording: boolean;
|
54
|
+
event_recording: boolean;
|
55
|
+
set_sensitivity_low: boolean;
|
56
|
+
};
|
57
|
+
export declare const openCameraLivePreview: (params: openCameraLivePreviewType) => Promise<any>;
|
58
|
+
export type registerForPushNotificationType = {
|
59
|
+
token: string;
|
60
|
+
};
|
61
|
+
export declare const registerForPushNotification: (params: registerForPushNotificationType) => Promise<any>;
|
62
|
+
export type renameDeviceType = {
|
63
|
+
deviceId: string;
|
64
|
+
name: string;
|
65
|
+
};
|
66
|
+
export declare const renameDevice: (params: renameDeviceType) => Promise<any>;
|
67
|
+
export type resetDeviceType = {
|
68
|
+
devId: string;
|
69
|
+
homeId: string;
|
70
|
+
username: string;
|
71
|
+
password: string;
|
72
|
+
countryCode: string;
|
73
|
+
};
|
74
|
+
export declare const resetDevice: (params: resetDeviceType) => Promise<any>;
|
75
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAoBA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,YAAY,WAAY,gBAAgB,KAAG,OAAO,CAAC,GAAG,CAElE,CAAC;AAGF,eAAO,MAAM,cAAc,QAAO,OAAO,CAAC,GAAG,CAE5C,CAAC;AAGF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,iBAAiB,KAAG,OAAO,CAAC,GAAG,CAEpE,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,WAAW,WAAY,eAAe,KAAG,OAAO,CAAC,GAAG,CAEhE,CAAC;AAGF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,iBAAiB,WACpB,qBAAqB,KAC5B,OAAO,CAAC,GAAG,CAEb,CAAC;AAGF,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,sBAAsB,WACzB,0BAA0B,KACjC,OAAO,CAAC,GAAG,CAEb,CAAC;AAGF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MA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