wei
2021-07-09 068c68295cad1967f7aafb4e5e951260ef03d4ce
状态属性更改,不要轻易合并
38个文件已修改
642 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control_Udp.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Packet.cs 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Function.cs 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePage.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPageBLL.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,9 +1,12 @@
<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-000404163432002E" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.220222E9-B9CA-4834-9318-2BC22465F050" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Entity/Function/Function.cs">
    <Files>
      <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="190" Column="57" />
      <File FileName="HDL_ON/Entity/Function/Function.cs" Line="420" Column="21" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" Line="760" Column="141" />
      <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs" />
      <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="190" Column="55" />
      <File FileName="HDL_ON/Entity/Function/Function.cs" Line="430" Column="1" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
@@ -12,11 +15,21 @@
            <Node name="HDL_ON" expanded="True">
              <Node name="Common" expanded="True" />
              <Node name="DAL" expanded="True">
                <Node name="Server" expanded="True" />
                <Node name="DriverLayer" expanded="True" />
              </Node>
              <Node name="Entity" expanded="True">
                <Node name="Function" expanded="True">
                  <Node name="Function.cs" selected="True" />
                </Node>
              </Node>
              <Node name="UI" expanded="True">
                <Node name="UI1-Login" expanded="True" />
                <Node name="UI2" expanded="True">
                  <Node name="1-HomePage" expanded="True" />
                  <Node name="FuntionControlView" expanded="True">
                    <Node name="AC" expanded="True" />
                    <Node name="ArmSensor" expanded="True" />
                  </Node>
                </Node>
              </Node>
            </Node>
@@ -32,8 +45,8 @@
    <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
    <String>Shared.IOS/Shared.IOS.csproj</String>
  </DisabledProjects>
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.7374d754" />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore>
      <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" line="42" column="1" />
HDL_ON/Common/ApiUtlis.cs
@@ -187,6 +187,7 @@
                        //处理剩下的新增功能
                        foreach (var newFunction in deviceList.list) 
                        {
                            newFunction.AssembleStatus();
                            newFunction.SaveFunctionFile();
                            FunctionList.List.IniFunctionList(newFunction.savePath);
                        }
HDL_ON/DAL/DriverLayer/Control.cs
@@ -819,7 +819,7 @@
                                ColorTureLampPage.UpdataStatus(localFunction);
                                break;
                            case SPK.CurtainSwitch:
                                localFunction.lastState = localFunction.trait_on_off.curValue.ToString() == "on" ? Language.StringByID(StringId.Open) : Language.StringByID(StringId.Close);
                                localFunction.lastState = localFunction.trait_on_off.state.ToString() == "on" ? Language.StringByID(StringId.Open) : Language.StringByID(StringId.Close);
                                CurtainModulePage.UpdataState(localFunction);
                                break;
                            case SPK.CurtainTrietex:
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -440,7 +440,7 @@
                                byte b0 = 100;//开关操作依据on_off字段,实际开关值依据brightness,当on_off为打开,brightness不能为0
                                if(commandDictionary.ContainsKey(FunctionAttributeKey.OnOff))
                                {
                                    if (function.trait_on_off.curValue.ToString() == "off")
                                    if (function.trait_on_off.state.ToString() == "off")
                                    {
                                        b0 = 0;
                                    }
@@ -460,7 +460,7 @@
                                break;
                            case SPK.LightRGB:
                                byte b = 100;//开关操作依据on_off字段,实际开关值依据brightness,当on_off为打开,brightness不能为0
                                if (function.trait_on_off.curValue.ToString() == "off")
                                if (function.trait_on_off.state.ToString() == "off")
                                {
                                    b = 0;
                                }
@@ -488,7 +488,7 @@
                                break;
                            case SPK.LightDimming:
                                byte b1 = 100;
                                if (function.trait_on_off.curValue.ToString() == "off")
                                if (function.trait_on_off.state.ToString() == "off")
                                {
                                    b1 = 0;
                                }
@@ -510,7 +510,7 @@
                                            0, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.FadeTime)) });
                                break;
                            case SPK.LightSwitch:
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 });
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.state.ToString() == "on" ? (byte)100 : (byte)0, 0, 0 });
                                break;
                        }
                        break;
@@ -519,11 +519,11 @@
                        {
                            case SPK.CurtainSwitch:
                                byte b1 = 0;
                                if (function.trait_on_off.curValue.ToString() == "stop")
                                if (function.trait_on_off.state.ToString() == "stop")
                                {
                                    b1 = 0;
                                }
                                else if (function.trait_on_off.curValue.ToString() == "on")
                                else if (function.trait_on_off.state.ToString() == "on")
                                {
                                    b1 = 1;
                                }
@@ -535,7 +535,7 @@
                                break;
                            case SPK.CurtainTrietex:
                            case SPK.CurtainRoller:
                                if (function.trait_on_off.curValue.ToString() == "stop")
                                if (function.trait_on_off.state.ToString() == "stop")
                                {
                                    ControlBytesSend(Command.SetCurtainModelStutas, subnetId, deviceId, new byte[] { function.bus.LoopId, 0 });
                                }
@@ -560,7 +560,7 @@
                                    switch (dic.Key)
                                    {
                                        case FunctionAttributeKey.OnOff:
                                            ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 3, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId });
                                            ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 3, function.trait_on_off.state.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId });
                                            break;
                                        case "mode":
                                            ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 6, ac.GetModeIndex(function), function.bus.LoopId });
@@ -614,7 +614,7 @@
                                            switch (dic.Key)
                                            {
                                                case FunctionAttributeKey.OnOff:
                                                    ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 20, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId });
                                                    ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 20, function.trait_on_off.state.ToString() == "on" ? (byte)1 : (byte)0, function.bus.LoopId });
                                                    break;
                                                case "mode":
                                                    ControlBytesSend(Command.InstructionPanelKey, function.bus.SubnetID, function.bus.DeviceID, new byte[] { 21, fhTemp.GetModeIndex(function), function.bus.LoopId });
@@ -647,7 +647,7 @@
                                    }
                                    else
                                    {
                                        var onoffString = function.trait_on_off.curValue.ToString();
                                        var onoffString = function.trait_on_off.state.ToString();
                                        byte b1 = 1;
                                        if (onoffString == "off")
                                        {
@@ -692,7 +692,7 @@
                        switch (function.spk)
                        {
                            case SPK.ElectricFan:
                                if (function.trait_on_off.curValue.ToString() == "on")
                                if (function.trait_on_off.state.ToString() == "on")
                                {
                                    ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, Convert.ToByte(function.GetAttrState(FunctionAttributeKey.OpenLevel)) });
                                }
@@ -701,7 +701,7 @@
                                }
                                break;
                            case SPK.ElectricSocket:
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.curValue.ToString() == "on" ? (byte)100 : (byte)0 });
                                ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { function.bus.LoopId, function.trait_on_off.state.ToString() == "on" ? (byte)100 : (byte)0 });
                                break;
                        }
                        break;
HDL_ON/DAL/DriverLayer/Packet.cs
@@ -133,8 +133,8 @@
                            {
                                if (updataObj.spk != SPK.LightRGB)
                                {
                                    updataObj.trait_on_off.curValue = receiveBytes[2] > 0 ? "on" : "off";
                                    if (updataObj.trait_on_off.curValue.ToString() == "on")
                                    updataObj.trait_on_off.state = receiveBytes[2] > 0 ? "on" : "off";
                                    if (updataObj.trait_on_off.state.ToString() == "on")
                                    {
                                        switch (updataObj.spk)
                                        {
@@ -177,8 +177,8 @@
                            {
                                if (light.spk != SPK.LightRGB)
                                {
                                    light.trait_on_off.curValue = receiveBytes[light.bus.LoopId] == 0 ? "off" : "on";
                                    if (light.trait_on_off.curValue.ToString() == "on")
                                    light.trait_on_off.state = receiveBytes[light.bus.LoopId] == 0 ? "off" : "on";
                                    if (light.trait_on_off.state.ToString() == "on")
                                    {
                                        light.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[2].ToString());
                                        light.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[2] + "%";
@@ -204,7 +204,7 @@
                                if (function != null)
                                {
                                    function.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[2] == 0 ? "off" : "on");
                                    if (function.trait_on_off.curValue.ToString() == "on")
                                    if (function.trait_on_off.state.ToString() == "on")
                                    {
                                        function.SetAttrState(FunctionAttributeKey.OpenLevel, receiveBytes[2].ToString());
                                        function.lastState = Language.StringByID(StringId.Level) + " : " + receiveBytes[2];
@@ -234,7 +234,7 @@
                            {
                                if (lightTeme.spk == SPK.LightRGB)
                                {
                                    lightTeme.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off";
                                    lightTeme.trait_on_off.state = receiveBytes[1] > 0 ? "on" : "off";
                                    if (receiveBytes[1] > 0)
                                    {
                                        lightTeme.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString());
@@ -249,7 +249,7 @@
                                    RGBPage.UpdataStates(lightTeme);
                                }else if(lightTeme.spk == SPK.LightCCT)
                                {
                                    lightTeme.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off";
                                    lightTeme.trait_on_off.state = receiveBytes[1] > 0 ? "on" : "off";
                                    if (receiveBytes[1] > 0)
                                    {
                                        lightTeme.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString());
@@ -276,11 +276,11 @@
                                {
                                    if (receiveBytes[1] > 1)
                                    {
                                        curtain.trait_on_off.curValue = "on";
                                        curtain.trait_on_off.state = "on";
                                    }
                                    else
                                    {
                                        curtain.trait_on_off.curValue = "off";
                                        curtain.trait_on_off.state = "off";
                                    }
                                    curtain.SetAttrState(FunctionAttributeKey.Percent, receiveBytes[1].ToString());
                                    curtain.lastState = Language.StringByID(StringId.Open) + curtain.GetAttrState(FunctionAttributeKey.Percent) + "%";
@@ -292,14 +292,14 @@
                                    switch (receiveBytes[1])
                                    {
                                        case 0:
                                            curtain.trait_on_off.curValue = "stop";
                                            curtain.trait_on_off.state = "stop";
                                            break;
                                        case 1:
                                            curtain.trait_on_off.curValue = "on";
                                            curtain.trait_on_off.state = "on";
                                            curtain.lastState = Language.StringByID(StringId.Open);
                                            break;
                                        case 2:
                                            curtain.trait_on_off.curValue = "off";
                                            curtain.trait_on_off.state = "off";
                                            curtain.lastState = Language.StringByID(StringId.Close);
                                            break;
                                    }
@@ -332,7 +332,7 @@
                            {
                                function.SetAttrState(FunctionAttributeKey.TempType, receiveBytes[1].ToString());
                                function.SetAttrState(FunctionAttributeKey.RoomTemp, receiveBytes[2].ToString());
                                function.trait_on_off.curValue = receiveBytes[8] == 1 ? "on" : "off";
                                function.trait_on_off.state = receiveBytes[8] == 1 ? "on" : "off";
                                acFunction.SetMode(receiveBytes[9],function);
                                acFunction.SetFan(receiveBytes[10],function);
                                function.SetAttrState(FunctionAttributeKey.SetTemp, receiveBytes[11].ToString());
@@ -386,7 +386,7 @@
                            if (function.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                            {
                                function.SetAttrState(FunctionAttributeKey.TempType, receiveBytes[2]);
                                function.trait_on_off.curValue = receiveBytes[1] % 2 == 0 ? "off" : "on";
                                function.trait_on_off.state = receiveBytes[1] % 2 == 0 ? "off" : "on";
                                new FloorHeating().SetModeIndex(receiveBytes[3],function);
                                if (function.Fh_Mode_Temp.ContainsKey("normal"))
@@ -618,7 +618,7 @@
                                switch (receiveBytes[0])
                                {
                                    case 3://
                                        function.trait_on_off.curValue = receiveBytes[1] == 1 ? "on" : "off";
                                        function.trait_on_off.state = receiveBytes[1] == 1 ? "on" : "off";
                                        break;
                                    case 4:
                                    case 7:
HDL_ON/Entity/Function/Function.cs
@@ -134,7 +134,6 @@
            else
            {
                attr.state = value.ToString();
                attr.curValue = value.ToString();
            }
            return true;
        }
@@ -271,12 +270,12 @@
                            max = 1,
                            min = 0,
                        };
                        _trait_on_off.curValue = "off";
                        _trait_on_off.state = "off";
                    }
                }
                if(_trait_on_off.curValue.ToString() != "on"&& _trait_on_off.curValue.ToString() != "off" && _trait_on_off.curValue.ToString() != "stop")
                if(_trait_on_off.state.ToString() != "on"&& _trait_on_off.state.ToString() != "off" && _trait_on_off.state.ToString() != "stop")
                {
                    _trait_on_off.curValue = "off";
                    _trait_on_off.state = "off";
                }
                return _trait_on_off;
            }
@@ -427,6 +426,19 @@
            var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this));
            FileUtlis.Files.WriteFileByBytes(savePath, ssd);
        }
        /// <summary>
        /// 通过状态列表组装属性里面的状态
        /// </summary>
        public void AssembleStatus()
        {
            foreach(var sta in status)
            {
                SetAttrState(sta.key, sta.value);
            }
        }
        /// <summary>
        /// 保存房间绑定信息
        /// </summary>
@@ -506,39 +518,39 @@
                    case FunctionAttributeKey.FanSpeed:
                    case FunctionAttributeKey.Percent:
                    //case FunctionAttributeKey.FadeTime:
                        if (attr.curValue.ToString() == "{}")
                        if (attr.state.ToString() == "{}")
                        {
                            if (attr.key == FunctionAttributeKey.OnOff)
                            {
                                attr.curValue = "off";
                                attr.state = "off";
                            }
                            else if (attr.key == FunctionAttributeKey.Mode )
                            {
                                if (DB_ResidenceData.Instance.GatewayType == 0)
                                {
                                    attr.curValue = "0";
                                    attr.state = "0";
                                }
                                else
                                {
                                    if (SPK.AcSpkList().Contains(spk))
                                    {
                                        attr.curValue = "cool";
                                        attr.state = "cool";
                                    }
                                    else if (SPK.FhSpkList().Contains(spk))
                                    {
                                        attr.curValue = "day";
                                        attr.state = "day";
                                    }
                                }
                            }
                            else 
                            {
                                attr.curValue = "0";
                                attr.state = "0";
                            }
                        }
                        if (attr.key == FunctionAttributeKey.SetTemp)
                        {
                            double vv = 16;
                            Double.TryParse(attr.curValue.ToString(), out vv);
                            Double.TryParse(attr.state.ToString(), out vv);
                            if (vv == 0)
                            {
                                vv = 26;
@@ -547,7 +559,7 @@
                        }
                        else
                        {
                            sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = attr.curValue.ToString() });
                            sFunc.status.Add(new SceneFunctionStatus() { key = attr.key, value = attr.state.ToString() });
                        }
                        break;
                }
@@ -681,6 +693,20 @@
        public string value = "";
    }
    public class attttttt
    {
        /// <summary>
        /// 当前状态
        /// </summary>
        public string state = "";
        /// <summary>
        /// 当前值
        /// </summary>
        public object curValue = new object();
    }
    /// <summary>
    /// 功能属性
    /// 属性字段解析:attri :属性内容,value 属性的值,max 最大值 min 最小值
@@ -712,10 +738,6 @@
        /// 当前状态
        /// </summary>
        public string state = "";
        /// <summary>
        /// 当前值
        /// </summary>
        public object curValue = new object();
    }
    /// <summary>
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -618,11 +618,11 @@
                    collect = true,
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="100",state = "100"   },
                        new FunctionAttributes() { key = "rgb",value =new List<string>(){ "0","100" }, curValue="0,0,0",state = "0,0,0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state="on" },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state = "100"   },
                        new FunctionAttributes() { key = "rgb",value =new List<string>(){ "0","100" }, state = "0,0,0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state = "0"   },
                        new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, state = "0"   },
                    },
                };
                lightRgb1.SaveFunctionFile();
@@ -635,11 +635,11 @@
                    roomIds = new List<string>() { "1405771024583090178"},
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "rgb",value =new List<string>(){ "0","100" }, curValue="0,0,0",state = "0,0,0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state  = "0"   },
                        new FunctionAttributes() { key = "rgb",value =new List<string>(){ "0","100" }, state = "0,0,0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state  = "0"   },
                        new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, state  = "0"   },
                    },
                };
                lightRgb2.SaveFunctionFile();
@@ -652,11 +652,11 @@
                    roomIds = new List<string>() { "1405771024583090178"},
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "cct",value =new List<string>(){ "0","65535" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state  = "0"   },
                        new FunctionAttributes() { key = "cct",value =new List<string>(){ "0","65535" }, state  = "0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state  = "0"   },
                        new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, state  = "0"   },
                    },
                };
                lightCct.SaveFunctionFile();
@@ -669,9 +669,9 @@
                    roomIds = new List<string>() { "1405771024583090178"},
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state  = "0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state  = "0"   },
                    },
                };
                lightSwitch1.SaveFunctionFile();
@@ -684,9 +684,9 @@
                    roomIds = new List<string>() { "1405771024583090178"},
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state  = "0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state  = "0"   },
                    },
                };
                lightSwitch2.SaveFunctionFile();
@@ -699,8 +699,8 @@
                    roomIds = new List<string>() { "1405771024583090178"},
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on"   },
                        new FunctionAttributes() { key = "percent",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on"   },
                        new FunctionAttributes() { key = "percent",value =new List<string>(){ "0","100" }, state  = "0"   },
                    },
                };
                curtain1.SaveFunctionFile();
@@ -713,8 +713,8 @@
                    roomIds = new List<string>() { "1405771024583090178"},
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on"   },
                        new FunctionAttributes() { key = "percent",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on"   },
                        new FunctionAttributes() { key = "percent",value =new List<string>(){ "0","100" }, state  = "0"   },
                    },
                };
                curtain2.SaveFunctionFile();
@@ -727,10 +727,10 @@
                    roomIds = new List<string>() { "1405771024583090178"},
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on"   },
                        new FunctionAttributes() { key = "mode",value =new List<string>(){ "day", "night", "away", "normal", "timer" }, curValue="day",state = "day"   },
                        new FunctionAttributes() { key = "set_temp",value =new List<string>(){ "" }, curValue="26",state = "26"   },
                        new FunctionAttributes() { key = "room_temp",value =new List<string>(){ "" }, curValue="26",state = "26"   },
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on"   },
                        new FunctionAttributes() { key = "mode",value =new List<string>(){ "day", "night", "away", "normal", "timer" }, state = "day"   },
                        new FunctionAttributes() { key = "set_temp",value =new List<string>(){ "" }, state  = "26" ,max = 30,min =16  },
                        new FunctionAttributes() { key = "room_temp",value =new List<string>(){ "" }, state  = "26"   },
                    },
                };
                fh.SaveFunctionFile();
@@ -899,9 +899,9 @@
                    roomIds = new List<string>() { room3.roomId },
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state  = "0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state  = "0"   },
                    },
                };
                lightSwitch3.SaveFunctionFile();
@@ -914,9 +914,9 @@
                    roomIds = new List<string>() { room3.roomId },
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state  = "0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state  = "0"   },
                    },
                };
                lightSwitch4.SaveFunctionFile();
@@ -1005,12 +1005,12 @@
                    roomIds = new List<string>() { room3.roomId },
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off", value = new List<string>() { "on", "off" }, curValue = "on", state = "on" },
                        new FunctionAttributes() { key = "mode", value = new List<string>() { "cool", "heat", "fan", "auto", "dry" }, curValue = "cool", state = "cool" },
                        new FunctionAttributes() { key = "fan", value = new List<string>() { "high", "medium", "low", "auto" }, curValue = "auto", state = "auto" },
                        new FunctionAttributes() { key = "set_temp", value = new List<string>() { "16", "30"}, curValue = "16", state = "16",max = 30,min = 16 },
                        new FunctionAttributes() { key = "room_temp", value = new List<string>() { }, curValue = "20", state = "20" },
                        new FunctionAttributes() { key = "swing", value = new List<string>() {"up_down", "left_right", "stop" }, curValue = "20", state = "20" },
                        new FunctionAttributes() { key = "on_off", value = new List<string>() { "on", "off" }, state = "on" },
                        new FunctionAttributes() { key = "mode", value = new List<string>() { "cool", "heat", "fan", "auto", "dry" }, state = "cool" },
                        new FunctionAttributes() { key = "fan", value = new List<string>() { "high", "medium", "low", "auto" }, state = "auto" },
                        new FunctionAttributes() { key = "set_temp", value = new List<string>() { "16", "30"}, state = "16",max = 30,min = 16 },
                        new FunctionAttributes() { key = "room_temp", value = new List<string>() { }, state = "20" },
                        new FunctionAttributes() { key = "swing", value = new List<string>() {"up_down", "left_right", "stop" }, state = "20" },
                    }
                };
                ac.SaveFunctionFile();
@@ -1046,9 +1046,9 @@
                    roomIds = new List<string>() { room1.roomId },
                    attributes = new List<FunctionAttributes>()
                    {
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0"   },
                        new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, state = "on"   },
                        new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, state  = "0"   },
                        new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, state  = "0"   },
                    },
                };
                lightSwitch6.SaveFunctionFile();
HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -994,14 +994,14 @@
                            btnPower.IsSelected = false;
                            Music.SendMethod.Pause(a31player);
                            a31player.A31PlayStatus.status = "pause";
                            a31player.trait_on_off.curValue = "off";
                            a31player.trait_on_off.state = "off";
                        }
                        else
                        {
                            btnPower.IsSelected = true;
                            Music.SendMethod.Play(a31player);
                            a31player.A31PlayStatus.status = "play";
                            a31player.trait_on_off.curValue = "on";
                            a31player.trait_on_off.state = "on";
                        }
                        UpdataFunctionStates(a31player);
                    };
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -27,7 +27,7 @@
        /// </summary>
        public static void LoadEvent_RefreshEnvirIndoorHumi()
        {
            Application.RunOnMainThread(() =>
            Application.RunOnMainThread((Action)(() =>
            {
                if (bodyView != null)
                {
@@ -43,7 +43,7 @@
                                name = enviTemp.name,
                                sid = enviTemp.sid,
                                deviceId = enviTemp.deviceId,
                                attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state, curValue = tempAttr.curValue } },
                                attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state } },
                            };
                            humiSensorList.Add(newTemp);
                        }
@@ -61,7 +61,7 @@
                    }
                    bodyView.btnIndoorHumiValues.Width = bodyView.btnIndoorHumiValues.GetTextWidth();
                }
            });
            }));
        }
        /// <summary>
@@ -69,7 +69,7 @@
        /// </summary>
        public static void LoadEvent_RefreshEnvirIndoorTemp()
        { 
            Application.RunOnMainThread(() =>
            Application.RunOnMainThread((Action)(() =>
            {
                if (bodyView != null)
                {
@@ -85,7 +85,7 @@
                                name = enviTemp.name,
                                sid = enviTemp.sid,
                                deviceId = enviTemp.deviceId,
                                attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state, curValue = tempAttr.curValue } },
                                attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state } },
                            };
                            tempSensorList.Add(newTemp);
                        }
@@ -103,7 +103,7 @@
                    }
                    bodyView.btnIndoorTempValues.Width = bodyView.btnIndoorTempValues.GetTextWidth();
                }
            });
            }));
        }
        /// <summary>
@@ -265,7 +265,7 @@
        /// </summary>
        public static void UpdataFunctionStates(Function function)
        {
            Application.RunOnMainThread(() =>
            Application.RunOnMainThread((Action)(() =>
            {
                try
                {
@@ -283,7 +283,7 @@
                                }
                                else
                                {
                                    state = function.trait_on_off.curValue.ToString() == "on";
                                    state = function.trait_on_off.state.ToString() == "on";
                                }
                                for (int i = 0; i < view.ChildrenCount; i++)
                                {
@@ -315,7 +315,7 @@
                {
                    MainPage.Log($"HomePage updata funciton states error {ex.Message}");
                }
            });
            }));
        }
        /// <summary>
@@ -398,11 +398,11 @@
                            btnSwitch.IsSelected = !btnSwitch.IsSelected;
                        });
                    }
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    if (function.spk == SPK.LightDimming || function.spk == SPK.LightRGB)
                    {
                        d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                        d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                        if (btnSwitch.IsSelected)
                        {
                            d.Add(FunctionAttributeKey.Brightness, function.lastBrightness.ToString());
@@ -416,7 +416,7 @@
                    }
                    else
                    {
                        d.Add("on_off", function.trait_on_off.curValue.ToString());
                        d.Add("on_off", function.trait_on_off.state.ToString());
                        Control.Ins.SendWriteCommand(function, d);
                    }
                })
@@ -468,20 +468,20 @@
            btnClose.MouseUpEventHandler = (sender, e) =>
            {
                btnClose.IsSelected = true;
                curtain.trait_on_off.curValue = "off";
                curtain.trait_on_off.state = "off";
                curtain.SetAttrState(FunctionAttributeKey.Percent, 0);
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
            };
            btnOpen.MouseUpEventHandler = (sender, e) =>
            {
                btnOpen.IsSelected = true;
                curtain.trait_on_off.curValue = "on";
                curtain.trait_on_off.state = "on";
                curtain.SetAttrState(FunctionAttributeKey.Percent, 100);
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
            };
        }
HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs
@@ -64,7 +64,7 @@
                                            {
                                                try
                                                {
                                                    (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.curValue.ToString() == "on";
                                                    (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.state.ToString() == "on";
                                                }
                                                catch (Exception ex)
                                                {
@@ -78,7 +78,7 @@
                                                try
                                                {
                                                    (fcView.GetChildren(j) as DiyImageSeekBar).Progress = Convert.ToInt32(updataFunction.GetAttrState(FunctionAttributeKey.Brightness));
                                                    if (updataFunction.trait_on_off.curValue.ToString() == "on")
                                                    if (updataFunction.trait_on_off.state.ToString() == "on")
                                                    {
                                                        (fcView.GetChildren(j) as DiyImageSeekBar).ProgressBarColor = CSS.CSS_Color.AuxiliaryColor1;
                                                    }
@@ -98,7 +98,7 @@
                                            {
                                                try
                                                {
                                                    (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.curValue.ToString() == "on";
                                                    (fcView.GetChildren(j) as Button).IsSelected = updataFunction.trait_on_off.state.ToString() == "on";
                                                    (fcView.GetChildren(j) as Button).Text = updataFunction.lastState;
                                                }
                                                catch (Exception ex)
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -654,25 +654,25 @@
                    case ShowFunction.Light:
                        #region Light
                        functionCount = FunctionList.List.GetLightList().Count;
                        functionOnCount = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionOnCount = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.AC:
                        #region AC
                        functionCount = FunctionList.List.GetAcList().Count;
                        functionOnCount = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionOnCount = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.Curtain:
                        #region Curtain
                        functionCount = FunctionList.List.GetCurtainList().Count;
                        functionOnCount = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionOnCount = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.FloorHeating:
                        #region 地热
                        functionCount = FunctionList.List.GetFloorHeatingList().Count;
                        functionOnCount = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionOnCount = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.DoorLock:
@@ -680,13 +680,13 @@
                    case ShowFunction.Electric:
                        #region 电器
                        functionCount = FunctionList.List.GetElectricals().Count;
                        functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionOnCount = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.EnergyMonitoring:
                        #region 能源
                        functionCount = FunctionList.List.GetEnergyList().Count;
                        functionOnCount = FunctionList.List.GetEnergyList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionOnCount = FunctionList.List.GetEnergyList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
                        #endregion
                        break;
                    case ShowFunction.Environmental:
@@ -696,7 +696,7 @@
                        break;
                    case ShowFunction.FreshAir:
                        functionCount = FunctionList.List.GetAirFreshList().Count;
                        functionOnCount = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        functionOnCount = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count;
                        break;
                    case ShowFunction.Music:
                        //functionCount = Music.A31MusicModel.A31MusicModelList.Count;
HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
@@ -108,22 +108,22 @@
                                                    switch (functionCategory)
                                                    {
                                                        case ShowFunction.FloorHeating:
                                                            btnText = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            btnText = FunctionList.List.GetFloorHeatingList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.AC:
                                                            btnText = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            btnText = FunctionList.List.GetAcList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.Curtain:
                                                            btnText = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            btnText = FunctionList.List.GetCurtainList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.Light:
                                                            btnText = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            btnText = FunctionList.List.GetLightList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.Electric:
                                                            btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                        case ShowFunction.FreshAir:
                                                            btnText = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString();
                                                            btnText = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.state.ToString() == "on").Count.ToString();
                                                            break;
                                                    }
                                                    if (btn.Tag.ToString() == functionCategory + "_onCount")
@@ -168,7 +168,7 @@
                            var btn = view1.GetChildren(j) as Button;
                            if (btn.Tag != null && btn.Tag.ToString() == "AllClose")
                            {
                                if (function.trait_on_off.curValue.ToString() == "on")
                                if (function.trait_on_off.state.ToString() == "on")
                                {
                                    btn.Visible = true;
                                }
@@ -185,7 +185,7 @@
                                        {
                                            continue;
                                        }
                                        var ssd = r.GetRoomFunctions(false).FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on");
                                        var ssd = r.GetRoomFunctions(false).FindAll((obj) => obj.trait_on_off.state.ToString() == "on");
                                        var sss = ssd.Count;
                                        if (sss == 0)
                                        {
@@ -215,9 +215,9 @@
                        {
                            foreach (var f in room.GetRoomFunctions(false))
                            {
                                f.trait_on_off.curValue = "off";
                                f.trait_on_off.state = "off";
                                Dictionary<string, string> d = new Dictionary<string, string>();
                                d.Add("on_off", f.trait_on_off.curValue.ToString());
                                d.Add("on_off", f.trait_on_off.state.ToString());
                                Control.Ins.SendWriteCommand(f, d);
                            }
@@ -237,7 +237,7 @@
                };
                foreach (var f in room.GetRoomFunctions(false))
                {
                    if (f.trait_on_off.curValue.ToString() == "on")
                    if (f.trait_on_off.state.ToString() == "on")
                    {
                        btn.Visible = true;
                        break;
@@ -344,9 +344,9 @@
                                case ShowFunction.AC:
                                    foreach (var f in FunctionList.List.GetAcList())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        f.trait_on_off.state = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
@@ -354,9 +354,9 @@
                                case ShowFunction.FloorHeating:
                                    foreach (var f in FunctionList.List.GetFloorHeatingList())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        f.trait_on_off.state = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
@@ -364,9 +364,9 @@
                                case ShowFunction.Light:
                                    foreach (var f in FunctionList.List.GetLightList())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        f.trait_on_off.state = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
@@ -374,9 +374,9 @@
                                case ShowFunction.Electric:
                                    foreach (var f in FunctionList.List.GetElectricals())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        f.trait_on_off.state = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
@@ -384,9 +384,9 @@
                                case ShowFunction.FreshAir:
                                    foreach (var f in FunctionList.List.GetAirFreshList())
                                    {
                                        f.trait_on_off.curValue = onoff;
                                        f.trait_on_off.state = onoff;
                                        Dictionary<string, string> d = new Dictionary<string, string>();
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString());
                                        d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.state.ToString());
                                        Control.Ins.SendWriteCommand(f, d);
                                        System.Threading.Thread.Sleep(sleepTime);
                                    }
@@ -472,10 +472,10 @@
                    {
                        foreach (var f in FunctionList.List.GetCurtainList())
                        {
                            f.trait_on_off.curValue = "on";
                            f.trait_on_off.state = "on";
                            f.SetAttrState(FunctionAttributeKey.Percent, "100");
                            Dictionary<string, string> d = new Dictionary<string, string>();
                            d.Add("on_off", f.trait_on_off.curValue.ToString());
                            d.Add("on_off", f.trait_on_off.state.ToString());
                            Control.Ins.SendWriteCommand(f, d);
                            System.Threading.Thread.Sleep(100);
                        }
@@ -503,10 +503,10 @@
                btnOpen.IsSelected = false;
                foreach (var f in FunctionList.List.GetCurtainList())
                {
                    f.trait_on_off.curValue = "off";
                    f.trait_on_off.state = "off";
                    f.SetAttrState(FunctionAttributeKey.Percent, "0");
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add("on_off", f.trait_on_off.curValue.ToString());
                    d.Add("on_off", f.trait_on_off.state.ToString());
                    Control.Ins.SendWriteCommand(f, d);
                }
            };
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -123,7 +123,7 @@
                            Height = Application.GetMinRealAverage(32),
                            UnSelectedImagePath = "Public/PowerClose.png",
                            SelectedImagePath = "Public/PowerOpen.png",
                            IsSelected = function.trait_on_off.curValue.ToString() == "on",
                            IsSelected = function.trait_on_off.state.ToString() == "on",
                            Tag = function.sid + "_Switch",
                        };
                        bodyDiv.AddChidren(btnSwitch);
@@ -140,7 +140,7 @@
                            Height = Application.GetMinRealAverage(32),
                            UnSelectedImagePath = "Public/PowerClose.png",
                            SelectedImagePath = "Public/PowerOpen.png",
                            IsSelected = function.trait_on_off.curValue.ToString() == "on",
                            IsSelected = function.trait_on_off.state.ToString() == "on",
                            Tag = function.sid + "_Switch",
                        };
                        bodyDiv.AddChidren(btnSwitch);
@@ -160,11 +160,11 @@
                            LoadLastStatesButton();
                            break;
                        case FunctionCategory.Light:
                            btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
                            btnSwitch.IsSelected = function.trait_on_off.state.ToString() == "on";
                            LoadLightControl();
                            break;
                        case FunctionCategory.Electric:
                            btnSwitch.IsSelected = function.trait_on_off.curValue.ToString() == "on";
                            btnSwitch.IsSelected = function.trait_on_off.state.ToString() == "on";
                            break;
                    }
                    #endregion
@@ -265,7 +265,7 @@
                        SeekBarViewHeight = Application.GetRealHeight(8),
                        ThumbImagePath = "Public/ThumbImage.png",
                        ThumbImageHeight = Application.GetRealHeight(54),
                        ProgressBarColor = function.trait_on_off.curValue.ToString() == "on" ? CSS_Color.AuxiliaryColor1 : CSS_Color.PromptingColor2,
                        ProgressBarColor = function.trait_on_off.state.ToString() == "on" ? CSS_Color.AuxiliaryColor1 : CSS_Color.PromptingColor2,
                        ProgressTextColor = CSS_Color.FirstLevelTitleColor,
                        ProgressTextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                        MaxValue = 100,
@@ -448,7 +448,7 @@
                TextColor = 0x00000000,
                TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
                Tag = function.spk + "_laststates_" + function.sid,
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.state.ToString() == "on"
            };
            bodyDiv.AddChidren(btnLastStates);
        }
HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
@@ -17,7 +17,7 @@
        {
            if(bodyDiv!= null)
            {
                Application.RunOnMainThread(() => {
                Application.RunOnMainThread((Action)(() => {
                    if(bodyDiv.Tag.ToString() == upfunc.sid)
                    {
                        for (var o = 0; o < bodyDiv.ChildrenCount; o++)
@@ -29,7 +29,7 @@
                                {
                                    if (btn.Tag.ToString() == upfunc.sid + "_Switch")// + "_DimmerBar")
                                    {
                                        btn.IsSelected = upfunc.trait_on_off.curValue.ToString() == "on";
                                        btn.IsSelected = upfunc.trait_on_off.state.ToString() == "on";
                                    }
                                }
                            }
@@ -47,7 +47,7 @@
                        }
                    }
                });
                }));
            }
        }
        /// <summary>
@@ -93,13 +93,13 @@
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                    if(fadeTime!= null)
                    {
                        int result = 0;
                        int.TryParse(fadeTime.curValue.ToString(), out result);
                        int.TryParse(fadeTime.state.ToString(), out result);
                        d.Add(FunctionAttributeKey.FadeTime, result.ToString());
                    }
                    Control.Ins.SendWriteCommand(function, d);
@@ -121,9 +121,9 @@
                {
                    if (function.Spk_Prefix == FunctionCategory.Light)
                    {
                        function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                        function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                        Dictionary<string, string> d = new Dictionary<string, string>();
                        d.Add("on_off", function.trait_on_off.curValue.ToString());
                        d.Add("on_off", function.trait_on_off.state.ToString());
                        Control.Ins.SendWriteCommand(function, d);
                    }
                })
@@ -199,10 +199,10 @@
                btnClose.IsSelected = true;
                btnStop.IsSelected = false;
                btnOpen.IsSelected = false;
                curtain.trait_on_off.curValue = "off";
                curtain.trait_on_off.state = "off";
                curtain.SetAttrState(FunctionAttributeKey.Percent, 0);
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
            };
@@ -211,9 +211,9 @@
                btnStop.IsSelected = true;
                btnClose.IsSelected = false;
                btnOpen.IsSelected = false;
                curtain.trait_on_off.curValue = "stop";
                curtain.trait_on_off.state = "stop";
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
            };
@@ -222,10 +222,10 @@
                btnOpen.IsSelected = true;
                btnClose.IsSelected = false;
                btnStop.IsSelected = false;
                curtain.trait_on_off.curValue = "on";
                curtain.trait_on_off.state = "on";
                curtain.SetAttrState(FunctionAttributeKey.Percent, 100);
                Dictionary<string, string> d = new Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, curtain.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(curtain, d);
            };
        }
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -808,7 +808,7 @@
        {
            btnMinus.MouseUpEventHandler = (sender, e) =>
            {
                if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                if (device.trait_on_off.state.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
                }
@@ -827,7 +827,7 @@
            };
            btnPlus.MouseUpEventHandler = (sender, e) =>
            {
                if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                if (device.trait_on_off.state.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
                }
@@ -875,7 +875,7 @@
        {
            btnMode.MouseUpEventHandler = (sender, e) =>
            {
                if (device.trait_on_off.curValue.ToString() == "off")
                if (device.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -884,7 +884,7 @@
            //扫风改变模式
            btnSwing.MouseUpEventHandler = (sender, e) =>
            {
                if (device.trait_on_off.curValue.ToString() == "off")
                if (device.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -892,7 +892,7 @@
            };
            btnWindSpeed.MouseUpEventHandler = (sender, e) =>
            {
                if (device.trait_on_off.curValue.ToString() == "off")
                if (device.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -902,8 +902,8 @@
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                if (device.trait_on_off.curValue.ToString() == "on")
                device.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                if (device.trait_on_off.state.ToString() == "on")
                {
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
                    btnSwitch.IsSelected = true;
@@ -916,7 +916,7 @@
                    arcBar.IsOffline = true;
                }
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(device, d);
            };
        }
@@ -930,7 +930,7 @@
        /// </summary>
        private void RefreshFormStatu()
        {
            Application.RunOnMainThread(() =>
            Application.RunOnMainThread((Action)(() =>
            {
                btnTemp.Text = Convert.ToDouble( device.GetAttrState(FunctionAttributeKey.SetTemp)).ToString();
                btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C";
@@ -938,7 +938,7 @@
                btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing));
                btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed));
                arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)));
                if (device.trait_on_off.curValue.ToString() == "on")
                if (device.trait_on_off.state.ToString() == "on")
                {
                    arcBar.IsOffline = false;
                    btnSwitch.IsSelected = true;
@@ -959,7 +959,7 @@
                    arcBar.IsClickable = false;
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
                }
            });
            }));
        }
        #endregion
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs
@@ -198,7 +198,7 @@
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = device.trait_on_off.curValue.ToString() == "on"
                IsSelected = device.trait_on_off.state.ToString() == "on"
            };
            FrameWhiteCentet1.AddChidren(btnSwitch);
@@ -360,7 +360,7 @@
        {
            btnMinus.MouseUpEventHandler = (sender, e) =>
            {
                if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                if (device.trait_on_off.state.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
                }
@@ -379,7 +379,7 @@
            };
            btnPlus.MouseUpEventHandler = (sender, e) =>
            {
                if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                if (device.trait_on_off.state.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
                }
@@ -417,7 +417,7 @@
        {
            btnMode.MouseUpEventHandler = (sender, e) =>
            {
                if (device.trait_on_off.curValue.ToString() == "off")
                if (device.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -427,8 +427,8 @@
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                if (device.trait_on_off.curValue.ToString() == "on")
                device.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                if (device.trait_on_off.state.ToString() == "on")
                {
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
                    btnSwitch.IsSelected = true;
@@ -441,7 +441,7 @@
                    arcBar.IsOffline = true;
                }
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(device, d);
            };
        }
@@ -455,13 +455,13 @@
        /// </summary>
        private void RefreshFormStatu()
        {
            Application.RunOnMainThread(() =>
            Application.RunOnMainThread((Action)(() =>
            {
                btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp);
                btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp))) + "°C";
                btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode));
                arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp)));
                if (device.trait_on_off.curValue.ToString() == "on")
                if (device.trait_on_off.state.ToString() == "on")
                {
                    arcBar.IsOffline = false;
                    btnSwitch.IsSelected = true;
@@ -482,7 +482,7 @@
                    arcBar.IsClickable = false;
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png";
                }
            });
            }));
        }
        #endregion
HDL_ON/UI/UI2/FuntionControlView/AC/ACPage.cs
@@ -146,11 +146,11 @@
            {
                Gravity = Gravity.CenterHorizontal,
                OpenAngle = 160,
                ThumbImagePath = function.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
                ThumbImagePath = function.trait_on_off.state.ToString() == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
                ThumbImageHeight = Application.GetRealWidth(50),
                ProgressBarColor = CSS_Color.MainColor,
                OfflineProgressBarColor = CSS_Color.PromptingColor2,
                IsOffline = function.trait_on_off.curValue.ToString() == "off",
                IsOffline = function.trait_on_off.state.ToString() == "off",
                MinValue = function.GetAttribute(FunctionAttributeKey.SetTemp).min,
                MaxValue = function.GetAttribute(FunctionAttributeKey.SetTemp).max,
                //IsClickable = function.trait_on_off.curValue.ToString() == "on",
@@ -259,7 +259,7 @@
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.state.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
HDL_ON/UI/UI2/FuntionControlView/AC/ACPageBLL.cs
@@ -13,7 +13,7 @@
        {
            try
            {
                Application.RunOnMainThread((() =>
                Application.RunOnMainThread((Action)(() =>
                {
                    if (bodyView == null)
                    {
@@ -30,7 +30,7 @@
                    bodyView.btnMode.UnSelectedImagePath = temp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode));
                    bodyView.btnWindSpeed.UnSelectedImagePath = temp.GetFanIconPath(updateTemp.GetAttrState(FunctionAttributeKey.FanSpeed));
                    bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp)));
                    if (updateTemp.trait_on_off.curValue.ToString() == "on")
                    if (updateTemp.trait_on_off.state.ToString() == "on")
                    {
                        bodyView.arcBar.IsOffline = false;
                        bodyView.btnSwitch.IsSelected = true;
@@ -92,7 +92,7 @@
        {
            btnMinus.MouseUpEventHandler = (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                if (function.trait_on_off.state.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
                }
@@ -112,7 +112,7 @@
            };
            btnPlus.MouseUpEventHandler = (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                if (function.trait_on_off.state.ToString() == "off" || function.GetAttrState(FunctionAttributeKey.Mode) == "fan")
                {
                    return;
                }
@@ -152,7 +152,7 @@
        {
            btnMode.MouseUpEventHandler = (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -160,7 +160,7 @@
            };
            btnWindSpeed.MouseUpEventHandler = (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -170,8 +170,8 @@
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                if (function.trait_on_off.curValue.ToString() == "on")
                function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                if (function.trait_on_off.state.ToString() == "on")
                {
                    arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png";
                    btnSwitch.IsSelected = true;
@@ -184,7 +184,7 @@
                    arcBar.IsOffline = true;
                }
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(function, d);
            };
        }
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePage.cs
@@ -135,7 +135,7 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "off",
                IsSelected = function.trait_on_off.state.ToString() == "off",
            };
            controlView.AddChidren(btnCurtainClose);
@@ -147,7 +147,7 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainStopIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainStopOnIcon.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "stop",
                IsSelected = function.trait_on_off.state.ToString() == "stop",
            };
            controlView.AddChidren(btnCurtainStop);
@@ -159,7 +159,7 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png",
                SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "on",
                IsSelected = function.trait_on_off.state.ToString() == "on",
            };
            controlView.AddChidren(btnCurtainOpen);
HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs
@@ -12,27 +12,27 @@
        /// </summary>
        public static void UpdataState(Function updataTemp)
        {
            Application.RunOnMainThread(() => {
            Application.RunOnMainThread((Action)(() => {
                if(bodyView == null)
                {
                    return;
                }
                if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid)
                {
                    if (updataTemp.trait_on_off.curValue.ToString() == "stop")
                    if (updataTemp.trait_on_off.state.ToString() == "stop")
                    {
                        //bodyView.btnCurtainOpen.IsSelected = false;
                        //bodyView.btnCurtainClose.IsSelected = false;
                        //bodyView.btnCurtainStop.IsSelected = true;
                    }
                    else if (updataTemp.trait_on_off.curValue.ToString() == "on")
                    else if (updataTemp.trait_on_off.state.ToString() == "on")
                    {
                        //bodyView.btnCurtainOpen.IsSelected = true;
                        //bodyView.btnCurtainClose.IsSelected = false;
                        //bodyView.btnCurtainStop.IsSelected = false;
                        bodyView.btnCurtainBgIcon.IsSelected = true;
                    }
                    else if (updataTemp.trait_on_off.curValue.ToString() == "off")
                    else if (updataTemp.trait_on_off.state.ToString() == "off")
                    {
                        //bodyView.btnCurtainOpen.IsSelected = false;
                        //bodyView.btnCurtainClose.IsSelected = true;
@@ -40,7 +40,7 @@
                        bodyView.btnCurtainBgIcon.IsSelected = false;
                    }
                }
            });
            }));
        }
        void LoadEventList()
@@ -79,9 +79,9 @@
                    });
                }) { IsBackground = true }.Start();
                btnCurtainBgIcon.IsSelected = false;
                function.trait_on_off.curValue = "off";
                function.trait_on_off.state = "off";
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add("on_off", function.trait_on_off.curValue.ToString());
                d.Add("on_off", function.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(function, d);
            };
@@ -106,9 +106,9 @@
                    });
                })
                { IsBackground = true }.Start();
                function.trait_on_off.curValue = "stop";
                function.trait_on_off.state = "stop";
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add("on_off", function.trait_on_off.curValue.ToString());
                d.Add("on_off", function.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(function, d);
            };
            btnCurtainOpen.MouseUpEventHandler = (sender, e) =>
@@ -121,9 +121,9 @@
                })
                { IsBackground = true }.Start();
                btnCurtainBgIcon.IsSelected = true;
                function.trait_on_off.curValue = "on";
                function.trait_on_off.state = "on";
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add("on_off", function.trait_on_off.curValue.ToString());
                d.Add("on_off", function.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(function, d);
            };
HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs
@@ -143,10 +143,10 @@
                //    });
                //})
                //{ IsBackground = true }.Start();
                function.trait_on_off.curValue = "off";
                function.trait_on_off.state = "off";
                function.SetAttrState(FunctionAttributeKey.Percent, 0);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                CurtainAnimation(0);
            };
@@ -163,9 +163,9 @@
                    });
                })
                { IsBackground = true }.Start();
                function.trait_on_off.curValue = "stop";
                function.trait_on_off.state = "stop";
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
            };
@@ -178,10 +178,10 @@
                //    });
                //})
                //{ IsBackground = true }.Start();
                function.trait_on_off.curValue = "on";
                function.trait_on_off.state = "on";
                function.SetAttrState(FunctionAttributeKey.Percent, 100);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                CurtainAnimation(100);
            };
HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs
@@ -140,10 +140,10 @@
                //    });
                //})
                //{ IsBackground = true }.Start();
                function.trait_on_off.curValue = "off";
                function.trait_on_off.state = "off";
                function.SetAttrState(FunctionAttributeKey.Percent, 0);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                CurtainAnimation(0);
            };
@@ -157,9 +157,9 @@
                    });
                })
                { IsBackground = true }.Start();
                function.trait_on_off.curValue = "stop";
                function.trait_on_off.state = "stop";
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                onCurtainAnimation = false;
            };
@@ -173,10 +173,10 @@
                //    });
                //})
                //{ IsBackground = true }.Start();
                function.trait_on_off.curValue = "on";
                function.trait_on_off.state = "on";
                function.SetAttrState(FunctionAttributeKey.Percent, 100);
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                DriverLayer.Control.Ins.SendWriteCommand(function, d);
                CurtainAnimation(100);
            };
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPage.cs
@@ -115,7 +115,7 @@
                Y = Application.GetRealHeight(100),
                Width = Application.GetRealWidth(198),
                Height = Application.GetRealWidth(198),
                IsSelected = function.trait_on_off.curValue.ToString() == "on",
                IsSelected = function.trait_on_off.state.ToString() == "on",
                SelectedImagePath = "FunctionIcon/Electrical/FanIconBg.png",
                UnSelectedImagePath = "FunctionIcon/Electrical/FanIconBgGray.png",
            };
@@ -167,7 +167,7 @@
                Height = Application.GetMinRealAverage(40),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.state.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs
@@ -12,21 +12,21 @@
        /// </summary>
        public static void UpdataState(Function updateTemp)
        {
            Application.RunOnMainThread(() =>
            Application.RunOnMainThread((Action)(() =>
            {
                try
                {
                    if (bodyView == null)
                        return;
                    bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updateTemp.trait_on_off.curValue.ToString() == "on";
                    bodyView.barGradualChange.ProgressBarColor = updateTemp.trait_on_off.curValue.ToString() == "on" ? CSS.CSS_Color.MainColor : CSS.CSS_Color.PromptingColor2;
                    bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updateTemp.trait_on_off.state.ToString() == "on";
                    bodyView.barGradualChange.ProgressBarColor = updateTemp.trait_on_off.state.ToString() == "on" ? CSS.CSS_Color.MainColor : CSS.CSS_Color.PromptingColor2;
                    bodyView.barGradualChange.Progress = Convert.ToInt32(updateTemp.GetAttrState(FunctionAttributeKey.OpenLevel));
                }
                catch (Exception ex)
                {
                    MainPage.Log($"RelayPage error {ex.Message}");
                }
            });
            }));
        }
        /// <summary>
        /// 加载事件列表
@@ -66,10 +66,10 @@
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    //Control.Send(CommandType_A.write, this.function);
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
@@ -80,9 +80,9 @@
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
@@ -92,9 +92,9 @@
                function.SetAttrState(FunctionAttributeKey.OpenLevel, e.ToString());
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage.cs
@@ -114,7 +114,7 @@
                Y = Application.GetRealHeight(100),
                Width = Application.GetRealWidth(198),
                Height = Application.GetRealWidth(198),
                IsSelected = function.trait_on_off.curValue.ToString() == "on",
                IsSelected = function.trait_on_off.state.ToString() == "on",
                UnSelectedImagePath = "FunctionIcon/Socket/SocketIconBg.png",
                SelectedImagePath = "FunctionIcon/Socket/SocketIconOnBg.png",  
            };
@@ -128,7 +128,7 @@
                Height = Application.GetMinRealAverage(40),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.state.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPageBLL.cs
@@ -12,19 +12,19 @@
        /// </summary>
        public static void UpdataState(Function uFan)
        {
            Application.RunOnMainThread(() =>
            Application.RunOnMainThread((Action)(() =>
            {
                try
                {
                    if (bodyView == null)
                        return;
                    bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = uFan.trait_on_off.curValue.ToString() == "on";
                    bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = uFan.trait_on_off.state.ToString() == "on";
                }
                catch (Exception ex)
                {
                    MainPage.Log($"RelayPage error {ex.Message}");
                }
            });
            }));
        }
        /// <summary>
        /// 加载事件列表
@@ -64,10 +64,10 @@
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    //Control.Send(CommandType_A.write, this.function);
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("on_off", function.trait_on_off.curValue.ToString());
                    d.Add("on_off", function.trait_on_off.state.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
@@ -78,10 +78,10 @@
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    //Control.Send(CommandType_A.write, this.function);
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("on_off", function.trait_on_off.curValue.ToString());
                    d.Add("on_off", function.trait_on_off.state.ToString());
                    Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs
@@ -280,7 +280,7 @@
                            name = sensor.name,
                            sid = sensor.sid,
                            deviceId = sensor.deviceId,
                            attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state, curValue = seTemp.curValue } },
                            attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state } },
                        };
                        switch (seTemp.key)
                        {
@@ -742,7 +742,7 @@
        public static void LoadEvent_UpdataStatus(Function updateTemp)
        {
            Application.RunOnMainThread(() =>
            Application.RunOnMainThread((Action)(() =>
            {
                try
                {
@@ -757,7 +757,7 @@
                                    name = updateTemp.name,
                                    sid = updateTemp.sid,
                                    deviceId = updateTemp.deviceId,
                                    attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state ,curValue = seTemp.curValue} },
                                    attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state} },
                                };
                                switch (seTemp.key)
                                {
@@ -827,7 +827,7 @@
                {
                    MainPage.Log($"更新环境传感器界面异常:{ex.Message}");
                }
            });
            }));
        }
        void LoadEvent_ChangeWeatherIcon(FrameLayout view)
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPage.cs
@@ -147,11 +147,11 @@
            {
                Gravity = Gravity.CenterHorizontal,
                OpenAngle = 160,
                ThumbImagePath = function.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/FloorHeating/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
                ThumbImagePath = function.trait_on_off.state.ToString() == "on" ? "FunctionIcon/FloorHeating/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png",
                ThumbImageHeight = Application.GetRealWidth(50),
                ProgressBarColor = CSS_Color.AuxiliaryColor1, // 0xFFFC9C04,
                OfflineProgressBarColor = CSS_Color.PromptingColor2,
                IsOffline = function.trait_on_off.curValue.ToString() == "off",
                IsOffline = function.trait_on_off.state.ToString() == "off",
                MinValue = minValue,//function.GetAttribute(FunctionAttributeKey.SetTemp).min,
                MaxValue = maxValue,// function.GetAttribute(FunctionAttributeKey.SetTemp).max,
                ArcColor = CSS_Color.BackgroundColor,
@@ -252,7 +252,7 @@
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.state.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
HDL_ON/UI/UI2/FuntionControlView/FoolHeating/FloorHeatingPageBLL.cs
@@ -13,7 +13,7 @@
        {
            try
            {
                Application.RunOnMainThread(() =>
                Application.RunOnMainThread((Action)(() =>
                {
                    if (bodyView == null)
                    {
@@ -37,7 +37,7 @@
                    //    bodyView.arcBar.IsOffline = true;
                    //}
                    if (updateTemp.trait_on_off.curValue.ToString() == "on")
                    if (updateTemp.trait_on_off.state.ToString() == "on")
                    {
                        bodyView.arcBar.IsOffline = false;
                        bodyView.btnSwitch.IsSelected = true;
@@ -60,7 +60,7 @@
                    }
                });
                }));
            }
            catch (Exception ex)
            {
@@ -101,7 +101,7 @@
        {
            btnMinus.MouseUpEventHandler = (sender, e) =>
            {
                if(function.trait_on_off.curValue.ToString() == "off")
                if(function.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -121,7 +121,7 @@
            };
            btnPlus.MouseUpEventHandler = (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -159,7 +159,7 @@
        {
            btnMode.MouseUpEventHandler = (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -169,8 +169,8 @@
            btnSwitch.MouseUpEventHandler = (sender, e) =>
            {
                btnSwitch.IsSelected = !btnSwitch.IsSelected;
                function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                if (function.trait_on_off.curValue.ToString() == "on")
                function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                if (function.trait_on_off.state.ToString() == "on")
                {
                    //arcBar.ProgressBarColor = CSS_Color.MainColor;
                    arcBar.ThumbImagePath = "FunctionIcon/FloorHeating/DiyThumbIconOn.png";
@@ -185,7 +185,7 @@
                    arcBar.IsOffline = true;
                }
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                Control.Ins.SendWriteCommand(function, d);
               
            };
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs
@@ -150,7 +150,7 @@
                IsProgressTextShow = false,
            };
            controlView.AddChidren(dimmerBar);
            if (function.trait_on_off.curValue.ToString() == "on")
            if (function.trait_on_off.state.ToString() == "on")
            {
                dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
            }
@@ -308,7 +308,7 @@
                Height = Application.GetRealWidth(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "on",
                IsSelected = function.trait_on_off.state.ToString() == "on",
            };
            controlView.AddChidren(btnSwitch);
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
@@ -12,7 +12,7 @@
        /// </summary>
        public static void UpdataStatus(Function updataTemp)
        {
            Application.RunOnMainThread(() =>
            Application.RunOnMainThread((Action)(() =>
            {
                try
                {
@@ -20,7 +20,7 @@
                        return;
                    if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid)
                    {
                        if (updataTemp.trait_on_off.curValue.ToString() == "on")
                        if (updataTemp.trait_on_off.state.ToString() == "on")
                        {
                            bodyView.dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                            if (!bodyView.onDimmerBar)
@@ -34,8 +34,8 @@
                        {
                            bodyView.dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
                        }
                        bodyView.btnSwitch.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on";
                        bodyView.barColorTemplatrue.Enable = updataTemp.trait_on_off.curValue.ToString() == "on";
                        bodyView.btnSwitch.IsSelected = updataTemp.trait_on_off.state.ToString() == "on";
                        bodyView.barColorTemplatrue.Enable = updataTemp.trait_on_off.state.ToString() == "on";
                        var cct = 27;
                        int.TryParse(updataTemp.GetAttrState(FunctionAttributeKey.CCT), out cct);
                        bodyView.barColorTemplatrue.Progress = cct / 100;
@@ -48,7 +48,7 @@
                {
                    MainPage.Log($"{bodyView.GetType().Name } UpdataStates error : {ex.Message}");
                }
            });
            }));
        }
        void LoadEventList()
@@ -202,9 +202,9 @@
                }
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                    d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
                    if (btnSwitch.IsSelected)
                    {
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
@@ -144,7 +144,7 @@
                IsProgressTextShow = false,
            };
            controlView.AddChidren(dimmerBar);
            if(function.trait_on_off.curValue.ToString() == "on")
            if(function.trait_on_off.state.ToString() == "on")
            {
                dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
            }
@@ -242,7 +242,7 @@
                Height = Application.GetMinRealAverage(40),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "on",
                IsSelected = function.trait_on_off.state.ToString() == "on",
            };
            controlView.AddChidren(btnSwitch);
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPageBLL.cs
@@ -12,7 +12,7 @@
        /// </summary>
        public static void UpdataStates(Function updataTemp)
        {
            Application.RunOnMainThread((() =>
            Application.RunOnMainThread((Action)(() =>
            {
                try
                {
@@ -22,7 +22,7 @@
                    {
                        bodyView.btnBrightnessText.Text = updataTemp.GetAttrState(FunctionAttributeKey.Brightness) + "%";
                        bodyView.btnBrightnessText.Y = ((100 - Convert.ToInt32( updataTemp.GetAttrState(FunctionAttributeKey.Brightness))) * Application.GetRealHeight(288 - 16 - 16) / 100) + Application.GetRealWidth(40);
                        if (updataTemp.trait_on_off.curValue.ToString() == "on")
                        if (updataTemp.trait_on_off.state.ToString() == "on")
                        {
                            bodyView.dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
                            if (!bodyView.onDimmerBar)
@@ -34,7 +34,7 @@
                        {
                            bodyView.dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
                        }
                        bodyView.btnSwitch.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on";
                        bodyView.btnSwitch.IsSelected = updataTemp.trait_on_off.state.ToString() == "on";
                    }
                }
                catch (Exception ex)
@@ -154,9 +154,9 @@
                }
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                    d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
                    if (btnSwitch.IsSelected)
                    {
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs
@@ -164,7 +164,7 @@
                ColorImagePath = "FunctionIcon/Light/ColorWheel.png",
            };
            framePickerBack.AddChidren(colorPicker);
            if(function.trait_on_off.curValue.ToString() == "off")
            if(function.trait_on_off.state.ToString() == "off")
            {
                colorPicker.ColorImagePath = "FunctionIcon/Light/ColorWheelGray.png";
            }
@@ -221,7 +221,7 @@
                ThumbImageHeight = Application.GetRealHeight(54),
                ProgressTextColor = CSS_Color.FirstLevelTitleColor,
                ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                ProgressBarColor = function.trait_on_off.curValue.ToString() == "on" ? CSS_Color.AuxiliaryColor1 : CSS_Color.DividingLineColor,
                ProgressBarColor = function.trait_on_off.state.ToString() == "on" ? CSS_Color.AuxiliaryColor1 : CSS_Color.DividingLineColor,
                MaxValue = 100,
                Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)),
                SeekBarPadding = Application.GetRealWidth(20),
@@ -328,7 +328,7 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.state.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs
@@ -11,7 +11,7 @@
        /// </summary>
        public static void UpdataStates(Function updateTemp)
        {
            Application.RunOnMainThread((() =>
            Application.RunOnMainThread((Action)(() =>
            {
                try
                {
@@ -20,7 +20,7 @@
                    if (updateTemp.spk == bodyView.function.spk && updateTemp.sid == bodyView.function.sid)
                    {
                        if (updateTemp.trait_on_off.curValue.ToString() == "on")
                        if (updateTemp.trait_on_off.state.ToString() == "on")
                        {
                            //解决部分安卓手机,刷新图片时会变小问题
                            if (bodyView.colorPicker.ColorImagePath != "FunctionIcon/Light/ColorWheel.png")
@@ -35,7 +35,7 @@
                            }
                        }
                        //状态一样时,不再刷新视图
                        else if (updateTemp.trait_on_off.curValue.ToString() == "off" && bodyView.btnSwitch.IsSelected == true)
                        else if (updateTemp.trait_on_off.state.ToString() == "off" && bodyView.btnSwitch.IsSelected == true)
                        {
                            //解决部分安卓手机,刷新图片时会变小问题
                            if (bodyView.colorPicker.ColorImagePath != "FunctionIcon/Light/ColorWheelGray.png")
@@ -95,7 +95,7 @@
            int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12);
            colorPicker.ColorChaged += (sender2, e2) => {
                if (function.trait_on_off.curValue.ToString() == "off" || pointIsRight == false)
                if (function.trait_on_off.state.ToString() == "off" || pointIsRight == false)
                {
                    //pointIsRight:点的区域不是圆盘内
                    return;
@@ -104,7 +104,7 @@
            };
            colorPicker.MouseDownEventHandler += (sender, e) =>
            {
                if (function.trait_on_off.curValue.ToString() == "off")
                if (function.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
@@ -150,7 +150,7 @@
            var colorChangeEvent = new System.Threading.Thread(() => {
                while (this.Parent != null)
                {
                    if (function.trait_on_off.curValue.ToString() == "off" || pointIsRight == false)
                    if (function.trait_on_off.state.ToString() == "off" || pointIsRight == false)
                    {
                        //pointIsRight:点的区域不是圆盘内
                        continue;
@@ -267,9 +267,9 @@
                bodyView.colorPicker.ColorImagePath = btnSwitch.IsSelected ? "FunctionIcon/Light/ColorWheel.png" : "FunctionIcon/Light/ColorWheelGray.png";
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.curValue.ToString());
                    d.Add(FunctionAttributeKey.OnOff, function.trait_on_off.state.ToString());
                    d.Add(FunctionAttributeKey.FadeTime, function.GetAttrState(FunctionAttributeKey.FadeTime));
                    if (btnSwitch.IsSelected)
                    {
@@ -296,7 +296,7 @@
        {
            btnRestoredPoint.MouseUpEventHandler = (sender, e) =>
            {
                if(function.trait_on_off.curValue.ToString() == "off")
                if(function.trait_on_off.state.ToString() == "off")
                {
                    return;
                }
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPage.cs
@@ -138,7 +138,7 @@
                Height = Application.GetRealWidth(288),
                UnSelectedImagePath = "FunctionIcon/Light/RelayBg.png",
                SelectedImagePath = "FunctionIcon/Light/RelayOnBg.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.state.ToString() == "on"
            };
            controlView.AddChidren(btnSwitchIcon);
@@ -150,7 +150,7 @@
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "Public/PowerClose.png",
                SelectedImagePath = "Public/PowerOpen.png",
                IsSelected = function.trait_on_off.curValue.ToString() == "on"
                IsSelected = function.trait_on_off.state.ToString() == "on"
            };
            controlView.AddChidren(btnSwitch);
HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs
@@ -11,7 +11,7 @@
        /// </summary>
        public static void UpdataState(Function updataTemp)
        {
            Application.RunOnMainThread(() =>
            Application.RunOnMainThread((Action)(() =>
            {
                try
                {
@@ -19,14 +19,14 @@
                        return;
                    if (updataTemp.spk == bodyView.function.spk && updataTemp.sid == bodyView.function.sid)
                    {
                        bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updataTemp.trait_on_off.curValue.ToString() == "on";
                        bodyView.btnSwitch.IsSelected = bodyView.btnSwitchIcon.IsSelected = updataTemp.trait_on_off.state.ToString() == "on";
                    }
                }
                catch (Exception ex)
                {
                    MainPage.Log($"RelayPage error {ex.Message}");
                }
            });
            }));
        }
        /// <summary>
        /// 加载事件列表
@@ -65,9 +65,9 @@
                btnSwitch.IsSelected = btnSwitchIcon.IsSelected = !btnSwitchIcon.IsSelected;
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitchIcon.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitchIcon.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("on_off", function.trait_on_off.curValue.ToString());
                    d.Add("on_off", function.trait_on_off.state.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
@@ -77,9 +77,9 @@
                btnSwitchIcon.IsSelected = btnSwitch.IsSelected = !btnSwitch.IsSelected;
                new System.Threading.Thread(() =>
                {
                    function.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
                    function.trait_on_off.state = btnSwitch.IsSelected ? "on" : "off";
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    d.Add("on_off", function.trait_on_off.curValue.ToString());
                    d.Add("on_off", function.trait_on_off.state.ToString());
                    DriverLayer.Control.Ins.SendWriteCommand(function, d);
                })
                { IsBackground = true }.Start();
HDL_ON/UI/UI2/FuntionControlView/Music/SendMethod.cs
@@ -219,16 +219,16 @@
            finally
            {
                #region 更新其他界面音乐状态
                Application.RunOnMainThread(() =>
                Application.RunOnMainThread((Action)(() =>
                {
                    a31MusicModel.trait_on_off.curValue = a31MusicModel.A31PlayStatus.status == "play" ? "on" : "off";
                    a31MusicModel.trait_on_off.state = a31MusicModel.A31PlayStatus.status == "play" ? "on" : "off";
                    //Console.WriteLine($"music : {a31MusicModel.sid} : {a31MusicModel.on_off}");
                    HomePage.UpdataFunctionStates(a31MusicModel);
                    foreach (var e in A31MusicModel.A31MusicModelList)
                    {
                        RoomPage.UpdataStates(a31MusicModel);
                    }
                });
                }));
                #endregion
            }
        }