陈嘉乐
2020-12-02 74b7633fc57593542157e9d82513b5cfc4d5d8c4
HDL_ON/UI/UI2/3-Intelligence/Automation/Send.cs
@@ -21,11 +21,12 @@
        /// <summary>
        /// 住宅ID
        /// </summary>
        public static string homeId = "1333681497069043713";
        public static string homeId = "1333723044544233473";
        /// <summary>
        /// 网关ID
        /// </summary>
        public static string gatewayId = "1333682616549752834";
        public static string gatewayId = "1333723647223775233";
        /// <summary>
        /// 获取逻辑ID列表
        /// </summary>
@@ -39,11 +40,15 @@
        /// <summary>
        /// 获取逻辑
        /// </summary>
        /// <param name="userLogicId">逻辑ID</param>
        /// <returns></returns>
        public static ResponsePackNew getLogic(Logic logic)
        public static ResponsePackNew getLogic(List<string> listIdList)
        {
            var jArray = new JArray { };
            jArray.Add(logic.sid);
            for (int i = 0; i < listIdList.Count; i++)
            {
                jArray.Add(listIdList[i]);
            }
            var jObject = new JObject { { "userLogicIds", jArray } };
            var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Info);
            return responsePackNew;
@@ -129,7 +134,6 @@
            return responsePackNew;
        }
        /// <summary>
        /// 编辑更新逻辑
        /// </summary>
@@ -190,6 +194,7 @@
                var logicjArray = new JArray { };
                var logicIfon = new JObject { };
                logicIfon.Add("userLogicId", logic.userLogicId);
                logicIfon.Add("sid", logic.sid);
                logicIfon.Add("gatewayId", gatewayId);
                logicIfon.Add("name", logic.name);
@@ -218,7 +223,7 @@
        public static ResponsePackNew delLogic(Logic logic)
        {
            var jArray = new JArray { };
            jArray.Add(logic.sid);
            jArray.Add(logic.userLogicId);
            var jObject = new JObject { { "userLogicIds", jArray } };
            var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Delete);
            return responsePackNew;
@@ -229,9 +234,8 @@
        /// <returns></returns>
        public static ResponsePackNew switchLogic(Logic logic)
        {
            logic.enable ="false";
            var jArray = new JArray { };
            var job = new JObject { { "userLogicId", logic.sid } , { "enable", logic.enable } };
            var job = new JObject { { "userLogicId", logic.userLogicId } , { "enable", logic.enable } };
            jArray.Add(job);
            var jObject = new JObject { { "logics", jArray } };
            var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Enable);