wei
2021-03-08 37c315988c2dc11e4f477233f7a9f87d57bb61aa
HDL_ON/Entity/Function/Function.cs
@@ -79,7 +79,7 @@
            return attrs;
        }
        /// <summary>
        /// 获取制定属性
        /// 获取指定属性
        /// </summary>
        /// <returns></returns>
        public FunctionAttributes GetAttribute(string key)
@@ -96,7 +96,7 @@
        public string GetAttrState(string key)
        {
            var attrState = attributes.Find((s) => s.key == key.ToString());
            if(attrState == null)
            if (attrState == null || string.IsNullOrEmpty(attrState.state))
            {
                return "0";
            }
@@ -108,7 +108,7 @@
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <returns>修改结果</returns>
        public bool SetAttrState(string key, string value)
        public bool SetAttrState(string key, object value)
        {
            //var attrState = status.Find((s) => s.key == key.ToString());
            var attr = attributes.Find((s) => s.key == key);
@@ -118,13 +118,28 @@
            }
            else
            {
                attr.state = value;
                attr.state = value.ToString();
                attr.curValue = value.ToString();
            }
            return true;
        }
        /// <summary>
        /// 上一次打开的亮度
        /// 灯光私有属性
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public int lastBrightness = 100;
        /// <summary>
        /// 工作模式对应的工作温度
        /// 地热私有属性
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public Dictionary<string, byte> Fh_Mode_Temp = new Dictionary<string, byte>();
        #endregion
@@ -263,7 +278,6 @@
        public void CollectFunction()
        {
            var result = "";
            //var waitPage = new Loading();
            new System.Threading.Thread(() =>
            {
@@ -282,6 +296,12 @@
                    {
                        collect = !collect;
                        IMessageCommon.Current.ShowErrorInfoAlter(result);
                    });
                }else
                {
                    Application.RunOnMainThread(() =>
                    {
                        UI.HomePage.RefreshFunctionView();
                    });
                }
            })
@@ -672,6 +692,11 @@
        /// </summary>
        public const string Mode = "mode";
        /// <summary>
        /// 工作模式
        /// 地热/地冷/功率地热/功率地冷
        /// </summary>
        public const string WorkMode = "mode_work";
        /// <summary>
        /// 风速
        /// </summary>
        public const string FanSpeed = "fan";
@@ -679,6 +704,16 @@
        /// 设置温度
        /// </summary>
        public const string SetTemp = "set_temp";
        /// <summary>
        /// 温度模式
        /// 空调、地热//app自加
        /// </summary>
        public const string TempType = "temperature_type";
        /// <summary>
        /// 时间标记
        /// 地热//app自加
        /// </summary>
        public const string TimeFlag = "time_flag";
        /// <summary>
        /// 延时
        /// </summary>
@@ -763,8 +798,10 @@
        /// 负离子剩余时间
        /// </summary>
        public const string AnionTimeLeft = "anion_time_surplus";
        /// <summary>
        /// 打开登记(风扇)
        /// </summary>
        public const string OpenLevel = "openLevel";
        #region tuya