TuyaSmartDiscovery Class Reference

Inherits from NSObject
Declared in TuyaSmartDiscovery.h

  delegate

@property (nonatomic, weak) id<TuyaSmartDiscoveryDelegate> delegate

– getTokenSuccess:failure:

To obtain token (valid for 10 minutes) 获取配网Token(有效期10分钟)

- (void)getTokenSuccess:(TYSuccessString)success failure:(TYFailureError)failure

Parameters

success

Success block

failure

Failure block

Discussion

To obtain token (valid for 10 minutes) 获取配网Token(有效期10分钟)

Declared In

TuyaSmartDiscovery.h

– startDiscoveryWithSsid:password:timeout:success:failure:

start discover device 开始发现设备

- (void)startDiscoveryWithSsid:(NSString *)ssid password:(NSString *)password timeout:(NSTimeInterval)timeout success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

ssid

Name of route 路由器热点名称

password

Password of route 路由器热点密码

timeout

Timeout, default 100 seconds

success

Success block

failure

Failure block

Discussion

start discover device 开始发现设备

Declared In

TuyaSmartDiscovery.h

– startDiscoveryWithSsid:password:token:timeout:success:failure:

start discover device with token 开始发现设备

- (void)startDiscoveryWithSsid:(NSString *)ssid password:(NSString *)password token:(NSString *)token timeout:(NSTimeInterval)timeout success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

ssid

Name of route 路由器热点名称

password

Password of route 路由器热点密码

token

Config token 配网 token

timeout

Timeout, default 100 seconds

success

Success block

failure

Failure block

Discussion

start discover device with token 开始发现设备

Declared In

TuyaSmartDiscovery.h

– bindDeviceWithHomeId:devIds:success:failure:

Binding device to the home 将设备绑定家庭

- (void)bindDeviceWithHomeId:(long long)homeId devIds:(NSArray<NSString*> *)devIds success:(TYSuccessHandler)success failure:(TYFailureError)failure

Parameters

homeId

HomeId

devIds

Deivce Id list

success

Success block

failure

Failure block

Discussion

Binding device to the home 将设备绑定家庭

Declared In

TuyaSmartDiscovery.h

– stopDiscovery

stop Discovery 停止发现

- (void)stopDiscovery

Discussion

stop Discovery 停止发现

Declared In

TuyaSmartDiscovery.h