wxr
2023-07-30 d76b0e40e5bb127fd33aa1f7842447a1df0628d5
HDL_ON/Entity/Function/Function.cs
@@ -100,7 +100,7 @@
        /// <returns></returns>
        public FunctionAttributes GetAttribute(string key)
        {
            var attr = attributes.Find((a) => a.key == key);
            var attr = GetFunctionAttributes().Find((a) => a.key == key);
            return attr;
        }
@@ -171,6 +171,9 @@
                string iconPath = spk.Replace(".", "");
                switch (spk)
                {
                    case SPK.AirSwitchP3:
                        iconPath = "electricalbreaker";
                        break;
                    case SPK.PanelSocket:
                        iconPath = "electricalsocket";
                        break;
@@ -727,9 +730,9 @@
        /// <summary>
        /// 保存房间绑定信息
        /// </summary>
        public void UpdataRoomIds()
        public async void UpdataRoomIds()
        {
            new System.Threading.Thread(() =>
            new System.Threading.Thread( () =>
            {
                var pack = ApiUtlis.Ins.HttpRequest.UpdataDevcieBindRoomInfo(this);
                //直接保存本地,
@@ -799,11 +802,38 @@
        public SceneFunction ConvertSceneFunction()
        {
            var sFunc = new SceneFunction();
            if(spk == SPK.GroupControl)
            {
            var list = new List<FunctionAttributes>();
            if (spk == SPK.GroupControl)
            {
                lock (list)
                {
                    var gc = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
                    if (gc != null)
                    {
                        foreach (var temp in gc.sids)
                        {
                            var light = FunctionList.List.GetLightList().Find((obj) => obj.sid == temp.sid);
                            if (light != null)
                            {
                                foreach (var attr in light.attributes)
                                {
                                    if (list.Find((obj) => obj.key == attr.key) == null)
                                    {
                                        list.Add(attr);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            foreach (var attr in attributes)
            else
            {
                list.AddRange(attributes);
            }
            foreach (var attr in list)
            {
                //窗帘同时发送开关跟百分比会有问题,
                if(spk == SPK.CurtainRoller || spk == SPK.CurtainTrietex || spk == SPK.CurtainDream)
@@ -1117,6 +1147,10 @@
        /// 当前值
        /// </summary>
        public object curValue = new object();
        /// <summary>
        /// 属性单位
        /// </summary>
        public string unit=string.Empty;
    }
    /// <summary>
@@ -1124,6 +1158,79 @@
    /// </summary>
    public static class FunctionAttributeKey
    {
        #region 三相空开属性
        /// <summary>
        /// A相功率
        /// </summary>
        public const string PowerA = "power_a";
        /// <summary>
        /// B相功率
        /// </summary>
        public const string PowerB = "power_b";
        /// <summary>
        /// C相功率
        /// </summary>
        public const string PowerC = "power_c";
        /// <summary>
        /// A相电压
        /// </summary>
        public const string VoltageA = "voltage_a";
        /// <summary>
        /// B相电压
        /// </summary>
        public const string VoltageB = "voltage_b";
        /// <summary>
        /// C相电压
        /// </summary>
        public const string VoltageC = "voltage_c";
        /// <summary>
        /// A相电流
        /// </summary>
        public const string CurrentA = "current_a";
        /// <summary>
        /// B相电流
        /// </summary>
        public const string CurrentB = "current_b";
        /// <summary>
        /// C相电流
        /// </summary>
        public const string CurrentC = "current_c";
        /// <summary>
        /// A相温度
        /// </summary>
        public const string TempA = "temp_a";
        /// <summary>
        /// B相温度
        /// </summary>
        public const string TempB = "temp_b";
        /// <summary>
        /// C相温度
        /// </summary>
        public const string TempC = "temp_c";
        /// <summary>
        /// 过流值
        /// </summary>
        public const string MaxCurrent = "max_current";
        /// <summary>
        /// 过温值
        /// </summary>
        public const string MaxTemp = "max_temp";
        /// <summary>
        /// A相电量
        /// </summary>
        public const string ElectricityA = "electricity_a";
        /// <summary>
        /// B相电量
        /// </summary>
        public const string ElectricityB = "electricity_b";
        /// <summary>
        /// C相电量
        /// </summary>
        public const string ElectricityC = "electricity_c";
        #endregion
        public const string _null = "";
        /// <summary>
        /// 安防布防状态
@@ -2027,6 +2134,10 @@
        /// 智能空开
        /// </summary>
        public const string AirSwitch = "electrical.breaker";
        /// <summary>
        /// 三相智能空开
        /// </summary>
        public const string AirSwitchP3 = "electrical.breakerP3";
        #region 涂鸦
        /// <summary>
@@ -2080,6 +2191,7 @@
            spkList.Add(ElectricTuyaWaterValve);
            spkList.Add(ElectricTuyaWaterValve2);
            spkList.Add(AirSwitch);
            spkList.Add(AirSwitchP3);
            return spkList;
        }