|
|
@@ -498,6 +498,23 @@
|
|
|
|
|
|
- (void)requestDeviceOrderChange {
|
|
|
NSString *path = [[JDFacade facade] getUrlWithCustAndGroupID:API_PUT_NODE_ORDER_CHANGE aditional:nil];
|
|
|
+ NSMutableArray *nodeOrder = [NSMutableArray array];
|
|
|
+
|
|
|
+ for (DeviceModel *info in _deviceReOrderList) {
|
|
|
+ NSDictionary *orderInfo = @{
|
|
|
+ @"device_id": info.deviceId,
|
|
|
+ @"node_id": info.nodeId};
|
|
|
+ [nodeOrder addObject:orderInfo];
|
|
|
+ }
|
|
|
+ NSDictionary *parameter = @{@"nodes": nodeOrder};
|
|
|
+ [[RequestHandler handler] sendAsyncPutRequestAPIPath:path parameters:parameter modelClass:[JDJSONModel class] completion:^(id responseObject) {
|
|
|
+ NSLog(@"ReOrder Result : %@", responseObject);
|
|
|
+// [self refreshDeviceList];
|
|
|
+ } failure:^(id errorObject) {
|
|
|
+ JDErrorModel *error = (JDErrorModel *)errorObject;
|
|
|
+ [[JDFacade facade] alert:error.errorMessage];
|
|
|
+ }];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -676,14 +693,14 @@
|
|
|
|
|
|
CommandClassControlView *controlView = [CommandClassControlView viewForCommandClass:device.cmdclsType];
|
|
|
controlView.device = device;
|
|
|
- NSLog(@"Device Info : %@", device);
|
|
|
+ controlView.isReOrderMode = _isReOrderMode;
|
|
|
cell.controlContainer.hidden = !controlView;
|
|
|
if (!cell.controlContainer.hidden) {
|
|
|
UIView *superview = cell.controlContainer;
|
|
|
[superview addSubview:controlView];
|
|
|
|
|
|
// controlView.width = IS_IPHONE_6P ? 98.0f : 120;
|
|
|
- NSLog(@"Controll View : %f", ViewWidth(superview));
|
|
|
+// NSLog(@"Controll View : %f", ViewWidth(superview));
|
|
|
// controlView.width = ViewWidth(superview);
|
|
|
[controlView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
// make.size.mas_equalTo(superview.frame.size);
|
|
|
@@ -956,6 +973,7 @@
|
|
|
if (buttonIndex == 0) {
|
|
|
// TODO : 데이터 업데이트 하기
|
|
|
_deviceList = [[NSMutableArray alloc] initWithArray:_deviceReOrderList];
|
|
|
+ [self requestDeviceOrderChange];
|
|
|
[self toggleReOrderMode:NO];
|
|
|
}
|
|
|
}];
|