//
|
// ViewController.m
|
// TYtest
|
//
|
// Created by kaede wei on 2021/1/20.
|
//
|
|
#import "ViewController.h"
|
|
@interface ViewController ()
|
|
@end
|
|
@implementation ViewController
|
|
- (void)viewDidLoad {
|
[super viewDidLoad];
|
|
#if DEBUG
|
// 开启日志打印
|
_isDebug = YES;
|
#endif
|
[[TuyaSmartSDK sharedInstance] setDebugMode:_isDebug];
|
|
[[TuyaSmartSDK sharedInstance] startWithAppKey:@"ygv5jv8f8gqavd9j39yr" secretKey:@"tajep94yhh4tgxacp543xamffnf5tfy8"];
|
|
}
|
|
//开启调试模式
|
- (void) changeDebugMode:(BOOL)isDebug
|
{
|
[[TuyaSmartSDK sharedInstance] setDebugMode:isDebug];
|
}
|
|
- (void)getToken:(long long)homeId {
|
[[TuyaSmartActivator sharedInstance] getTokenWithHomeId:homeId success:^(NSString *token) {
|
NSLog(@"getToken success: %@", token);
|
// TODO: startConfigWiFi
|
} failure:^(NSError *error) {
|
NSLog(@"getToken failure: %@", error.localizedDescription);
|
}];
|
}
|
|
@end
|