From 611786df5108dca0bdcff03834cc285cba4b8e61 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期二, 13 十月 2020 16:48:43 +0800 Subject: [PATCH] 2020-10-13-1 --- HDL_ON/Entity/Function/AC.cs | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff --git a/HDL_ON/Entity/Function/AC.cs b/HDL_ON/Entity/Function/AC.cs index 58a9824..192af3e 100644 --- a/HDL_ON/Entity/Function/AC.cs +++ b/HDL_ON/Entity/Function/AC.cs @@ -186,7 +186,7 @@ { if (_trait_mode == null) { - _trait_mode = propertList.Find((obj) => obj.attri == "mode"); + _trait_mode = function.Find((obj) => obj.attri == "mode"); //鎵句笉鍒板睘鎬ч渶瑕佸0鏄庝竴涓紝闃叉鎶ラ敊闂�� if (_trait_mode == null) { @@ -230,7 +230,7 @@ { if (_trait_fan == null) { - _trait_fan = propertList.Find((obj) => obj.attri == "fan"); + _trait_fan = function.Find((obj) => obj.attri == "fan"); //鎵句笉鍒板睘鎬ч渶瑕佸0鏄庝竴涓紝闃叉鎶ラ敊闂�� if (_trait_fan == null) { @@ -282,7 +282,7 @@ { if (_trait_swting == null) { - _trait_swting = propertList.Find((obj) => obj.attri == "swting"); + _trait_swting = function.Find((obj) => obj.attri == "swting"); //鎵句笉鍒板睘鎬ч渶瑕佸0鏄庝竴涓紝闃叉鎶ラ敊闂�� if (_trait_swting == null) { @@ -309,7 +309,6 @@ { try { - return trait_swting.value; } catch (Exception ex) @@ -412,8 +411,17 @@ if (command == CommandType_A.write) { sendJob = new JObject { { "Namespace", vendor_code }, { "Command", command.ToString() }, { "Type", "device" } }; - JObject data = new JObject {{ "sid", sid } }; + JObject data = new JObject { { "sid", sid } }; sendJob.Add("objects", data); + List<ControlData> controlData = new List<ControlData>(); + controlData.Add(new ControlData() + { + name = "on_off", + data_type = "Bool", + value = on_off + }); + + } else if (command == CommandType_A.read) { -- Gitblit v1.8.0