TuyaSmartTimer Class Reference

Inherits from NSObject
Declared in TuyaSmartTimer.h

Overview

定时相关功能

– addTimerWithTask:loops:devId:time:dps:timeZone:success:failure:

增加定时任务

- (void)addTimerWithTask:(NSString *)task loops:(NSString *)loops devId:(NSString *)devId time:(NSString *)time dps:(NSDictionary *)dps timeZone:(NSString *)timeZone success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

task

定时任务名称

loops

循环次数

devId

设备Id

time

定时任务下的定时钟

dps

命令字典

timeZone

设备的时区 +08:00,如果没有取手机时区

success

Success block

failure

Failure block

Discussion

增加定时任务

Declared In

TuyaSmartTimer.h

– addTimerWithTask:loops:devId:time:dps:timeZone:isAppPush:aliasName:success:failure:

增加定时任务

- (void)addTimerWithTask:(NSString *)task loops:(NSString *)loops devId:(NSString *)devId time:(NSString *)time dps:(NSDictionary *)dps timeZone:(NSString *)timeZone isAppPush:(BOOL)isAppPush aliasName:(NSString *)aliasName success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

task

定时任务名称

loops

循环次数

devId

设备Id

time

定时任务下的定时钟

dps

命令字典

timeZone

设备的时区 +08:00,如果没有取手机时区

isAppPush

是否开启推送

aliasName

备注

success

Success block

failure

Failure block

Discussion

增加定时任务

Declared In

TuyaSmartTimer.h

– getTimerTaskStatusWithDeviceId:success:failure:

获取定时任务状态

- (void)getTimerTaskStatusWithDeviceId:(NSString *)devId success:(void ( ^ ) ( NSArray<TYTimerTaskModel*> *list ))success failure:(TYFailureError)failure

Parameters

devId

设备Id

success

Success block

failure

Failure block

Discussion

获取定时任务状态

Declared In

TuyaSmartTimer.h

– updateTimerTaskStatusWithTask:devId:status:success:failure:

更新定时任务状态

- (void)updateTimerTaskStatusWithTask:(NSString *)task devId:(NSString *)devId status:(NSInteger)status success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

task

定时任务名称

devId

设备Id,只支持单个wifi设备

status

定时组状态

success

Success block

failure

Failure block

Discussion

更新定时任务状态

Declared In

TuyaSmartTimer.h

– updateTimerStatusWithTask:devId:timerId:status:success:failure:

更新定时钟状态

- (void)updateTimerStatusWithTask:(NSString *)task devId:(NSString *)devId timerId:(NSString *)timerId status:(NSInteger)status success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

task

定时任务名称

devId

设备Id

timerId

定时钟Id

status

定时钟状态

success

Success block

failure

Failure block

Discussion

更新定时钟状态

Declared In

TuyaSmartTimer.h

– removeTimerWithTask:devId:timerId:success:failure:

删除定时钟

- (void)removeTimerWithTask:(NSString *)task devId:(NSString *)devId timerId:(NSString *)timerId success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

task

定时任务名称

devId

设备Id

timerId

定时钟Id

success

Success block

failure

Failure block

Discussion

删除定时钟

Declared In

TuyaSmartTimer.h

– updateTimerWithTask:loops:devId:timerId:time:dps:timeZone:success:failure:

更新定时钟

- (void)updateTimerWithTask:(NSString *)task loops:(NSString *)loops devId:(NSString *)devId timerId:(NSString *)timerId time:(NSString *)time dps:(NSDictionary *)dps timeZone:(NSString *)timeZone success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

task

定时任务名称

loops

循环次数

devId

· 设备Id

timerId

定时钟Id

time

定时任务下的定时钟

dps

命令字典

timeZone

时区 +08:00

success

Success block

failure

Failure block

Discussion

更新定时钟

Declared In

TuyaSmartTimer.h

– updateTimerWithTask:loops:devId:timerId:time:dps:timeZone:isAppPush:aliasName:success:failure:

更新定时钟

- (void)updateTimerWithTask:(NSString *)task loops:(NSString *)loops devId:(NSString *)devId timerId:(NSString *)timerId time:(NSString *)time dps:(NSDictionary *)dps timeZone:(NSString *)timeZone isAppPush:(BOOL)isAppPush aliasName:(NSString *)aliasName success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

task

定时任务名称

loops

循环次数

devId

· 设备Id

timerId

定时钟Id

time

定时任务下的定时钟

dps

命令字典

timeZone

时区 +08:00

isAppPush

是否开启推送

aliasName

备注

success

Success block

failure

Failure block

Discussion

更新定时钟

Declared In

TuyaSmartTimer.h

– getTimerWithTask:devId:success:failure:

获取定时任务下所有定时钟

- (void)getTimerWithTask:(NSString *)task devId:(NSString *)devId success:(void ( ^ ) ( NSArray<TYTimerModel*> *list ))success failure:(TYFailureError)failure

Parameters

task

定时任务名称

devId

设备Id

success

Success block

failure

Failure block

Discussion

获取定时任务下所有定时钟

Declared In

TuyaSmartTimer.h

– getAllTimerWithDeviceId:success:failure:

获取设备所有定时任务下所有定时钟

- (void)getAllTimerWithDeviceId:(NSString *)devId success:(TYSuccessDict)success failure:(TYFailureError)failure

Parameters

devId

设备Id

success

Success block

failure

Failure block

Discussion

获取设备所有定时任务下所有定时钟

Declared In

TuyaSmartTimer.h

– updateTimerWithDeviceId:timezoneId:success:failure:

修改设备的时区

- (void)updateTimerWithDeviceId:(NSString *)devId timezoneId:(NSString *)timezoneId success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

devId

设备Id

timezoneId

时区Id,例如Asia/Shanghai

success

Success block

failure

Failure block

Discussion

修改设备的时区

Declared In

TuyaSmartTimer.h

– cancelRequest

取消未完成的操作

- (void)cancelRequest

Discussion

取消未完成的操作

Declared In

TuyaSmartTimer.h