|
@@ -43,10 +43,12 @@ import com.icontrols.kakao.common.KEY_INFO;
|
|
|
import com.icontrols.kakao.common.SERVERINFO;
|
|
|
import com.icontrols.kakao.common.THINGS_INFO;
|
|
|
import com.icontrols.kakao.common.TYPE;
|
|
|
+import com.icontrols.kakao.common.THINGS_INFO.THINGS;
|
|
|
import com.icontrols.kakao.common.TYPE.XML_LIGHT;
|
|
|
import com.icontrols.kakao.common.utils.BeanUtils;
|
|
|
import com.icontrols.kakao.common.utils.CommonUtil;
|
|
|
import com.icontrols.kakao.common.utils.NodeUtil;
|
|
|
+import com.icontrols.kakao.common.utils.XmlUtil;
|
|
|
import com.icontrols.kakao.config.AsyncConfig;
|
|
|
import com.icontrols.kakao.entity.DonghoInfo;
|
|
|
import com.icontrols.kakao.repo.DonghoInfoRepository;
|
|
@@ -89,7 +91,7 @@ public class KakaoMsgHandler {
|
|
|
.append(" <device_info alias=\"").append(alias).append("\" twinid=\"").append(twinid).append("\" auth_number=\"" + code + "\" />\r\n")
|
|
|
.append(XMLGenerator.MakeXMLTail());
|
|
|
|
|
|
- logger.info(sb.toString());
|
|
|
+ logger.debug(sb.toString());
|
|
|
|
|
|
SSLClient.sendToWallpad(targetIP, sb.toString());
|
|
|
|
|
@@ -137,6 +139,7 @@ public class KakaoMsgHandler {
|
|
|
* @param ho
|
|
|
* @return
|
|
|
*/
|
|
|
+
|
|
|
public Map<String, Object> getDevicesStatusList(int dong, int ho) {
|
|
|
Map<String, Object> retMap = new HashMap<String, Object>();
|
|
|
Map<String, Object> body = new HashMap<String, Object>();
|
|
@@ -153,7 +156,7 @@ public class KakaoMsgHandler {
|
|
|
|
|
|
XPath xpath = XPathFactory.newInstance().newXPath();
|
|
|
Node iMap = (Node)xpath.evaluate("//imap/service", doc, XPathConstants.NODE);
|
|
|
- String xmlResult = iMap.getAttributes().getNamedItem("result").getTextContent();
|
|
|
+ String xmlResult = XmlUtil.getAttributeWithItem(iMap, "result");
|
|
|
|
|
|
logger.debug("[KakaoMsgHandler - getDeviceList] - xmlResult -> " + xmlResult);
|
|
|
|
|
@@ -165,33 +168,42 @@ public class KakaoMsgHandler {
|
|
|
|
|
|
// 월패드와 연결된 상위 THINGS 갯수 확인
|
|
|
Node dCount = null;
|
|
|
-
|
|
|
NodeList devList = (NodeList)xpath.evaluate("//imap/service/devinfo", doc, XPathConstants.NODESET);
|
|
|
|
|
|
-
|
|
|
NodeUtil.asList(devList)
|
|
|
.stream()
|
|
|
- .filter(pNode -> THINGS_INFO.isAvailableThings(pNode.getAttributes().getNamedItem("name").getTextContent()))
|
|
|
+ .filter(pNode -> THINGS_INFO.isAvailableThings(XmlUtil.getAttributeWithItem(pNode, "name")))
|
|
|
.forEach(pNode -> {
|
|
|
- String tmpModelId = pNode.getAttributes().getNamedItem("name").getTextContent();
|
|
|
- int childCount = Integer.parseInt(pNode.getAttributes().getNamedItem("value").getTextContent());
|
|
|
+ String tmpModelId = XmlUtil.getAttributeWithItem(pNode, "name");
|
|
|
+ int childCount = Integer.parseInt(XmlUtil.getAttributeWithItem(pNode, "value"));
|
|
|
|
|
|
List<Map<String, Object>> childNodeInfoList = null;
|
|
|
-
|
|
|
+ logger.debug("tmpModelID --> " + tmpModelId);
|
|
|
try {
|
|
|
// subdevinfo 를 가지고 있는 THINGS일 경우는 subdevinfo 들을 다시 구해야 한다.
|
|
|
// 예를들어 light는 light01 ~ 05 등의 subdevinfo를 가진다.
|
|
|
+
|
|
|
+ // livinglight와 light는 -> dimmer와 colorTemp를 조절이 가능한 조명이 포함될 수 있다.
|
|
|
+ // 전등의 경우 월패드에서는 크게 livinglight 또는 light 로 나뉘고 속성은 같은반변
|
|
|
+ // 카카오에서는 light, LightDimmer, ColorLightDimmer 세가지로 나뉜다.
|
|
|
+ // 월패드의 status는 (전원)/(디밍값)/(색상온도값) 으로 구성되며
|
|
|
+ // 전원을 제외하고 각 지원하지 않는 기능은 null로 전달된다.
|
|
|
+ // LightDimmer는 월패드에서 status가 on/40/null 로 status가 구성되고
|
|
|
+ // ColorLightDimmer는 월패드에서 status가 on/40/10 의 형태 또는 status가 on/null/10 의형태로 구성된다.
|
|
|
+ // status의 구성요소에 맞게 capability가 구성되어야 한다.
|
|
|
+
|
|
|
+
|
|
|
if(tmpModelId.equalsIgnoreCase("light")) {
|
|
|
for(int j=1; j <= childCount; j++) {
|
|
|
String childName = j < 10 ? tmpModelId+"0"+j : tmpModelId+j;
|
|
|
Node childNode = (Node)xpath.evaluate("//imap/service/devinfo/*[@name='"+ childName +"']", doc, XPathConstants.NODE);
|
|
|
-
|
|
|
- childCount = Integer.parseInt(childNode.getAttributes().getNamedItem("value").getTextContent());
|
|
|
+ logger.debug("childName = " + childName);
|
|
|
+ childCount = Integer.parseInt(XmlUtil.getAttributeWithItem(childNode, "value"));
|
|
|
|
|
|
NodeList childList = (NodeList)xpath.evaluate("//imap/service/devinfo/subdevinfo/*[@name='"+ childName +"']", doc, XPathConstants.NODESET);
|
|
|
|
|
|
childNodeInfoList = getChildDeviceInfo(childCount, childList);
|
|
|
-
|
|
|
+ logger.debug("child-->>" + childNodeInfoList.toString());
|
|
|
if(childNodeInfoList != null)
|
|
|
childNodeInfoList.forEach(tMap -> { body.putAll(tMap); });
|
|
|
}
|
|
@@ -200,20 +212,24 @@ public class KakaoMsgHandler {
|
|
|
|
|
|
childNodeInfoList = getChildDeviceInfo(childCount, childList);
|
|
|
|
|
|
+ logger.debug("child-->>" + childNodeInfoList.toString());
|
|
|
+
|
|
|
if(childNodeInfoList != null)
|
|
|
childNodeInfoList.forEach(tMap -> { body.putAll(tMap); });
|
|
|
}
|
|
|
}catch(Exception e) {
|
|
|
retMap.put(KEY_INFO.HTTP_KEY_ERROR, KAKAO_RESULT.getErrorInfo(KAKAO_RESULT.FAIL_INTERNAL));
|
|
|
logger.error("[ERROR] at stream - " + e.getMessage());
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// elevator는 하드코딩.
|
|
|
// elevator가 존재해야 카카오홈 앱에서 엘리베이터를 제어할 수 있다.
|
|
|
Map<String, Object> eleMap = new HashMap<String, Object>();
|
|
|
+
|
|
|
eleMap.put("displayType", THINGS_INFO.THINGS.ELEVATOR.getKakaoDisplayName());
|
|
|
- eleMap.putAll(getDeviceCapabilities(THINGS_INFO.THINGS.ELEVATOR.getThingsName()));
|
|
|
+ eleMap.putAll(getDeviceCapabilities(THINGS_INFO.THINGS.ELEVATOR.getThingsName(), null));
|
|
|
eleMap.put("endpointId", THINGS_INFO.THINGS.ELEVATOR.getKakaoDisplayName());
|
|
|
eleMap.put("name", THINGS_INFO.THINGS.ELEVATOR.getKakaoDisplayName());
|
|
|
eleMap.put("state", new HashMap<String, Object>());
|
|
@@ -294,15 +310,18 @@ public class KakaoMsgHandler {
|
|
|
Map<String, Object> retMap = new HashMap<String, Object>();
|
|
|
|
|
|
String[] tmpSplit = endpointId.split("_");
|
|
|
- String modelId = tmpSplit[0];
|
|
|
+ String modelId = (tmpSplit[0].equals("dimmer") || tmpSplit[0].equals("colorDimmer"))?tmpSplit[0]:tmpSplit[1];
|
|
|
|
|
|
if(tmpSplit.length == 1 && !modelId.equals(THINGS_INFO.THINGS.ELEVATOR.getKakaoDisplayName())) {
|
|
|
retMap.put(KEY_INFO.HTTP_KEY_ERROR, KAKAO_RESULT.getErrorInfo(KAKAO_RESULT.FAIL_NONEXIST));
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
|
- int devNum = modelId.equals(THINGS_INFO.THINGS.ELEVATOR.getKakaoDisplayName())?1:Integer.parseInt(tmpSplit[1]);
|
|
|
+ int devNum = 1;
|
|
|
|
|
|
+ if(tmpSplit[0].equals("dimmer") || tmpSplit[0].equals("colorDimmer")) devNum = Integer.parseInt(tmpSplit[2]);
|
|
|
+ else if(modelId.equals(THINGS_INFO.THINGS.ELEVATOR.getKakaoDisplayName())) devNum = 1;
|
|
|
+ else devNum = Integer.parseInt(tmpSplit[1]);
|
|
|
THINGS_INFO.THINGS things = THINGS_INFO.getThingsType(endpointId);
|
|
|
|
|
|
if(things == null) {
|
|
@@ -310,6 +329,7 @@ public class KakaoMsgHandler {
|
|
|
logger.error("[ERROR] - things null ==> INVALID REQ");
|
|
|
return retMap;
|
|
|
}
|
|
|
+
|
|
|
String action = KakaoMsgHandler.setDeviceActionStr(modelId, actionName, desired);
|
|
|
|
|
|
if(action.length() == 0) {
|
|
@@ -346,7 +366,7 @@ public class KakaoMsgHandler {
|
|
|
XPath xpath = XPathFactory.newInstance().newXPath();
|
|
|
try {
|
|
|
Node iMap = (Node) xpath.evaluate("//imap/service", doc, XPathConstants.NODE);
|
|
|
- String xmlResult = iMap.getAttributes().getNamedItem("result").getTextContent();
|
|
|
+ String xmlResult = XmlUtil.getAttributeWithItem(iMap, "result");
|
|
|
|
|
|
if(!xmlResult.equalsIgnoreCase("ok")) {
|
|
|
retMap.put(KEY_INFO.HTTP_KEY_ERROR, KAKAO_RESULT.getErrorInfo(KAKAO_RESULT.FAIL_INVALID_REQ));
|
|
@@ -363,6 +383,8 @@ public class KakaoMsgHandler {
|
|
|
retMap.put(KEY_INFO.HTTP_KEY_ERROR, KAKAO_RESULT.getErrorInfo(KAKAO_RESULT.FAIL_INTERNAL));
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
+
|
|
|
+ logger.debug("[UPDATE RESULT] - " + retMap.toString());
|
|
|
return retMap;
|
|
|
}
|
|
|
|
|
@@ -395,7 +417,7 @@ public class KakaoMsgHandler {
|
|
|
* @param modelId
|
|
|
* @return
|
|
|
*/
|
|
|
- public static Map<String, Object> getDeviceCapabilities(String modelId){
|
|
|
+ public static Map<String, Object> getDeviceCapabilities(String modelId, String status){
|
|
|
THINGS_INFO.THINGS things = THINGS_INFO.getThingsType(modelId);
|
|
|
|
|
|
String jsonString = "";
|
|
@@ -404,6 +426,17 @@ public class KakaoMsgHandler {
|
|
|
case THINGS_INFO.THINGS_LIGHT:
|
|
|
jsonString = THINGS_INFO.THINGS_CAPABILITY.LIGHT.getCapJsonStr();
|
|
|
break;
|
|
|
+ case THINGS_INFO.THINGS_LIGHT_DIMMER:
|
|
|
+ jsonString = THINGS_INFO.THINGS_CAPABILITY.LIGHT_DIMMER.getCapJsonStr();
|
|
|
+ break;
|
|
|
+
|
|
|
+ case THINGS_INFO.THINGS_COLOR_LIGHT_DIMMER:
|
|
|
+ String[] splitStr = status.split("/");
|
|
|
+ if(splitStr[1].equals("null"))
|
|
|
+ jsonString = THINGS_INFO.THINGS_CAPABILITY.COLOR_LIGHT.getCapJsonStr();
|
|
|
+ else
|
|
|
+ jsonString = THINGS_INFO.THINGS_CAPABILITY.COLOR_LIGHT_DIMMER.getCapJsonStr();
|
|
|
+ break;
|
|
|
|
|
|
case THINGS_INFO.THINGS_TEMPER:
|
|
|
jsonString = THINGS_INFO.THINGS_CAPABILITY.TEMPER.getCapJsonStr();
|
|
@@ -416,13 +449,14 @@ public class KakaoMsgHandler {
|
|
|
case THINGS_INFO.THINGS_VENTIL:
|
|
|
jsonString = THINGS_INFO.THINGS_CAPABILITY.VENTIL.getCapJsonStr();
|
|
|
break;
|
|
|
+
|
|
|
case THINGS_INFO.THINGS_ELEVATOR:
|
|
|
jsonString = THINGS_INFO.THINGS_CAPABILITY.ELEVATOR.getCapJsonStr();
|
|
|
break;
|
|
|
+
|
|
|
case THINGS_INFO.THINGS_ELECPLUG:
|
|
|
break;
|
|
|
}
|
|
|
-
|
|
|
Map<String, Object> capabilities = CommonUtil.jsonToMap(jsonString);
|
|
|
|
|
|
return capabilities;
|
|
@@ -437,35 +471,53 @@ public class KakaoMsgHandler {
|
|
|
public List<Map<String, Object>> getChildDeviceInfo(int childCount, NodeList childList){
|
|
|
List<Map<String, Object>> deviceList = new ArrayList<>();
|
|
|
try {
|
|
|
- NodeUtil.asList(childList).forEach(cNode -> {
|
|
|
- Map<String, Object> deviceMap = new HashMap<>();
|
|
|
-
|
|
|
- String cNodeName = cNode.getAttributes().getNamedItem("name").getTextContent();
|
|
|
- String cNodeDevNum = cNode.getAttributes().getNamedItem("dev_num").getTextContent();
|
|
|
- String status = cNode.getTextContent();
|
|
|
- String endpointId = cNodeName+"_"+cNodeDevNum;
|
|
|
-
|
|
|
- String tmpModelId = cNodeName.equals("temper")?endpointId:cNodeName;
|
|
|
-
|
|
|
- THINGS_INFO.DEVICE_DETAIL detailDev = THINGS_INFO.getDeviceInfo(tmpModelId);
|
|
|
-
|
|
|
- Map<String, Object> deviceInfo = new HashMap<String, Object>();
|
|
|
-
|
|
|
- deviceInfo.put(KEY_INFO.BODY_KEY_ENDPOINT_ID, endpointId);
|
|
|
- deviceInfo.put(KEY_INFO.BODY_KEY_NAME, detailDev.getDisplayName()+cNodeDevNum);
|
|
|
- deviceInfo.put(KEY_INFO.BODY_KEY_DISPLAY_TYPE, detailDev.getDisplayType());
|
|
|
-
|
|
|
- deviceInfo.putAll(getDeviceCapabilities(endpointId));
|
|
|
- deviceInfo.put(KEY_INFO.BODY_KEY_STATE, setDeviceState(endpointId, status));
|
|
|
-
|
|
|
- deviceMap.put(endpointId, deviceInfo);
|
|
|
-
|
|
|
- deviceList.add(deviceMap);
|
|
|
- });
|
|
|
+ NodeUtil.asList(childList)
|
|
|
+ .stream()
|
|
|
+ .filter(cNode -> cNode != null)
|
|
|
+ .forEach(cNode -> {
|
|
|
+ try {
|
|
|
+ Map<String, Object> deviceMap = new HashMap<>();
|
|
|
+ String cNodeName = XmlUtil.getAttributeWithItem(cNode, "name");
|
|
|
+ String cNodeDevNum = XmlUtil.getAttributeWithItem(cNode, "dev_num");
|
|
|
+ String status = XmlUtil.getElemetTextValue(cNode);
|
|
|
+ String endpointId = cNodeName+"_"+cNodeDevNum;
|
|
|
+
|
|
|
+ if(cNodeName.contains("light")) {
|
|
|
+ String[] strSplit = status.split("/");
|
|
|
+ // split 이 안됐다면 on off만 되는 예전 방식으로 전등 상태를 받았다는 뜻.
|
|
|
+ if(!strSplit[1].equals("null") && strSplit[2].equals("null"))
|
|
|
+ endpointId = "dimmer_"+endpointId;
|
|
|
+ else if(!strSplit[2].equals("null"))
|
|
|
+ endpointId = "colorDimmer_"+endpointId;
|
|
|
+ }
|
|
|
+
|
|
|
+ String tmpModelId = cNodeName.equals("temper")?endpointId:cNodeName;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ THINGS_INFO.DEVICE_DETAIL detailDev = THINGS_INFO.getDeviceInfo(tmpModelId, status);
|
|
|
+
|
|
|
+ Map<String, Object> deviceInfo = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ deviceInfo.put(KEY_INFO.BODY_KEY_ENDPOINT_ID, endpointId);
|
|
|
+ deviceInfo.put(KEY_INFO.BODY_KEY_NAME, detailDev.getDisplayName()+cNodeDevNum);
|
|
|
+ deviceInfo.put(KEY_INFO.BODY_KEY_DISPLAY_TYPE, detailDev.getDisplayType());
|
|
|
+
|
|
|
+
|
|
|
+ deviceInfo.putAll(getDeviceCapabilities(endpointId, status));
|
|
|
+ deviceInfo.put(KEY_INFO.BODY_KEY_STATE, setDeviceState(endpointId, status));
|
|
|
+
|
|
|
+ deviceMap.put(endpointId, deviceInfo);
|
|
|
+ deviceList.add(deviceMap);
|
|
|
+
|
|
|
+ }catch(Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
}catch(Exception e) {
|
|
|
return null;
|
|
|
}
|
|
|
-
|
|
|
return deviceList;
|
|
|
}
|
|
|
|
|
@@ -481,22 +533,31 @@ public class KakaoMsgHandler {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- String cNodeName = cNode.getAttributes().getNamedItem("name").getTextContent();
|
|
|
- String cNodeDevNum = cNode.getAttributes().getNamedItem("dev_num").getTextContent();
|
|
|
- String status = cNode.getTextContent();
|
|
|
+ String cNodeName = XmlUtil.getAttributeWithItem(cNode, "name");
|
|
|
+ String cNodeDevNum = XmlUtil.getAttributeWithItem(cNode, "dev_num");
|
|
|
+ String status = XmlUtil.getElemetTextValue(cNode);
|
|
|
String endpointId = cNodeName+"_"+cNodeDevNum;
|
|
|
|
|
|
- String tmpModelId = cNodeName.equals("temper")?endpointId:cNodeName;
|
|
|
+ String tmpModelId = cNodeName.equals("temper")?endpointId:cNodeName;
|
|
|
|
|
|
- THINGS_INFO.DEVICE_DETAIL detailDev = THINGS_INFO.getDeviceInfo(tmpModelId);
|
|
|
+ THINGS_INFO.DEVICE_DETAIL detailDev = THINGS_INFO.getDeviceInfo(tmpModelId, status);
|
|
|
|
|
|
Map<String, Object> deviceInfo = new HashMap<String, Object>();
|
|
|
|
|
|
+ THINGS_INFO.THINGS things = THINGS_INFO.getThingsType(cNodeName);
|
|
|
+
|
|
|
+ if(things.getEndPoint() == THINGS_INFO.THINGS_COLOR_LIGHT_DIMMER)
|
|
|
+ endpointId = "colorDimming_"+endpointId;
|
|
|
+
|
|
|
+ if(things.getEndPoint() == THINGS_INFO.THINGS_LIGHT_DIMMER)
|
|
|
+ endpointId = "dimming_"+endpointId;
|
|
|
+
|
|
|
+
|
|
|
deviceInfo.put(KEY_INFO.BODY_KEY_ENDPOINT_ID, endpointId);
|
|
|
deviceInfo.put(KEY_INFO.BODY_KEY_NAME, detailDev.getDisplayName()+cNodeDevNum);
|
|
|
deviceInfo.put(KEY_INFO.BODY_KEY_DISPLAY_TYPE, detailDev.getDisplayType());
|
|
|
|
|
|
- deviceInfo.putAll(getDeviceCapabilities(endpointId));
|
|
|
+ deviceInfo.putAll(getDeviceCapabilities(endpointId, status));
|
|
|
deviceInfo.put(KEY_INFO.BODY_KEY_STATE, setDeviceState(endpointId, status));
|
|
|
|
|
|
deviceMap.put(endpointId, deviceInfo);
|
|
@@ -529,6 +590,36 @@ public class KakaoMsgHandler {
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
+ case THINGS_INFO.THINGS_LIGHT_DIMMER:
|
|
|
+
|
|
|
+ if(capability.equals("Power") && desired.containsKey("power")) {
|
|
|
+ String tmpState = (String)desired.get("power");
|
|
|
+ if(tmpState.equals("on") || tmpState.equals("off")) sb.append(tmpState);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(desired.containsKey("brightness")) {
|
|
|
+ sb.append("/").append(((int)desired.get("brightness"))/10*10);
|
|
|
+ }
|
|
|
+
|
|
|
+ break;
|
|
|
+
|
|
|
+ case THINGS_INFO.THINGS_COLOR_LIGHT_DIMMER:
|
|
|
+
|
|
|
+ if(capability.equals("Power") && desired.containsKey("power")) {
|
|
|
+ String tmpState = (String)desired.get("power");
|
|
|
+ if(tmpState.equals("on") || tmpState.equals("off")) sb.append(tmpState);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(desired.containsKey("brightness")) {
|
|
|
+ sb.append("/").append(((int)desired.get("brightness"))/10*10);
|
|
|
+ }else if(!desired.containsKey("brightness") && desired.containsKey("colorTemperature")) {
|
|
|
+ sb.append("/null");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(desired.containsKey("colorTemperature")) {
|
|
|
+ sb.append("/").append(((int)desired.get("colorTemperature"))/1000*10);
|
|
|
+ }
|
|
|
+ break;
|
|
|
|
|
|
case THINGS_INFO.THINGS_TEMPER:
|
|
|
if(capability.equals("Power") && desired.containsKey("power")) {
|
|
@@ -594,10 +685,33 @@ public class KakaoMsgHandler {
|
|
|
|
|
|
THINGS_INFO.THINGS things = THINGS_INFO.getThingsType(modelId);
|
|
|
String[] splitStr = status.split("\\/");
|
|
|
-
|
|
|
+ int temp1, temp2 = 0;
|
|
|
switch(things.getEndPoint()) {
|
|
|
case THINGS_INFO.THINGS_LIGHT:
|
|
|
- state.put("power", status);
|
|
|
+ state.put("power", splitStr[0]);
|
|
|
+ break;
|
|
|
+ case THINGS_INFO.THINGS_LIGHT_DIMMER:
|
|
|
+ state.put("power", splitStr[0]);
|
|
|
+ if(!splitStr[1].equals("null")) {
|
|
|
+ temp1 = Integer.parseInt(splitStr[1]);
|
|
|
+ state.put("brightness", temp1);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case THINGS_INFO.THINGS_COLOR_LIGHT_DIMMER:
|
|
|
+
|
|
|
+ state.put("power", splitStr[0]);
|
|
|
+
|
|
|
+
|
|
|
+ if(!splitStr[1].equals("null")) {
|
|
|
+ temp1 = Integer.parseInt(splitStr[1]);
|
|
|
+ state.put("brightness", temp1);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!splitStr[2].equals("null")) {
|
|
|
+ temp2 = (Integer.parseInt(splitStr[2])*1000);
|
|
|
+ state.put("colorMode", "colorTemperature");
|
|
|
+ state.put("colorTemperature", temp2);
|
|
|
+ }
|
|
|
break;
|
|
|
case THINGS_INFO.THINGS_TEMPER:
|
|
|
|