JLChen
2021-11-29 06c09ecbdf83cc5cc33971ffb75ba81e85b6eb33
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//
//  ViewController.m
//  HDLSceneSiriDemo
//
//  Created by 陈嘉乐 on 2021/11/17.
//
 
#import "ViewController.h"
#import "HDLSiriSceneListViewController.h"
#import "HDLSiriShortcutModel.h"
 
@interface ViewController ()
 
@end
 
@implementation ViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}
 
-(void)gotoSiriSceneListViewController{
    
    
    NSMutableArray *dataList =  [NSMutableArray new];
    //1.场景
    HDLSiriShortcutModel *sceneModel = [[HDLSiriShortcutModel alloc] init];
    sceneModel.title = @"场景";
    sceneModel.content = @"将场景添加到Siri捷径,即可通过Siri语音执行";
    NSMutableArray *list =  [NSMutableArray new];
    for(int i = 0; i<10; i++){
        HDLSiriControlModel *model = [[HDLSiriControlModel alloc] init];
        model.controlType = @"1";
        model.controlName = [NSString stringWithFormat:@"回家模式%d",i];
        model.controlId = [NSString stringWithFormat:@"userSceneId%d",i];
        model.actionName = @"执行场景";
        model.controlJSONStr = @"2";
        [list addObject:model];
    }
    sceneModel.list = [NSArray arrayWithArray:list];
    [dataList addObject:sceneModel];
 
    //2.安防
    HDLSiriShortcutModel *securityModel = [[HDLSiriShortcutModel alloc] init];
    securityModel.title = @"安防";
    securityModel.content =@"将安防添加到Siri捷径,即可通过Siri语音执行";
    NSMutableArray *list2 =  [NSMutableArray new];
    for(int i = 0; i<10; i++){
        HDLSiriControlModel *model = [[HDLSiriControlModel alloc] init];
        model.controlType = @"2";
        model.controlName = [NSString stringWithFormat:@"外出布防%d",i];
        model.controlId = [NSString stringWithFormat:@"usecurityId%d",i];
        model.actionName = @"执行安防";
        model.controlJSONStr = @"{\"userSecurityId\":\"111111111\",\"gatewayId\":\"2222222\",\"sid\":\"333333\",\"status\":\"enable\"}";
//        model.sid = [NSString stringWithFormat:@"securityId%d",i];
        [list2 addObject:model];
    }
    securityModel.list = [NSArray arrayWithArray:list2];
    [dataList addObject:securityModel];
    
 
    
    HDLSiriSceneListViewController *vc = [[HDLSiriSceneListViewController alloc] init];
    vc.dataSource = dataList;
    vc.homeId = @"000000";
    [self.navigationController pushViewController:vc animated:YES];
    
}
- (IBAction)gotoSiriPage:(id)sender {
    [self gotoSiriSceneListViewController];
}
 
@end