wei
2020-12-22 1b5ec1190a27ebe66f74ca9513020f805d3ec61c
HDL_ON/Entity/Function/Function.cs
@@ -162,7 +162,7 @@
            {
                if (_trait_on_off == null)
                {
                    _trait_on_off = attributes.Find((obj) => obj.key == "on_off");
                    _trait_on_off = attributes.Find((obj) => obj.key == FunctionAttributeKey.OnOff);
                    //找不到属性需要声明一个,防止报错闪退
                    if (_trait_on_off == null)
                    {
@@ -173,8 +173,12 @@
                            max = 1,
                            min = 0,
                        };
                        _trait_on_off.curValue = "on";
                        _trait_on_off.curValue = "off";
                    }
                }
                if(_trait_on_off.curValue.ToString() != "on"&& _trait_on_off.curValue.ToString() != "off")
                {
                    _trait_on_off.curValue = "off";
                }
                return _trait_on_off;
            }
@@ -187,7 +191,7 @@
        /// <summary>
        /// 使用次数
        /// </summary>
        public double usageCount = 0;
        public double controlCounter = 0;
        /// <summary>
        /// 使用频率
        /// </summary>
@@ -195,7 +199,7 @@
        {
            get
            {
                return usageCount / 7;
                return controlCounter / 7;
            }
        }
        /// <summary>
@@ -297,7 +301,14 @@
                    //case FunctionAttributeKey.FadeTime:
                        if (attr.curValue.ToString() == "{}")
                        {
                            attr.curValue = "0";
                            if (attr.key == FunctionAttributeKey.OnOff)
                            {
                                attr.curValue = "off";
                            }
                            else
                            {
                                attr.curValue = "0";
                            }
                        }
                        if (attr.key == FunctionAttributeKey.SetTemp)
                        {