wxr
2021-11-30 38a11bcfaf3cf703e38201c9c6cd6631354ea243
SiriIntents/HDLRunSceneIntentHandlder.cs
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Foundation;
using HDLSceneSiri;
using ObjCRuntime;
@@ -54,7 +55,20 @@
            {
                if (Server.HttpServerRequest.Ins.DataManager.IsLgoin)
                {
                    var result = Server.HttpServerRequest.Ins.ExecuteScene(intent.SceneId);
                    var result = "-1";
                    if (intent.ControlType == "1")
                    {
                        result = Server.HttpServerRequest.Ins.ExecuteScene(intent.ControlId);
                    }
                    else
                    {
                        var security = Newtonsoft.Json.JsonConvert.DeserializeObject<SecurityState>(intent.ControlJSONStr);
                        var sendObj = new List<SecurityState>() { new SecurityState() {
                             gatewayId =security.gatewayId,sid = security.sid, status = security.status, userSecurityId = security.userSecurityId
                        } };
                        result = Server.HttpServerRequest.Ins.SetSecurityStatus(sendObj);
                    }
                    if (result == "0")
                    {
                        var rsp = new HDLRunSceneIntentResponse(HDLRunSceneIntentResponseCode.Success, null);
@@ -104,4 +118,29 @@
            }
        }
    }
    /// <summary>
    /// 安防状态配置
    /// </summary>
    public class SecurityState
    {
        /// <summary>
        /// 安防云端id
        /// </summary>
        public string userSecurityId;
        /// <summary>
        /// 网关id 网关id 如果传的是sid该字段需要传
        /// </summary>
        public string gatewayId;
        /// <summary>
        /// 安防sid
        /// </summary>
        public string sid;
        /// <summary>
        /// 状态 enable布防、disable撒防
        /// </summary>
        public string status;
    }
}