Commit 52797464 authored by 陈伟灿's avatar 陈伟灿

Merge branch 'cwc' into 'master'

【修改内容】修改局域网场景同步失败的问题

See merge request chenweican/k-sdk!107
parents b024dd73 f8b4d3a4
...@@ -207,9 +207,9 @@ static cJSON *kk_zb_dev_hw_info_build(const char *deviceCode,cJSON * productCode ...@@ -207,9 +207,9 @@ static cJSON *kk_zb_dev_hw_info_build(const char *deviceCode,cJSON * productCode
_deviceCode_switchto_mac(deviceCode,mac); _deviceCode_switchto_mac(deviceCode,mac);
if(online==0){ if(online==0){
online_status = 1; //在线
}else if(online==1){
online_status = 2; //离线 online_status = 2; //离线
}else if(online==1){
online_status = 1; //在线
}else{ }else{
online_status = 0; //未知 online_status = 0; //未知
} }
...@@ -468,6 +468,7 @@ void KK_Data_FromMid(void* str,int len) ...@@ -468,6 +468,7 @@ void KK_Data_FromMid(void* str,int len)
if(info==NULL || payload==NULL || if(info==NULL || payload==NULL ||
info->type != cJSON_Object ||payload->type!= cJSON_Object){ info->type != cJSON_Object ||payload->type!= cJSON_Object){
cJSON_Delete(json);
return; return;
} }
...@@ -478,7 +479,7 @@ void KK_Data_FromMid(void* str,int len) ...@@ -478,7 +479,7 @@ void KK_Data_FromMid(void* str,int len)
if(msgtype == NULL || productCode==NULL || deviceCode==NULL|| if(msgtype == NULL || productCode==NULL || deviceCode==NULL||
msgtype->type != cJSON_String || productCode->type!= cJSON_String||deviceCode->type!= cJSON_String || msgtype->type != cJSON_String || productCode->type!= cJSON_String||deviceCode->type!= cJSON_String ||
msgtype->valuestring==NULL|| productCode->valuestring==NULL || deviceCode->valuestring==NULL){ msgtype->valuestring==NULL|| productCode->valuestring==NULL || deviceCode->valuestring==NULL){
cJSON_Delete(json);
return; return;
} }
...@@ -495,13 +496,14 @@ void KK_Data_FromMid(void* str,int len) ...@@ -495,13 +496,14 @@ void KK_Data_FromMid(void* str,int len)
arming_status_notify(type); arming_status_notify(type);
} }
}else{ }else{
property_post_deal(deviceCode->valuestring,payload); //property_post_deal(deviceCode->valuestring,payload);
} }
}else if(strstr(msgtype->valuestring,"/thing/topo/delete")!= NULL){ }else if(strstr(msgtype->valuestring,"/thing/topo/delete")!= NULL){
device_delete_sync(payload); device_delete_sync(payload);
}else if(strstr(msgtype->valuestring,"/thing/status/online")!= NULL){ }else if(strstr(msgtype->valuestring,"/thing/status/online")!= NULL){
device_add_sync(payload); device_add_sync(payload);
} }
cJSON_Delete(json);
} }
......
...@@ -142,7 +142,7 @@ int kk_ccu_opcode_handle(cJSON *root) ...@@ -142,7 +142,7 @@ int kk_ccu_opcode_handle(cJSON *root)
if(nodeId==NULL||opcode==NULL||arg==NULL ){ if(nodeId==NULL||opcode==NULL||arg==NULL ){
printf("[%s][%d]\n",__FUNCTION__,__LINE__); printf("[%s][%d]\n",__FUNCTION__,__LINE__);
return; return -1;
} }
if(requester!=NULL){ if(requester!=NULL){
......
...@@ -89,16 +89,16 @@ cJSON *kk_sync_rooms_to_sdk(cJSON *root,cJSON *data) ...@@ -89,16 +89,16 @@ cJSON *kk_sync_rooms_to_sdk(cJSON *root,cJSON *data)
/*******场景同步*******/ /*******场景同步*******/
static cJSON *_kk_scene_action_build(cJSON *action,SYN_SCENE_ACTION **act) static cJSON *_kk_scene_action_build(SYN_SCENE_ACTION *act)
{ {
SYN_SCENE_ACTION *ptr = *act; SYN_SCENE_ACTION *ptr = act;
if(ptr->nodeid==-1 || ptr->operation==NULL || if(ptr->nodeid==-1 || ptr->operation==NULL ||
ptr->operation==NULL){ ptr->operation==NULL){
return ; return ;
} }
cJSON *action = cJSON_CreateObject();
cJSON_AddStringToObject(action, "area",(ptr->ui_area==NULL)?"":ptr->ui_area); cJSON_AddStringToObject(action, "area",(ptr->ui_area==NULL)?"":ptr->ui_area);
cJSON_AddStringToObject(action, "name",(ptr->ui_name==NULL)?"":ptr->ui_name); cJSON_AddStringToObject(action, "name",(ptr->ui_name==NULL)?"":ptr->ui_name);
cJSON_AddStringToObject(action, "delay",(ptr->delay==NULL)?"0":ptr->delay); cJSON_AddStringToObject(action, "delay",(ptr->delay==NULL)?"0":ptr->delay);
...@@ -110,18 +110,22 @@ static cJSON *_kk_scene_action_build(cJSON *action,SYN_SCENE_ACTION **act) ...@@ -110,18 +110,22 @@ static cJSON *_kk_scene_action_build(cJSON *action,SYN_SCENE_ACTION **act)
} }
cJSON *kk_scene_actions_build(SYN_SCENE_ACTION **act,int num) cJSON *kk_scene_actions_build(SYN_SCENE_ACTION *act,int num)
{ {
int i; int i;
cJSON *actions = cJSON_CreateArray(); cJSON *actions = cJSON_CreateArray();
cJSON *action = cJSON_CreateObject();
SYN_SCENE_ACTION *ptr=*act;
//printf("------------------->num:%d\n",num);
SYN_SCENE_ACTION *ptr=act;
for(i=0;i<num;i++,ptr++){ for(i=0;i<num;i++,ptr++){
_kk_scene_action_build(action,&ptr); //printf("--------------------------->[%s][%d]\n",__FUNCTION__,__LINE__);
cJSON * action = _kk_scene_action_build(ptr);
//printf("--------------------------->[%s][%d]\n",__FUNCTION__,__LINE__);
cJSON_AddItemToArray(actions,action); cJSON_AddItemToArray(actions,action);
//printf("--------------------------->[%s][%d]\n",__FUNCTION__,__LINE__);
} }
//printf("--------------------------->[%s][%d]\n",__FUNCTION__,__LINE__);
return actions; return actions;
} }
...@@ -133,9 +137,9 @@ cJSON *kk_scene_build(SYN_SCENE_ITEM **content) ...@@ -133,9 +137,9 @@ cJSON *kk_scene_build(SYN_SCENE_ITEM **content)
if(content==NULL ||*content==NULL){ if(content==NULL ||*content==NULL){
return scene; return scene;
} }
//printf("--------------------------->[%s][%d]\n",__FUNCTION__,__LINE__);
cJSON *actions = kk_scene_actions_build(&ptr->act,ptr->act_num); cJSON *actions = kk_scene_actions_build(ptr->act,ptr->act_num);
//printf("--------------------------->[%s][%d]\n",__FUNCTION__,__LINE__);
cJSON_AddItemToObject(scene, "actions",actions); cJSON_AddItemToObject(scene, "actions",actions);
cJSON_AddStringToObject(scene, "id",ptr->scene_id); cJSON_AddStringToObject(scene, "id",ptr->scene_id);
cJSON_AddStringToObject(scene, "name",ptr->name); cJSON_AddStringToObject(scene, "name",ptr->name);
...@@ -263,6 +267,9 @@ cJSON *kk_sync_scence_to_sdk(cJSON *root,cJSON *data) ...@@ -263,6 +267,9 @@ cJSON *kk_sync_scence_to_sdk(cJSON *root,cJSON *data)
int i,num = cJSON_GetArraySize(scenes); int i,num = cJSON_GetArraySize(scenes);
SYN_SCENE_ITEM *build= (SYN_SCENE_ITEM *)malloc(sizeof(SYN_SCENE_ITEM)*num); SYN_SCENE_ITEM *build= (SYN_SCENE_ITEM *)malloc(sizeof(SYN_SCENE_ITEM)*num);
if(build == NULL){
return NULL;
}
memset(build,0,sizeof(SYN_SCENE_ITEM)*num); memset(build,0,sizeof(SYN_SCENE_ITEM)*num);
cJSON *scenesAry = cJSON_CreateArray(); cJSON *scenesAry = cJSON_CreateArray();
...@@ -286,17 +293,18 @@ cJSON *kk_sync_scence_to_sdk(cJSON *root,cJSON *data) ...@@ -286,17 +293,18 @@ cJSON *kk_sync_scence_to_sdk(cJSON *root,cJSON *data)
if(strcmp(sceneType->valuestring,"")==){ if(strcmp(sceneType->valuestring,"")==){
}*/ }*/
//printf("--------------------------->[%s][%d]\n",__FUNCTION__,__LINE__);
pScene->act_num = kk_sync_actions(actions,&pScene->act,&pScene->room_id); pScene->act_num = kk_sync_actions(actions,&pScene->act,&pScene->room_id);
//printf("--------------------------->[%s][%d]\n",__FUNCTION__,__LINE__);
kk_sync_scene_condition(condition,&pScene); kk_sync_scene_condition(condition,&pScene);
//printf("--------------------------->[%s][%d]\n",__FUNCTION__,__LINE__);
pScene->scene_id = sceneId->valuestring; pScene->scene_id = sceneId->valuestring;
pScene->name = name->valuestring; pScene->name = name->valuestring;
pScene->pannel_id = NULL; pScene->pannel_id = NULL;
sceneItem = kk_scene_build(&pScene); sceneItem = kk_scene_build(&pScene);
//printf("--------------------------->[%s][%d]\n",__FUNCTION__,__LINE__);
cJSON_AddItemToArray(scenesAry,sceneItem); cJSON_AddItemToArray(scenesAry,sceneItem);
// printf("[%s][%d]%s\n",__FUNCTION__,__LINE__,cJSON_Print(sceneItem)); // printf("[%s][%d]%s\n",__FUNCTION__,__LINE__,cJSON_Print(sceneItem));
......
...@@ -119,7 +119,7 @@ int kk_ipc_send_json(cJSON *root) ...@@ -119,7 +119,7 @@ int kk_ipc_send_json(cJSON *root)
cJSON_Minify(msg); cJSON_Minify(msg);
kk_ipc_send(IPC_APP2MID, msg, strlen(msg)+1); kk_ipc_send(IPC_APP2MID, msg, strlen(msg)+1);
free(msg); free(msg);
cJSON_Delete(root);
return 0; return 0;
} }
......
...@@ -568,7 +568,7 @@ int kk_get_product_type_table_size(void) ...@@ -568,7 +568,7 @@ int kk_get_product_type_table_size(void)
{ {
return sizeof(producTypeMap)/sizeof(productype_map_s); return sizeof(producTypeMap)/sizeof(productype_map_s);
} }
int kk_subDev_set_action_by_productType(const char *productType,const char *sceneId,const char *propertyName,const char *propertyValue,const char *type) int kk_subDev_set_action_by_productType(const char *productType,const char *sceneId,const char *propertyName,const char *propertyValue,const char *type,int delay)
{ {
int res = 0; int res = 0;
sqlite3_stmt *stmt; sqlite3_stmt *stmt;
...@@ -583,6 +583,7 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *scen ...@@ -583,6 +583,7 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *scen
int k = 0,count = 0; int k = 0,count = 0;
char typeArray[10][32] = {0}; char typeArray[10][32] = {0};
int size = 0; int size = 0;
char *pStart = NULL;
if(productType == NULL){ if(productType == NULL){
ERROR_PRINT("ERROR [%s][%d]\n",__FUNCTION__,__LINE__); ERROR_PRINT("ERROR [%s][%d]\n",__FUNCTION__,__LINE__);
...@@ -631,18 +632,26 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *scen ...@@ -631,18 +632,26 @@ int kk_subDev_set_action_by_productType(const char *productType,const char *scen
memcpy(info.deviceCode,node->deviceCode,strlen(node->deviceCode)); memcpy(info.deviceCode,node->deviceCode,strlen(node->deviceCode));
memcpy(info.propertyName,property->identifier,strlen(property->identifier)); memcpy(info.propertyName,property->identifier,strlen(property->identifier));
memcpy(info.propertyValue,propertyValue,strlen(propertyValue)); memcpy(info.propertyValue,propertyValue,strlen(propertyValue));
//printf("------------------->property->identifier:%s\n",property->identifier);
pStart = strstr(property->identifier,"_");
if(pStart != NULL){
//printf("------------------->num:%s\n",pStart+1);
info.epNum = atoi(pStart+1);
}else{
info.epNum = 1; info.epNum = 1;
info.delay = 0;
kk_scene_action_add(node->fatherDeviceCode,sceneId,info);
} }
res = kk_scene_insert_scene_action(type,node->deviceCode,1, info.delay = delay;
property->identifier,propertyValue,0,sceneId,node->fatherDeviceCode); kk_scene_action_add(node->fatherDeviceCode,sceneId,info);
res = kk_scene_insert_scene_action(type,node->deviceCode,info.epNum,
property->identifier,propertyValue,info.delay,sceneId,node->fatherDeviceCode);
if(res != SUCCESS_RETURN){ if(res != SUCCESS_RETURN){
INFO_PRINT("kk_subDev_set_action_by_productType fail!!!\n"); INFO_PRINT("kk_subDev_set_action_by_productType fail!!!\n");
//return res; //return res;
continue; continue;
} }
} }
}
} }
//} //}
......
...@@ -20,7 +20,7 @@ int kk_subDev_send_property_get_from_db(void); ...@@ -20,7 +20,7 @@ int kk_subDev_send_property_get_from_db(void);
int kk_subDev_send_property_get(const char *fatherDeviceCode); int kk_subDev_send_property_get(const char *fatherDeviceCode);
int kk_subDev_check_scene_support(const char *deviceCode); int kk_subDev_check_scene_support(const char *deviceCode);
int kk_subDev_set_action_by_productType(const char *productType,const char *sceneId,const char *propertyName,const char *propertyValue,const char *type); int kk_subDev_set_action_by_productType(const char *productType,const char *sceneId,const char *propertyName,const char *propertyValue,const char *type,int delay);
int kk_subDev_update_offline(int isOffline,const char *deviceCode); int kk_subDev_update_offline(int isOffline,const char *deviceCode);
int kk_subDev_getSensors_reply(SensorType_t*list); int kk_subDev_getSensors_reply(SensorType_t*list);
int kk_load_subDevice(void); int kk_load_subDevice(void);
......
...@@ -266,6 +266,7 @@ static int kk_property_set_data_check(cJSON * payload,const char *deviceCode){ ...@@ -266,6 +266,7 @@ static int kk_property_set_data_check(cJSON * payload,const char *deviceCode){
continue; continue;
} }
//printf("----------------->property->identifier:%s\n",property->identifier); //printf("----------------->property->identifier:%s\n",property->identifier);
memset(propertiesTmp,0x0,sizeof(propertiesTmp));
memcpy(propertiesTmp,property->identifier,strlen(property->identifier)); memcpy(propertiesTmp,property->identifier,strlen(property->identifier));
split(propertiesTmp,"_",propertiesbuf,&num); split(propertiesTmp,"_",propertiesbuf,&num);
if(num == 2){ if(num == 2){
......
...@@ -943,8 +943,11 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat ...@@ -943,8 +943,11 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
if(propertyValue == NULL) return FAIL_RETURN; if(propertyValue == NULL) return FAIL_RETURN;
productType = cJSON_GetObjectItem(item,MSG_PRODUCT_TYPE_STR); productType = cJSON_GetObjectItem(item,MSG_PRODUCT_TYPE_STR);
if(productType != NULL){ if(productType != NULL){
delay = cJSON_GetObjectItem(item,MSG_SCENE_DELAY);
if(delay == NULL) return FAIL_RETURN;
int idelay = delay->valueint;
kk_subDev_set_action_by_productType(productType->valuestring,sceneId,propertyName->valuestring, kk_subDev_set_action_by_productType(productType->valuestring,sceneId,propertyName->valuestring,
propertyValue->valuestring,type->valuestring); propertyValue->valuestring,type->valuestring,idelay);
} }
else{ else{
deviceCode = cJSON_GetObjectItem(item,MSG_DEVICE_CODE_STR); deviceCode = cJSON_GetObjectItem(item,MSG_DEVICE_CODE_STR);
......
{
"productCode":"3020",
"operateType":"2001",
"channel":1,
"syn_type":1,
"syn_opcode":"STATUS",
"newccu":[
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},
{
"identifier":"Power",
"opcodemap":"GET_DEV_POWER",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
},
{
"identifier":"Electric",
"opcodemap":"GET_ELECTRICAL",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
},
{
"identifier":"",
"opcodemap":"STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[],
"value": 1
}
],
"oldccu":[
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"1",
"valueRange":["OFF","ON"],
"syn":"switch",
"synType":"map"
},
{
"opcode":"GET_DEV_POWER",
"identifiermap":"Power",
"dataType":"string_double",
"channel":"1",
"valueRange":[],
"syn":"",
"synType":"dummy"
},
{
"opcode":"GET_ELECTRICAL",
"identifiermap":"Electric",
"dataType":"string_double",
"channel":"1",
"valueRange":[],
"syn":"",
"synType":"dummy"
},
{
"opcode":"STATUS",
"identifiermap":"",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"syn":"light_switch",
"synType":"bool"
}
]
}
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"channel":2, "channel":2,
"newccu":[ "newccu":[
{ {
"identifier":"PowerSwitch_1", "identifier":"PowerSwitch",
"opcodemap":"SWITCH", "opcodemap":"SWITCH",
"dataType":"int", "dataType":"int",
"channel":"1", "channel":"1",
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"value": 0 "value": 0
}, },
{ {
"identifier":"PowerSwitch_2", "identifier":"PowerSwitch",
"opcodemap":"SWITCH", "opcodemap":"SWITCH",
"dataType":"int", "dataType":"int",
"channel":"2", "channel":"2",
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
"oldccu":[ "oldccu":[
{ {
"opcode":"SWITCH", "opcode":"SWITCH",
"identifiermap":"PowerSwitch_1", "identifiermap":"PowerSwitch",
"dataType":"map", "dataType":"map",
"channel":"1", "channel":"1",
"valueRange":["OFF","ON"] "valueRange":["OFF","ON"]
}, },
{ {
"opcode":"SWITCH", "opcode":"SWITCH",
"identifiermap":"PowerSwitch_2", "identifiermap":"PowerSwitch",
"dataType":"map", "dataType":"map",
"channel":"2", "channel":"2",
"valueRange":["OFF","ON"] "valueRange":["OFF","ON"]
......
{
"productCode":"3024",
"operateType":"3",
"channel":3,
"newccu":[
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"2",
"valueRange":[0,1],
"value": 0
},
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"3",
"valueRange":[0,1],
"value": 0
}
],
"oldccu":[
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"1",
"valueRange":["OFF","ON"]
},
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"2",
"valueRange":["OFF","ON"]
},
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"3",
"valueRange":["OFF","ON"]
}
]
}
\ No newline at end of file
{
"productCode":"3027",
"operateType":"1003",
"channel":2,
"newccu":[
{
"identifier":"OperationMode",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1,2],
"value": 2
},
{
"identifier":"OperationMode",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"2",
"valueRange":[0,1,2],
"value": 2
}
],
"oldccu":[
{
"opcode":"SWITCH",
"identifiermap":"OperationMode",
"dataType":"map",
"channel":"1",
"valueRange":["CLOSE","OPEN","STOP"]
},
{
"opcode":"SWITCH",
"identifiermap":"OperationMode",
"dataType":"map",
"channel":"2",
"valueRange":["CLOSE","OPEN","STOP"]
}
]
}
\ No newline at end of file
{
"productCode":"3032",
"operateType":"14002",
"channel":1,
"syn_type":1,
"syn_opcode":"CHOPIN_FRESH_AIR_STATUS",
"newccu":[
{
"identifier":"PowerSwitch",
"opcodemap":"FRESH_AIR_SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},{
"identifier":"WorkMode",
"opcodemap":"FRESH_AIR_RUN_MODEL",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 1
},{
"identifier":"WindSpeed",
"opcodemap":"FRESH_AIR_SPEED_SET",
"dataType":"int",
"channel":"1",
"valueRange":[0,1,2,3],
"value": 1
},{
"identifier":"ChildLockState",
"opcodemap":"FRESH_AIR_SET_LOCK_STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},{
"identifier":"TimingOffTime",
"opcodemap":"FRESH_AIR_SET_TIME_OFF",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"StrainerUsageTime",
"opcodemap":"CHOPIN_FRESH_AIR_STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"StrainerAlarmTime",
"opcodemap":"CHOPIN_FRESH_AIR_STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"CurrentTemperature",
"opcodemap":"CHOPIN_FRESH_AIR_STATUS",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
}
],
"oldccu":[
{
"opcode":"FRESH_AIR_SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"1",
"valueRange":["OFF","ON"],
"syn":"on",
"synType":"bool"
},{
"opcode":"FRESH_AIR_RUN_MODEL",
"identifiermap":"WorkMode",
"dataType":"map",
"channel":"1",
"valueRange":["AUTO","MANUAL"],
"syn":"runModel",
"synType":"map"
},{
"opcode":"FRESH_AIR_SPEED_SET",
"identifiermap":"WindSpeed",
"dataType":"map",
"channel":"1",
"valueRange":["STOP","LOW","MID","HIGH"],
"syn":"speed",
"synType":"int"
},{
"opcode":"FRESH_AIR_SET_LOCK_STATUS",
"identifiermap":"ChildLockState",
"dataType":"bool",
"channel":"1",
"valueRange":[],
"syn":"ChildLockState",
"synType":"double"
},{
"opcode":"FRESH_AIR_SET_TIME_OFF",
"identifiermap":"TimingOffTime",
"dataType":"string_time",
"channel":"1",
"valueRange":[],
"syn":"time_off",
"synType":"string_time"
},{
"opcode":"CHOPIN_FRESH_AIR_STATUS ",
"identifiermap":"StrainerUsageTime",
"dataType":"int",
"channel":"1",
"valueRange":[],
"syn":"filterScreenWorkTime",
"synType":"int"
},{
"opcode":"CHOPIN_FRESH_AIR_STATUS",
"identifiermap":"StrainerAlarmTime",
"dataType":"int",
"channel":"1",
"valueRange":[],
"syn":"filterScreenAlarmTime",
"synType":"int"
},{
"opcode":"CHOPIN_FRESH_AIR_STATUS",
"identifiermap":"CurrentTemperature",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"cur_temperature",
"synType":"double"
}
]
}
{
"productCode":"3034",
"operateType":"15003",
"channel":1,
"syn_type":1,
"syn_opcode":"FAN_COIL_STATUS",
"newccu":[
{
"identifier":"PowerSwitch",
"opcodemap":"SWITCH",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},{
"identifier":"WorkMode",
"opcodemap":"FAN_COIL_SET_RUN_MODEL",
"dataType":"int",
"channel":"1",
"valueRange":[1,2,3,4],
"value": 1
},{
"identifier":"WindSpeed",
"opcodemap":"FAN_COIL_SET_FUN_SPEED",
"dataType":"int",
"channel":"1",
"valueRange":[1,2,3,4],
"value": 1
},{
"identifier":"TargetTemperature",
"opcodemap":"FAN_COIL_SET_TEMPERATURE",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 16
},{
"identifier":"TimingOffTime",
"opcodemap":"FAN_COIL_SET_DELAY_SWITCH_TASK",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"ChildLockState",
"opcodemap":"FAN_COIL_SET_LOCK_STATUS",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},{
"identifier":"CurrentTemperature",
"opcodemap":"room_temperature",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 22
},{
"identifier":"smart_model_id",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"smart_model_time_index",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"system_time",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": "1970-01-01 00:00:00"
},{
"identifier":"week_day",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"total_work_time",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": 0
},{
"identifier":"timing_boot",
"opcodemap":"FAN_COIL_STATUS",
"dataType":"dummy",
"channel":"1",
"valueRange":[],
"value": {
"enable ": false,
"time": "00:00"
}
}
],
"oldccu":[
{
"opcode":"SWITCH",
"identifiermap":"PowerSwitch",
"dataType":"map",
"channel":"1",
"valueRange":["OFF","ON"],
"syn":"on",
"synType":"bool"
},{
"opcode":"FAN_COIL_SET_RUN_MODEL",
"identifiermap":"WorkMode",
"dataType":"map",
"channel":"1",
"valueRange":["COLD","HOT","WIND","DEHUMIDIFICATION"],
"syn":"run_model",
"synType":"map"
},{
"opcode":"FAN_COIL_SET_FUN_SPEED",
"identifiermap":"WindSpeed",
"dataType":"map",
"channel":"1",
"valueRange":["AUTO","HIGH","MID","LOW"],
"syn":"fan_speed",
"synType":"map"
},{
"opcode":"FAN_COIL_SET_TEMPERATURE",
"identifiermap":"TargetTemperature",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"setting_temperature",
"synType":"double"
},{
"opcode":"FAN_COIL_SET_DELAY_SWITCH_TASK",
"identifiermap":"TimingOffTime",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"timing_shutdown",
"synType":"timing_shutdown"
},{
"opcode":"FAN_COIL_SET_LOCK_STATUS",
"identifiermap":"ChildLockState",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"",
"synType":"dummy"
},{
"opcode":"room_temperature",
"identifiermap":"CurrentTemperature",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"room_temperature",
"synType":"double"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"smart_model_id",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"smart_model_id",
"synType":"double"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"smart_model_time_index",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"smart_model_time_index",
"synType":"double"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"system_time",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"system_time",
"synType":"map"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"week_day",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"week_day",
"synType":"int"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"total_work_time",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"total_work_time",
"synType":"int"
},{
"opcode":"FAN_COIL_STATUS",
"identifiermap":"timing_boot",
"dataType":"double",
"channel":"1",
"valueRange":[],
"syn":"timing_boot",
"synType":"def"
}
]
}
{
"productCode":"3051",
"operateType":"3499",
"channel":1,
"syn_type":1,
"syn_opcode":"DOOR_CONTACT_STATUS",
"newccu":[
{
"identifier":"ContactState",
"opcodemap":"DOOR_CONTACT_NOTIFY",
"dataType":"int",
"channel":"1",
"valueRange":[0,1],
"value": 0
},
{
"identifier":"Battery",
"opcodemap":"POWER_NOTIFY",
"dataType":"double",
"channel":"1",
"valueRange":[],
"value": 0
}
],
"oldccu":[
{
"opcode":"DOOR_CONTACT_NOTIFY",
"identifiermap":"ContactState",
"dataType":"map",
"channel":"1",
"valueRange":["CLOSE","OPEN"],
"syn":"status",
"synType":"map"
},
{
"opcode":"POWER_NOTIFY",
"identifiermap":"Battery",
"dataType":"string_double",
"channel":"1",
"valueRange":[],
"syn":"power",
"synType":"string_double"
}
]
}
\ No newline at end of file
{ {
"schema": "https://iot-ap.ikonke.com/model/product_3067.json", "schema": "https://iot-ap.ikonke.com/model/product_3067.json",
"productType": "curtain", "productType": "curtain",
"version": "1.0", "version": "1.1",
"profile": { "profile": {
"heartbeat": "300", "heartbeat": "300",
"productCode": "3067", "productCode": "3067",
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"name": "窗帘操作模式" "name": "窗帘操作模式"
}, },
{ {
"identifier": "LiftPercentage", "identifier": "Position",
"dataType": { "dataType": {
"type": "int", "type": "int",
"specs": { "specs": {
...@@ -37,6 +37,38 @@ ...@@ -37,6 +37,38 @@
} }
}, },
"name": "窗帘开启百分比" "name": "窗帘开启百分比"
},
{
"identifier": "WorkMode",
"dataType": {
"specs": {
"3": "转向"
},
"type": "enum"
},
"name": "窗帘转向(循环交替转向)"
},
{
"identifier": "RouteState",
"dataType": {
"specs": {
"0": "未设置",
"1": "已设置"
},
"type": "enum"
},
"name": "行程设置"
},
{
"identifier": "SwapState",
"name": "全开全关状态对调",
"dataType": {
"type": "bool",
"specs": {
"0": "关闭对调",
"1": "开启对调"
}
}
} }
], ],
"method": "thing.service.property.set", "method": "thing.service.property.set",
...@@ -60,7 +92,7 @@ ...@@ -60,7 +92,7 @@
"name": "窗帘操作模式" "name": "窗帘操作模式"
}, },
{ {
"identifier": "LiftPercentage", "identifier": "Position",
"dataType": { "dataType": {
"type": "int", "type": "int",
"specs": { "specs": {
...@@ -72,6 +104,38 @@ ...@@ -72,6 +104,38 @@
} }
}, },
"name": "窗帘开启百分比" "name": "窗帘开启百分比"
},
{
"identifier": "WorkMode",
"dataType": {
"specs": {
"3": "转向"
},
"type": "enum"
},
"name": "窗帘转向(循环交替转向)"
},
{
"identifier": "RouteState",
"dataType": {
"specs": {
"0": "未设置",
"1": "已设置"
},
"type": "enum"
},
"name": "行程设置"
},
{
"identifier": "SwapState",
"name": "全开全关状态对调",
"dataType": {
"type": "bool",
"specs": {
"0": "关闭对调",
"1": "开启对调"
}
}
} }
], ],
"identifier": "get", "identifier": "get",
...@@ -84,46 +148,6 @@ ...@@ -84,46 +148,6 @@
"required": true, "required": true,
"callType": "async", "callType": "async",
"desc": "属性获取" "desc": "属性获取"
},
{
"outputData": [],
"identifier": "setLimitedPoint",
"inputData": [],
"method": "thing.service.setLimitedPoint",
"name": "setLimitedPoint",
"required": true,
"callType": "async",
"desc": "设置限位点"
},
{
"outputData": [],
"identifier": "resetLimitedPoint",
"inputData": [],
"method": "thing.service.resetLimitedPoint",
"name": "resetLimitedPoint",
"required": true,
"callType": "async",
"desc": "重置限位点"
},
{
"outputData": [],
"identifier": "reverse",
"inputData": [],
"method": "thing.service.reverse",
"name": "reverse",
"required": true,
"callType": "async",
"desc": "电机换向"
},
{
"outputData": [],
"identifier": "onOffReverse",
"inputData": [],
"method": "thing.service.onOffReverse",
"name": "onOffReverse",
"required": false,
"callType": "async",
"desc": "全开全关对调"
} }
], ],
"properties": [ "properties": [
...@@ -142,7 +166,7 @@ ...@@ -142,7 +166,7 @@
"name": "窗帘操作模式" "name": "窗帘操作模式"
}, },
{ {
"identifier": "LiftPercentage", "identifier": "Position",
"dataType": { "dataType": {
"type": "int", "type": "int",
"specs": { "specs": {
...@@ -156,6 +180,44 @@ ...@@ -156,6 +180,44 @@
"required": true, "required": true,
"accessMode": "rw", "accessMode": "rw",
"name": "窗帘开启百分比" "name": "窗帘开启百分比"
},
{
"identifier": "WorkMode",
"dataType": {
"specs": {
"3": "转向"
},
"type": "enum"
},
"name": "窗帘转向(循环交替转向)",
"accessMode": "w",
"required": true
},
{
"identifier": "RouteState",
"dataType": {
"specs": {
"0": "未设置",
"1": "已设置"
},
"type": "enum"
},
"accessMode": "w",
"required": true,
"name": "行程设置"
},
{
"identifier": "SwapState",
"name": "全开全关状态对调",
"accessMode": "w",
"required": true,
"dataType": {
"type": "bool",
"specs": {
"0": "关闭对调",
"1": "开启对调"
}
}
} }
], ],
"events": [ "events": [
...@@ -174,7 +236,7 @@ ...@@ -174,7 +236,7 @@
"name": "窗帘操作模式" "name": "窗帘操作模式"
}, },
{ {
"identifier": "LiftPercentage", "identifier": "Position",
"dataType": { "dataType": {
"type": "int", "type": "int",
"specs": { "specs": {
...@@ -186,6 +248,28 @@ ...@@ -186,6 +248,28 @@
} }
}, },
"name": "窗帘开启百分比" "name": "窗帘开启百分比"
},
{
"identifier": "WorkMode",
"dataType": {
"specs": {
"0": "正转",
"1": "反转"
},
"type": "enum"
},
"name": "窗帘工作模式"
},
{
"identifier": "RouteState",
"dataType": {
"specs": {
"0": "未设置",
"1": "已设置"
},
"type": "enum"
},
"name": "行程设置"
} }
], ],
"identifier": "property", "identifier": "property",
......
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