更新时间:2025-04-11 02:19:47下载pdf
用于远程重启设备。
业务包版本要在 v6.2.0 以上。
source 'https://github.com/tuya/tuya-pod-specs.git'
platform :ios, '11.0'
target 'Your_Project_Name' do
pod "ThingSmartBusinessExtensionKit"
end
远程重启管理类
open class ThingDeviceRebootManager : NSObject {
...
}
远程重启定时模型
open class ThingDeviceRebootTimer : NSObject {
/// timer id
open var tid: String
/// time to reboot, format: HH:mm
open var time: String
/// days to repeat, 0000000, from Sunday to Saturday, 1 means repeat, 0 means not repeat
/// e.g. 1000000 means repeat on Sunday, 1100000 means repeat on Sunday and Monday, 1111111 means repeat every day, 0000000 means not repeat
open var loops: String
/// status of the timer, true means enable, false means disable
open var status: Bool
}
判断设备是否支持远程重启
open func supportRebootSuccess(_ success: ((Bool) -> Void)?, failure: ((any Error) -> Void)? = nil)
入参 | 类型 | 说明 |
---|---|---|
success | Bool | 成功回调。true 表示支持,false 表示不支持 |
failure | error | 错误信息 |
立即重启设备
open func rebootImmediatelySuccess(_ success: (() -> Void)?, failure: ((any Error) -> Void)? = nil)
入参 | 类型 | 说明 |
---|---|---|
success | void | 成功回调,将会在成功发送消息后立刻回调 |
failure | error | 错误信息 |
添加重启定时
open func add(_ timer: ThingDeviceRebootTimer, success: ((String) -> Void)?, failure: ((any Error) -> Void)? = nil)
设备同一时间只会有一个定时任务,新添加的定时任务将覆盖老的定时任务。
入参 | 类型 | 说明 |
---|---|---|
timer | ThingDeviceRebootTimer | 定时信息 |
success | string | 定时 ID |
failure | error | 错误信息 |
更新重启定时信息
open func update(_ timer: ThingDeviceRebootTimer, success: (() -> Void)?, failure: ((any Error) -> Void)? = nil)
入参 | 类型 | 说明 |
---|---|---|
timer | ThingDeviceRebootTimer | 定时信息 |
success | void | 成功回调 |
failure | error | 错误信息 |
获取重启定时信息
open func getTimerSuccess(_ success: ((ThingDeviceRebootTimer?) -> Void)?, failure: ((any Error) -> Void)? = nil)
如果为非重复定时,设备在执行定时后,会删除定时信息。
入参 | 类型 | 说明 |
---|---|---|
success | ThingDeviceRebootTimer | 定时信息 |
failure | error | 错误信息 |
更多信息,参考 Demo。
该内容对您有帮助吗?
是意见反馈该内容对您有帮助吗?
是意见反馈