wei
2020-12-22 d07d62be7111d78b2aaa44c9cdee23a7d22b4dda
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;
            }
@@ -297,8 +301,15 @@
                    //case FunctionAttributeKey.FadeTime:
                        if (attr.curValue.ToString() == "{}")
                        {
                            if (attr.key == FunctionAttributeKey.OnOff)
                            {
                                attr.curValue = "off";
                            }
                            else
                            {
                            attr.curValue = "0";
                        }
                        }
                        if (attr.key == FunctionAttributeKey.SetTemp)
                        {
                            double vv = 16;