Commit 4897154a authored by chen.weican's avatar chen.weican

【修改内容】1,增加情景面板绑定灯控设备取反控制失败的BUG

【提交人】陈伟灿
parent 271dd399
......@@ -539,9 +539,14 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
}else{
cJSON_AddStringToObject(info,MSG_SCENE_PROPERTYVALUE,ptr->actionInfo->info.propertyValue);
}
}else{
//开启/关闭取反操作
if(strcmp(ptr->actionInfo->info.propertyName,"PowerSwitch") == 0 && strcmp(ptr->actionInfo->info.propertyValue,"2") == 0){
cJSON_AddStringToObject(info,MSG_SCENE_PROPERTYVALUE,"10");
}else{
cJSON_AddStringToObject(info,MSG_SCENE_PROPERTYVALUE,ptr->actionInfo->info.propertyValue);
}
}
cJSON_AddNumberToObject(info,MSG_SCENE_DELAY,ptr->actionInfo->info.delay);
cJSON_AddNumberToObject(info,MSG_SCENE_EPNUM,ptr->actionInfo->info.epNum);
......@@ -1120,6 +1125,7 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
cJSON *action;
cJSON * item;
cJSON *type;
char typeStr[128] = {0};
cJSON *delay;
cJSON *exeucteSceneId;
cJSON *identifier;
......@@ -1149,22 +1155,26 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
while(item != NULL){
printf("+++\r\n");
type = cJSON_GetObjectItem(item,MSG_SCENE_TYPE);
if(type == NULL) return FAIL_RETURN;
if(type == NULL){
memcpy(typeStr,"action/thing/setProperty",strlen("action/thing/setProperty"));
}else{
memcpy(typeStr,type->valuestring,strlen(type->valuestring));
}
/*内嵌场景设置*/
if(!strcmp(type->valuestring,"action/scene")){
if(!strcmp(typeStr,"action/scene")){
delay = cJSON_GetObjectItem(item,MSG_SCENE_DELAY);
if(delay == NULL) return FAIL_RETURN;
exeucteSceneId = cJSON_GetObjectItem(item,MSG_SCENE_SCENEID);
if(exeucteSceneId == NULL) return FAIL_RETURN;
kk_scene_insert_scene_embed(delay->valueint,exeucteSceneId->valuestring,sceneId);
}
else if(!strcmp(type->valuestring,"action/thing/invokeService")){//场景服务,包含场景使能等
else if(!strcmp(typeStr,"action/thing/invokeService")){//场景服务,包含场景使能等
identifier = cJSON_GetObjectItem(item,MSG_INDENTIFIER_STR);
if(identifier == NULL) return FAIL_RETURN;
arg = cJSON_GetObjectItem(item,MSG_COMMON_ARGS);
if(arg == NULL) return FAIL_RETURN;
argStr = cJSON_PrintUnformatted(arg);
kk_scene_insert_scene_invokeService(type->valuestring,identifier->valuestring,argStr,sceneId);
kk_scene_insert_scene_invokeService(typeStr,identifier->valuestring,argStr,sceneId);
free(argStr);
}
else
......@@ -1185,11 +1195,11 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
int idelay = delay->valueint;
if(propertyValue->type==cJSON_String){
kk_subDev_set_action_by_productType(productType->valuestring,roomId->valuestring,sceneId,propertyName->valuestring,
propertyValue->valuestring,type->valuestring,idelay);
propertyValue->valuestring,typeStr,idelay);
}else{
char *str = cJSON_PrintUnformatted(propertyValue);
kk_subDev_set_action_by_productType(productType->valuestring,roomId->valuestring,sceneId,propertyName->valuestring,
str,type->valuestring,idelay);
str,typeStr,idelay);
free(str);
}
......@@ -1258,11 +1268,12 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
kk_scene_action_add(node->fatherDeviceCode,sceneId,info);
res = kk_scene_insert_scene_action(type->valuestring,node->deviceCode,iepnum,
//printf("---------------------------------DEBUG CWC[%s][%d]\n",__FUNCTION__,__LINE__);
res = kk_scene_insert_scene_action(typeStr,node->deviceCode,iepnum,
info.propertyName,propertyValueStr,idelay,sceneId,node->fatherDeviceCode);
}else{
res = kk_scene_insert_scene_action(type->valuestring,node->deviceCode,iepnum,
res = kk_scene_insert_scene_action(typeStr,node->deviceCode,iepnum,
propertyName->valuestring,propertyValueStr,idelay,sceneId,node->fatherDeviceCode);
}
......
......@@ -3,7 +3,7 @@
"productType": "sensor",
"version": "1.1",
"profile": {
"heartbeat": "1200",
"heartbeat": "300",
"productCode": "3124",
"productName": "肖邦系列.零火线SOS紧急呼叫面板Z3S(KONKE)"
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment