|
|
@@ -347,7 +347,8 @@
|
|
|
NSDictionary *parameter = @{@"paging_datetime": _pagingId ? _pagingId : ksEmptyString,
|
|
|
@"paging_type": _pagingType ? _pagingType : ksEmptyString};
|
|
|
|
|
|
- NSString *path = [NSString stringWithFormat:API_GET_DEVICE_LIST];
|
|
|
+// NSString *path = [NSString stringWithFormat:API_GET_DEVICE_LIST];
|
|
|
+ NSString *path = [[JDFacade facade] getUrlWithCustAndGroupID:API_GET_DEVICE_LIST aditional:nil];
|
|
|
|
|
|
[[RequestHandler handler] sendAsyncRequestAPIPath:path method:ksHTTPRequestGET parameters:parameter
|
|
|
modelClass:[DeviceListModel class] showLoadingView:showLoadingView completion:^(id responseObject) {
|
|
|
@@ -359,7 +360,6 @@
|
|
|
|
|
|
if (deviceList && deviceList.list && deviceList.list.count) {
|
|
|
_deviceList = deviceList.list;
|
|
|
-
|
|
|
[self updateTitle];
|
|
|
} else {
|
|
|
if (!_deviceList.count) {//이미 로드된 데이터가 있을 경우는 출력하지 않음.
|
|
|
@@ -374,12 +374,12 @@
|
|
|
// [self requestPollingDevicesStatusInBackground];
|
|
|
|
|
|
//refresh controller
|
|
|
- if (self.refreshController && self.refreshController.refreshState == JYRefreshStateLoading) {
|
|
|
- [self.refreshController stopRefreshWithAnimated:YES completion:nil];
|
|
|
- }
|
|
|
+// if (self.refreshController && self.refreshController.refreshState == JYRefreshStateLoading) {
|
|
|
+// [self.refreshController stopRefreshWithAnimated:YES completion:nil];
|
|
|
+// }
|
|
|
|
|
|
} failure:^(id errorObject) {
|
|
|
- [self releaseDevicesTimer];
|
|
|
+// [self releaseDevicesTimer];
|
|
|
|
|
|
JDErrorModel *error = (JDErrorModel *)errorObject;
|
|
|
[[JDFacade facade] alert:error.errorMessage];
|
|
|
@@ -401,7 +401,7 @@
|
|
|
_lblTitle.text = [NSString stringWithFormat:@"장치 전체 %zd", _deviceList.count];
|
|
|
NSLog(@"HomeHubID : %@", [JDFacade facade].loginUser.homehubDeviceId);
|
|
|
if (![JDFacade facade].loginUser.hasHomeHub) {//홈허브 아이디가 없는 경우,
|
|
|
-
|
|
|
+ NSLog(@"이쪽으로 빠짐");
|
|
|
[_mainView bringSubviewToFront:_addHubContainerView];
|
|
|
_addHubContainerView.hidden = NO;
|
|
|
_collectionView.hidden = YES;
|
|
|
@@ -440,7 +440,7 @@
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
-
|
|
|
+ NSLog(@"이쪽으로 빠짐2");
|
|
|
if (![JDFacade facade].loginUser.isHomehubOnline) {
|
|
|
_imgvHubAlert.hidden = NO;
|
|
|
_lblTitle.text = @"홈허브 오프라인";
|
|
|
@@ -497,7 +497,7 @@
|
|
|
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
|
|
|
UICollectionViewCell *rcell = nil;
|
|
|
-
|
|
|
+
|
|
|
if (indexPath.row < _deviceList.count) {
|
|
|
ThingsCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ThingsCellIdentifier" forIndexPath:indexPath];
|
|
|
|
|
|
@@ -512,20 +512,23 @@
|
|
|
}];
|
|
|
[cell.btnDevice addTarget:self action:@selector(btnDeviceTouched:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
cell.btnDevice.value = indexPath;
|
|
|
-
|
|
|
+
|
|
|
//커맨드 클래스 뷰를 초기화함.
|
|
|
[[cell.controlContainer subviews] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
|
|
UIView *subview = (UIView *)obj;
|
|
|
[subview removeFromSuperview];
|
|
|
}];
|
|
|
|
|
|
- cell.pcontainerView.hidden = !device.isRequesting;
|
|
|
- if (!cell.pcontainerView.hidden) {
|
|
|
- [cell startProgressAni];
|
|
|
- } else {
|
|
|
- [cell stopProgressAni];
|
|
|
- }
|
|
|
+ NSLog(@"Is Requesting : %@", BOOLToString(device.isRequesting));
|
|
|
|
|
|
+ // TODO : 어떤 부분인지 내용 확인 필요
|
|
|
+ cell.pcontainerView.hidden = !device.isRequesting;
|
|
|
+// if (!cell.pcontainerView.hidden) {
|
|
|
+// [cell startProgressAni];
|
|
|
+// } else {
|
|
|
+// [cell stopProgressAni];
|
|
|
+// }
|
|
|
+
|
|
|
//허브 On-Off line check
|
|
|
cell.lblDeviceStatus.hidden = !([[JDFacade facade].loginUser.homehubOnlineState isEqualToString:@"OFF"] || [device.onlineState isEqualToString:@"OFF"]);
|
|
|
cell.controlContainer.hidden = !cell.lblDeviceStatus.hidden;
|
|
|
@@ -556,6 +559,7 @@
|
|
|
[cell.btnDevice setBackgroundImage:[UIImage imageNamed:@"img_thing_icon_bg_default"] forState:UIControlStateNormal];
|
|
|
}
|
|
|
|
|
|
+
|
|
|
|
|
|
rcell = cell;
|
|
|
}
|