2020-07-01 1.去掉读电能操作,去掉kwh状态显示。 2.当前是分享住宅,不允许删除备份。 3.进入搜索网关页面,切换到本地模式。 4.Alexa页面 增加添加设备失败提示。 5.子账号页面,底部增加文字提示。6.Android 默认隐藏底部虚拟按键。
2个文件已添加
17个文件已修改
426 ■■■■■ 已修改文件
Crabtree/.vs/SmartHome/xs/UserPrefs.xml 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide-shm 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide-wal 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/ON/Application.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/ON/Properties/AndroidManifest.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/ON/Resources/values/Styles.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/HDL/Operation/Control.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/MainPage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddResidence.cs 29 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToLight.cs 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToSocket.cs 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/SubaccountListView.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserMiddle.cs 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Crabtree/.vs/SmartHome/xs/UserPrefs.xml
@@ -1,36 +1,42 @@
<Properties StartupConfiguration="{1D83BF28-BA88-4152-BA41-D7EFE90A5437}|Default">
<Properties StartupConfiguration="{9D9EF20B-6E65-4A65-92BF-567EBF1E1443}|Default">
  <MonoDevelop.Ide.ItemProperties.ON.Droid PreferredExecutionTarget="Android.Android_Accelerated_Oreo" />
  <MonoDevelop.Ide.Workbench>
  <MonoDevelop.Ide.Workbench ActiveDocument="SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs">
    <Files>
      <File FileName="ON/Properties/AndroidManifest.xml" />
      <File FileName="SmartHome/UI/SimpleControl/CommonPage.cs" />
      <File FileName="SmartHome/UI/SimpleControl/MqttCommon.cs" Line="420" Column="27" />
      <File FileName="SmartHome/UI/SimpleControl/MainPage.cs" Line="417" Column="31" />
      <File FileName="ON.Ios/Info.plist" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs" Line="478" Column="23" />
      <File FileName="SmartHome/HDL/Operation/ResponseEntity/ErrorCode.cs" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToSocket.cs" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Register/SubaccountListView.cs" />
      <File FileName="ON/Application.cs" />
      <File FileName="SmartHome/Net/HttpListener.cs" />
      <File FileName="SmartHome/UI/SimpleControl/EquipmentPublicClass.cs" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/Schedule/HelpView.cs" />
      <File FileName="SmartHome/UI/SimpleControl/Phone/User/UserMiddle.cs" />
      <File FileName="SmartHome/UI/SimpleControl/MainPage.cs" />
      <File FileName="ON/Properties/AndroidManifest.xml" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="SmartHome" expanded="True">
            <Node name="ON.Droid" selected="True" />
            <Node name="ON.Droid" expanded="True" selected="True">
              <Node name="Properties" expanded="True" />
            </Node>
            <Node name="ON.Ios" expanded="True" />
            <Node name="Shared" expanded="True">
              <Node name="HDL" expanded="True">
                <Node name="Operation" expanded="True" />
                <Node name="Operation" expanded="True">
                  <Node name="ResponseEntity" expanded="True" />
                </Node>
              </Node>
              <Node name="Net" expanded="True" />
              <Node name="UI" expanded="True">
                <Node name="SimpleControl" expanded="True">
                  <Node name="Phone" expanded="True">
                    <Node name="AC" expanded="True" />
                    <Node name="Alexa" expanded="True" />
                    <Node name="Fan" expanded="True" />
                    <Node name="FoolHeat" expanded="True" />
                    <Node name="Light" expanded="True" />
                    <Node name="Register" expanded="True" />
                    <Node name="Schedule" expanded="True" />
                    <Node name="UniversalDevice" expanded="True" />
                    <Node name="Room" expanded="True" />
                    <Node name="User" expanded="True" />
                    <Node name="Warning" expanded="True" />
                  </Node>
                </Node>
              </Node>
Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide
Binary files differ
Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide-shm
Binary files differ
Crabtree/.vs/SmartHome/xs/sqlite3/storage.ide-wal
Binary files differ
Crabtree/ON/Application.cs
@@ -4,6 +4,7 @@
using Android.Content;
using Android.Net;
using Android.OS;
using Android.Views;
//using CN.Jpush.Android.Api;
//using CN.Jpush.Android.Service;
using Java.Lang;
@@ -125,7 +126,7 @@
            };
            Shared.Application.FontSize = 16;
            BaseActivity.IsHideVirualButtons = false;
            BaseActivity.IsHideVirualButtons = true;
            ZXing.Mobile.MobileBarcodeScanner.Initialize (this);
            init ();
            BaseActivity.OnCreateActoin += (activity, application) => {
@@ -350,5 +351,12 @@
            Shared.BusSocket.Start (6000);
        }
        void Hide () {
//            Window _window;
//            _window = this.GetWindow ();
//            WindowManager.LayoutParams params = _window.getAttributes ();
//params.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
//            _window.setAttributes (params);
        }
    }
}
Crabtree/ON/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtreenew" android:versionName="2.506221" android:versionCode="202006221">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hdl.crabtreenew" android:versionName="2.507011" android:versionCode="202007011">
    <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" />
    <!-- 在安卓P版本之后,必须要授予FOREGROUND_SERVICE权限,才能够使用前台服务 -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
Crabtree/ON/Resources/values/Styles.xml
@@ -7,7 +7,7 @@
    <item name="android:windowFullscreen">false</item>
    <!-- 隐藏标题栏 -->
    <item name="android:windowNoTitle">true</item>
        <item name="android:windowLightStatusBar">true</item>
    <item name="android:windowLightStatusBar">true</item>
    <item name="android:windowTranslucentStatus">true</item>  
    </style>
</resources>
Crabtree/SmartHome/HDL/Operation/Control.cs
@@ -388,13 +388,13 @@
        {
            add ();
            if (CommonPage.IsRemote && !isLocal) {
                if (!SmartHome.MqttCommon.IsGatewayOnline) {
                    System.Threading.Thread.Sleep (500);
                    Utlis.WriteLine ($"网关不在线 取消发送:" + SendFlag);
                    Packet.HaveSendCount = 3;
                    allDone.Set ();
                    return;
                }
                //if (!SmartHome.MqttCommon.IsGatewayOnline) {
                //    System.Threading.Thread.Sleep (500);
                //    Utlis.WriteLine ($"网关不在线 取消发送:" + SendFlag);
                //    Packet.HaveSendCount = 3;
                //    allDone.Set ();
                //    return;
                //}
                if (IsEnterBackground) {
                    System.Threading.Thread.Sleep (500);
                    Utlis.WriteLine ("已进入后台 取消发送");
Crabtree/SmartHome/UI/SimpleControl/CommonPage.cs
@@ -348,12 +348,14 @@
                                    UserDeviceToLight.UpdataEnergy (usefullBytes [0], updateFlag, usefullBytes [2] * 256 + usefullBytes [3]);
                                    UserRoom.UpdataEnergy (usefullBytes [0], common.Type + "_" + updateFlag, usefullBytes [2] * 256 + usefullBytes [3]);
                                    break;
                                } else if (usefullBytes [0] == 11) {
                                    UserDeviceToSocket.UpdataEnergy (usefullBytes [0], updateFlag, usefullBytes [2] * 256 * 256 * 256 + usefullBytes [3] * 256 * 256 + usefullBytes [4] * 256 + usefullBytes [5]);
                                    UserDeviceToLight.UpdataEnergy (usefullBytes [0], updateFlag, usefullBytes [2] * 256 * 256 * 256 + usefullBytes [3] * 256 * 256 + usefullBytes [4] * 256 + usefullBytes [5]);
                                    UserRoom.UpdataEnergy (usefullBytes [0], common.Type + "_" + updateFlag, usefullBytes [2] * 256 * 256 * 256 + usefullBytes [3] * 256 * 256 + usefullBytes [4] * 256 + usefullBytes [5]);
                                    break;
                                }
                                //2020-07-01 客户提出隐藏kwh
                                //else if (usefullBytes [0] == 11) {
                                //    UserDeviceToSocket.UpdataEnergy (usefullBytes [0], updateFlag, usefullBytes [2] * 256 * 256 * 256 + usefullBytes [3] * 256 * 256 + usefullBytes [4] * 256 + usefullBytes [5]);
                                //    UserDeviceToLight.UpdataEnergy (usefullBytes [0], updateFlag, usefullBytes [2] * 256 * 256 * 256 + usefullBytes [3] * 256 * 256 + usefullBytes [4] * 256 + usefullBytes [5]);
                                //    UserRoom.UpdataEnergy (usefullBytes [0], common.Type + "_" + updateFlag, usefullBytes [2] * 256 * 256 * 256 + usefullBytes [3] * 256 * 256 + usefullBytes [4] * 256 + usefullBytes [5]);
                                //    break;
                                //}
                            }
Crabtree/SmartHome/UI/SimpleControl/MainPage.cs
@@ -38,7 +38,7 @@
        //public static Button LogoButton = new Button ();
  
        public static string RequestVersion = "2.506221";
        public static string RequestVersion = "2.507011";
        public static UserInfo LoginUser;
        /// <summary>
        /// 是否是管理员权限(变更了,成员的时候,这个也为ture。为什么会声明这样变量,因为有些接口必须使用原来的Token)
@@ -153,7 +153,7 @@
        /// <summary>
        /// 增加rjfi
        /// 弹出错误提示
        /// </summary>
        /// <param name="tip">Tip.</param>
        /// <param name="time">Time.</param>
Crabtree/SmartHome/UI/SimpleControl/Phone/Alexa/AlexaDeviceListPage.cs
@@ -122,7 +122,11 @@
                                if (common != null) {
                                    var oldDevice = alexaDeviceLista.Find ((obj) => obj.SubnetID == common.SubnetID && obj.DeviceID == common.DeviceID && obj.LoopID == common.LoopID && obj.DeviceType == common.Type.ToString ());
                                    if (oldDevice == null) {
                                        AddDevice (common);
                                        var isSuccess = AddDevice (common);
                                        if (!isSuccess) {
                                            //跳出循环
                                            break;
                                        }
                                    }
                                }
                            }
@@ -356,7 +360,11 @@
                                            }
                                        }
                                        AddScene (uploadScene);
                                        var isSuccess = AddScene (uploadScene);
                                        if (!isSuccess) {
                                            //跳出循环
                                            break;
                                        }
                                    }
                                }
@@ -435,8 +443,12 @@
            var requestObj = new GetDeviceListObj () { RegionID = UserConfig.Instance.CurrentRegion.Id };
            var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
            var revertObj = MainPage.RequestHttps (API.GetDeviceList, requestJson);
            if (revertObj.StateCode.ToUpper() == "SUCCESS") {
                deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UpdateDeviceObj>> (revertObj.ResponseData.ToString());
            if (revertObj.StateCode.ToUpper () == "SUCCESS") {
                deviceList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<UpdateDeviceObj>> (revertObj.ResponseData.ToString ());
            } else {
                //2020-06-29 弹窗提示错误
            }
            return deviceList;
        }
@@ -462,8 +474,49 @@
            var revertObj = MainPage.RequestHttps (API.UploadDevices, requestJson);
            if (revertObj.StateCode.ToUpper() == "SUCCESS") {
                return true;
            }else if (revertObj.StateCode == "Exist") {
                Application.RunOnMainThread (() => {
                    MainPage.AddTip (ErrorCode.AddFailed + " " + ErrorCode.NameExist + " ( " + device.Name + " )");
                });
                return true;
            } else {
                //2020-06-29 弹出提示错误
                ShowUploadDevicesInfo (revertObj.StateCode);
            }
            return false;
        }
        /// <summary>
        /// 上传设备 错误提示
        /// </summary>
        /// <param name="stateCodeStr"></param>
        void ShowUploadDevicesInfo (string stateCodeStr)
        {
            string mes = "";
            if (stateCodeStr == "NoRecord") {
                //住宅未绑定网关!
                mes = ErrorCode.HomeNoRecord;
            } else if (stateCodeStr == "NoExist") {
                //住宅不存在!
                mes = ErrorCode.HomeNoExist;
            } else if (stateCodeStr == "Exist") {
                //设备名称已存在
                mes = ErrorCode.NameExist;
            } else if (stateCodeStr == ErrorCode.NetworkError) {
                mes = ErrorCode.NetworkError;
            } else {
                mes = ErrorCode.OperationFailed + ErrorCode.Reason + stateCodeStr;
            }
            if (!string.IsNullOrEmpty (mes)) {
                Application.RunOnMainThread (() => {
                    MainPage.AddTip (ErrorCode.AddFailed + " " + mes);
                    //new Alert ("", ErrorCode.AddFailed + " " + mes, Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                });
            }
        }
        /// <summary>
@@ -476,6 +529,9 @@
            var revertObj = MainPage.RequestHttps (API.DeleteDevice, requestJson);
            if (revertObj.StateCode.ToUpper() == "SUCCESS") {
                return true;
            } else {
                //2020-06-29 弹窗提示错误
            }
            return false;
        }
@@ -493,6 +549,8 @@
            var revertObj = MainPage.RequestHttps (API.GetSceneList, requestJson);
            if (revertObj.StateCode.ToUpper() == "SUCCESS") {
                sceneList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SceneByRegion>> (revertObj.ResponseData.ToString ());
            } else {
                //2020-06-29 弹窗提示错误
            }
            return sceneList;
        }
@@ -511,7 +569,16 @@
                //if (revertAddDeviceObj.StateCode.ToUpper() == "SUCCESS") {
                    return true;
                //}
            } else if (revertObj.StateCode == "Exist") {
                Application.RunOnMainThread (() => {
                    MainPage.AddTip (ErrorCode.AddFailed + " " + ErrorCode.NameExist + " ( " + sceneMark.SceneName + " )");
                });
                return true;
            } else {
                //2020-06-29 弹出提示错误
                ShowUploadDevicesInfo (revertObj.StateCode);
            }
            return false;
        }
@@ -539,6 +606,9 @@
            var revertObj = MainPage.RequestHttps (API.DeleteScene, requestJson);
            if (revertObj.StateCode.ToUpper() == "SUCCESS") {
                return true;
            } else {
                //2020-06-29 弹窗提示错误
            }
            return false;
        }
Crabtree/SmartHome/UI/SimpleControl/Phone/Guide/GuideAddResidence.cs
@@ -538,6 +538,26 @@
        }
        /// <summary>
        /// 启动本地模式
        /// </summary>
        void EnableLocalMode () {
            MainPage.AddTip ("Enable local mode.");
            Utlis.ShowAppLinkStatus (AppLinkStatus.WiFiOffline);
            CommonPage.IsRemote = false;
            SmartHome.MqttCommon.DisConnectRemoteMqttClient ("EnableLocalMode");
        }
        /// <summary>
        /// 启动远程模式
        /// </summary>
        void EnableRemoteMode ()
        {
            MainPage.AddTip ("Restore remote mode.");
            Utlis.ShowAppLinkStatus (AppLinkStatus.CloudUnlink);
            CommonPage.IsRemote = true;
        }
        /// <summary>
        ///  跳转网关搜索页面
        /// </summary>
        /// <param name="home"></param>
@@ -545,9 +565,12 @@
            try {
                //远程连接的时候禁止 搜索网关和添加设备
                if (CommonPage.IsRemote) {
                    //当前处于远程连接模式,无法进入搜索网关页面。请先切换回本地连接模式。
                    new Alert ("", "Currently in remote connection mode, unable to enter the search gateway page. Please switch back to local connection mode first.", Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                    return;
                    ////当前处于远程连接模式,无法进入搜索网关页面。请先切换回本地连接模式。
                    //new Alert ("", "Currently in remote connection mode, unable to enter the search gateway page. Please switch back to local connection mode first.", Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                    //return;
                    //2020-06-29 启动本地通信模式
                    EnableLocalMode ();
                }
Crabtree/SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToLight.cs
@@ -65,11 +65,13 @@
                                            if (btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Voltage") {
                                                btn.Text = energy.ToString () + " W";
                                            }
                                        } else if (updataType == 11) {
                                            if (btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") {
                                                btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h";
                                            }
                                        }
                                        ////2020-07-01 客户提出隐藏kwh
                                        //else if (updataType == 11) {
                                        //    if (btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") {
                                        //        btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h";
                                        //    }
                                        //}
                                    }
                                }
                            }
@@ -696,21 +698,21 @@
                                                };
                                                lightView.AddChidren (btnEnergy);
                                                EnergtLightList.Add (common);
                                                if (common.Type == DeviceType.LightEnergySwitch) {
                                                    Button btnElectric = new Button () {
                                                        Width = Application.GetRealWidth (200),
                                                        Height = Application.GetRealHeight (35),
                                                        X = Application.GetRealWidth (320),
                                                        Y = tempSwitch.Bottom,
                                                        TextAlignment = TextAlignment.CenterRight,
                                                        TextColor = SkinStyle.Current.TextColor1,
                                                        SelectedTextColor = SkinStyle.Current.TextColor1,
                                                        Tag = common.Type.ToString () + "_Electric",
                                                        Text = "0 kw.h"
                                                    };
                                                    lightView.AddChidren (btnElectric);
                                                }
                                                //2020-07-01 客户提出隐藏kwh
                                                //if (common.Type == DeviceType.LightEnergySwitch) {
                                                //    Button btnElectric = new Button () {
                                                //        Width = Application.GetRealWidth (200),
                                                //        Height = Application.GetRealHeight (35),
                                                //        X = Application.GetRealWidth (320),
                                                //        Y = tempSwitch.Bottom,
                                                //        TextAlignment = TextAlignment.CenterRight,
                                                //        TextColor = SkinStyle.Current.TextColor1,
                                                //        SelectedTextColor = SkinStyle.Current.TextColor1,
                                                //        Tag = common.Type.ToString () + "_Electric",
                                                //        Text = "0 kw.h"
                                                //    };
                                                //    lightView.AddChidren (btnElectric);
                                                //}
                                            }
                                            tempSwitch.MouseUpEventHandler += (sender3, e3) => {
@@ -727,7 +729,8 @@
                                                if (common.Type == DeviceType.LightEnergySwitch) {
                                                    new System.Threading.Thread (() => {
                                                        Control.ControlBytesSend (Command.ReadAnalogValue, light.SubnetID, light.DeviceID, new byte [] { 10, light.LoopID }, SendCount.Zero);
                                                        Control.ControlBytesSend (Command.ReadAnalogValue, light.SubnetID, light.DeviceID, new byte [] { 11, light.LoopID }, SendCount.Zero);
                                                        //2020-07-01 客户提出隐藏kwh
                                                        //Control.ControlBytesSend (Command.ReadAnalogValue, light.SubnetID, light.DeviceID, new byte [] { 11, light.LoopID }, SendCount.Zero);
                                                    }) { IsBackground = true }.Start ();
                                                }
                                            };
@@ -998,9 +1001,10 @@
                                        for (int i = 0; i < EnergtLightList.Count; i++) {
                                            var c = EnergtLightList [i];
                                            Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 10, c.LoopID }, SendCount.Zero);
                                            //if (c.Type == DeviceType.LightEnergySwitch) {
                                                Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero);
                                            //}
                                            ////if (c.Type == DeviceType.LightEnergySwitch) {
                                            ////2020-07-01 客户提出隐藏kwh
                                            //Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero);
                                            ////}
                                            System.Threading.Thread.Sleep (200);
                                        }
                                        System.Threading.Thread.Sleep (10000);
Crabtree/SmartHome/UI/SimpleControl/Phone/Light/UserDeviceToSocket.cs
@@ -67,11 +67,13 @@
                                            if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Voltage" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Voltage") {
                                                btn.Text = energy.ToString () + " W";
                                            }
                                        } else if (updataType == 11) {
                                            if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Electric" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") {
                                                btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h";
                                            }
                                        }
                                        ////2020-07-01 客户提出隐藏kwh
                                        //else if (updataType == 11) {
                                        //    if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Electric" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") {
                                        //        btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h";
                                        //    }
                                        //}
                                    }
                                }
                            }
@@ -482,21 +484,21 @@
                        };
                        lightView.AddChidren (btnEnergy);
                        EnergtLightList.Add (common);
                        //if (common.Type == DeviceType.LightEnergySwitch) {
                            Button btnElectric = new Button () {
                                Width = Application.GetRealWidth (200),
                                Height = Application.GetRealHeight (35),
                                X = Application.GetRealWidth (320),
                                Y = tempSwitch.Bottom,
                                TextColor = SkinStyle.Current.TextColor1,
                                SelectedTextColor = SkinStyle.Current.TextColor1,
                                TextAlignment = TextAlignment.CenterRight,
                                Tag = common.Type.ToString () + "_Electric",
                                Text = "0 kw.h"
                            };
                            lightView.AddChidren (btnElectric);
                        //}
                        //2020-07-01 客户提出隐藏kwh
                        ////if (common.Type == DeviceType.LightEnergySwitch) {
                        //Button btnElectric = new Button () {
                        //        Width = Application.GetRealWidth (200),
                        //        Height = Application.GetRealHeight (35),
                        //        X = Application.GetRealWidth (320),
                        //        Y = tempSwitch.Bottom,
                        //        TextColor = SkinStyle.Current.TextColor1,
                        //        SelectedTextColor = SkinStyle.Current.TextColor1,
                        //        TextAlignment = TextAlignment.CenterRight,
                        //        Tag = common.Type.ToString () + "_Electric",
                        //        Text = "0 kw.h"
                        //    };
                        //    lightView.AddChidren (btnElectric);
                        ////}
                        Button btnEnergyNull = new Button () {
                            Y = Application.GetRealHeight (127),
@@ -513,7 +515,8 @@
                while (readEnergy) {
                    foreach (var c in EnergtLightList) {
                        Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 10, c.LoopID }, SendCount.Zero);
                        Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero);
                        //2020-07-01 客户提出隐藏kwh
                        //Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero);
                        System.Threading.Thread.Sleep (200);
                    }
                    Thread.Sleep (10000);
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs
@@ -78,10 +78,10 @@
            };
#if DEBUG
            etAccount.Text = "18926269190@189.cn";
            //etAccount.Text = "18926269190@189.cn";
            //etAccount.Text = "721343314@qq.com";
            //etAccount.Text = "crabtreel12019@gmail.com";
            //etAccount.Text = "2791308028@qq.com";
            etAccount.Text = "2791308028@qq.com";
#endif
            accountView.AddChidren (etAccount);
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/Databackup.cs
@@ -390,7 +390,12 @@
                alert.Show ();
            };
            if (MainPage.LoginUser.AccountType != 1) {
            //if (MainPage.LoginUser.AccountType != 1) {
            //    rowView.AddRightView (btnDelFile);
            //}
            //2020-07-01 当前住宅属于自己的 允许删除备份
            if (!MainPage.IsAdministrator) {
                rowView.AddRightView (btnDelFile);
            }
Crabtree/SmartHome/UI/SimpleControl/Phone/Register/SubaccountListView.cs
@@ -58,6 +58,11 @@
            topView.AddChidren (ItemButton);
            #endregion
            //2020-07-01
            if (UserConfig.Instance.CurrentRegion != null && !string.IsNullOrEmpty (UserConfig.Instance.CurrentRegion.Name)) {
                NameButton.Text = UserConfig.Instance.CurrentRegion.Name;
            }
            EventHandler<MouseEventArgs> addSubaccountHandler = (sender, e) => {
                modifySubaccount (null);
            };
@@ -109,13 +114,34 @@
            VerticalScrolViewLayout contentView = new VerticalScrolViewLayout () {
                Y = topUserMsgView.Bottom,
                Height = Application.GetRealHeight (1136) - topUserMsgView.Bottom,
                Height = Application.GetRealHeight (1136-80) - topUserMsgView.Bottom,
                BackgroundColor = SkinStyle.Current.ViewColor,
                ScrollEnabled = false,
            };
            AddChidren (contentView);
            //#region
            ////当前住宅
            //FrameLayout homeView = new FrameLayout () {
            //    Height = Application.GetRealHeight (100),
            //    BackgroundColor = SkinStyle.Current.Transparent
            //};
            //contentView.AddChidren (homeView);
            //Button btnHomeText = new Button () {
            //    X = Application.GetRealWidth (40),
            //    Width = Application.GetRealWidth (600),
            //    //TextID = R.MyInternationalizationString.Subaccount,
            //    TextAlignment = TextAlignment.CenterLeft,
            //    TextColor = SkinStyle.Current.TextColor1,
            //};
            //homeView.AddChidren (btnHomeText);
            //if (UserConfig.Instance.CurrentRegion != null && !string.IsNullOrEmpty (UserConfig.Instance.CurrentRegion.Name)) {
            //    btnHomeText.Text = "Current residence: " + UserConfig.Instance.CurrentRegion.Name;
            //}
            //#endregion
            FrameLayout subaccountView = new FrameLayout () {
                Height = Application.GetRealHeight (50),
                BackgroundColor = SkinStyle.Current.MainColor
@@ -145,6 +171,23 @@
            addSubaccountList ();
            addTipView ();
        }
        void addTipView () {
            var TipView = new Button () {
                Width = LayoutParams.MatchParent,
                Y = Application.GetRealHeight (Application.DesignHeight - 80),
                Height = Application.GetRealHeight (80),
                BackgroundColor = 0xFFFFFFE0,
                TextSize = 11,
                TextColor = 0xFF1F1F1F,
                TextAlignment = TextAlignment.Center,
                IsMoreLines = true,
                Text = "Manage the member list of the current residence and share it to other accounts. \n Tips: You need to add the registered member account.",
            };
            AddChidren (TipView);
        }
        void addSubaccountList ()
Crabtree/SmartHome/UI/SimpleControl/Phone/Room/UserRoom.cs
@@ -59,11 +59,13 @@
                                            if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Voltage" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Voltage") {
                                                btn.Text = energy.ToString () + " W";
                                            }
                                        } else if (updataType == 11) {
                                            if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Electric" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") {
                                                btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h";
                                            }
                                        }
                                        //2020-07-01 客户提出隐藏kwh
                                        //else if (updataType == 11) {
                                        //    if (btn.Tag.ToString () == DeviceType.LightEnergySocket.ToString () + "_Electric" || btn.Tag.ToString () == DeviceType.LightEnergySwitch.ToString () + "_Electric") {
                                        //        btn.Text = ((double)(Convert.ToDouble (energy) / 10)).ToString () + " kw.h";
                                        //    }
                                        //}
                                    }
                                }
                            }
@@ -1851,19 +1853,19 @@
                                };
                                DeviceRowView.AddChidren (btnEnergy);
                                EnergtLightList.Add (devcieCommon);
                                Button btnElectric = new Button () {
                                    Width = Application.GetRealWidth (200),
                                    Height = Application.GetRealHeight (35),
                                    X = Application.GetRealWidth (320),
                                    Y = tempSwitch.Bottom,
                                    TextColor = SkinStyle.Current.TextColor1,
                                    TextAlignment = TextAlignment.CenterRight,
                                    SelectedTextColor = SkinStyle.Current.TextColor1,
                                    Tag = devcieCommon.Type.ToString () + "_Electric",
                                    Text = "0 kw.h"
                                };
                                DeviceRowView.AddChidren (btnElectric);
                                //2020-07-01 客户提出隐藏kwh
                                //Button btnElectric = new Button () {
                                //    Width = Application.GetRealWidth (200),
                                //    Height = Application.GetRealHeight (35),
                                //    X = Application.GetRealWidth (320),
                                //    Y = tempSwitch.Bottom,
                                //    TextColor = SkinStyle.Current.TextColor1,
                                //    TextAlignment = TextAlignment.CenterRight,
                                //    SelectedTextColor = SkinStyle.Current.TextColor1,
                                //    Tag = devcieCommon.Type.ToString () + "_Electric",
                                //    Text = "0 kw.h"
                                //};
                                //DeviceRowView.AddChidren (btnElectric);
                            }
                            tempSwitch.MouseUpEventHandler += (sender3, e3) => {
                                //tempSwitch.IsSelected = !tempSwitch.IsSelected;
@@ -1881,7 +1883,8 @@
                                if (devcieCommon.Type == DeviceType.LightEnergySocket || devcieCommon.Type == DeviceType.LightEnergySwitch) {
                                    new System.Threading.Thread (() => {
                                        Control.ControlBytesSend (Command.ReadAnalogValue, switchLight.SubnetID, switchLight.DeviceID, new byte [] { 10, switchLight.LoopID }, SendCount.Zero);
                                        Control.ControlBytesSend (Command.ReadAnalogValue, switchLight.SubnetID, switchLight.DeviceID, new byte [] { 11, switchLight.LoopID }, SendCount.Zero);
                                        //2020-07-01 客户提出隐藏kwh
                                        //Control.ControlBytesSend (Command.ReadAnalogValue, switchLight.SubnetID, switchLight.DeviceID, new byte [] { 11, switchLight.LoopID }, SendCount.Zero);
                                    }) { IsBackground = true }.Start ();
                                }
                            };
@@ -2308,7 +2311,8 @@
                                
                                var c = EnergtLightList [i];
                                Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 10, c.LoopID }, SendCount.Zero);
                                Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero);
                                //2020-07-01 客户提出隐藏kwh
                                //Control.ControlBytesSend (Command.ReadAnalogValue, c.SubnetID, c.DeviceID, new byte [] { 11, c.LoopID }, SendCount.Zero);
#if DEBUG
                                Application.RunOnMainThread (() => {
                                    Utlis.WriteLine ($"读取 { c.Name } 电能");
Crabtree/SmartHome/UI/SimpleControl/Phone/User/UserMiddle.cs
@@ -26,7 +26,7 @@
        //public static Button LinkStatusTip = new Button () {
        //    Height = Application.GetRealHeight (36),
        //    Width = Application.GetRealWidth (640),
        //    Width = Application.GetRealWidth (Application.DesignWidth),
        //    BackgroundColor = SkinStyle.Current.LinkStatusTipColor
        //};
@@ -34,33 +34,33 @@
            IsShowPoint = false,
        };
        public static FrameLayout FavoriteBodyView = new FrameLayout () {
            Width = Application.GetRealWidth (640),
            Height = Application.GetRealHeight (1136)
            //Width = Application.GetRealWidth (Application.DesignWidth),
            //Height = Application.GetRealHeight (Application.DesignHeight)
        };
        public static UserRoom FavoriteRoom = new UserRoom () {
            Width = Application.GetRealWidth (640),
            Height = Application.GetRealHeight (1136 - 90)
            //Width = Application.GetRealWidth (Application.DesignWidth),
            Height = Application.GetRealHeight (Application.DesignHeight - userMenuItemHeight)
        };
        public static PageLayout DevicePageView = new PageLayout () {
            IsShowPoint = false,
        };
        public static FrameLayout DeviceBodyView = new FrameLayout () {
            Width = Application.GetRealWidth (640),
            Height = Application.GetRealHeight (1136)
            //Width = Application.GetRealWidth (Application.DesignWidth),
            Height = Application.GetRealHeight (Application.DesignHeight)
        };
        public static VerticalScrolViewLayout DeviceView = new VerticalScrolViewLayout () {
            Y = Application.GetRealHeight (126),
            Width = Application.GetRealWidth (640),
            Height = Application.GetRealHeight (1136 - 126 - 90),
            //Width = Application.GetRealWidth (Application.DesignWidth),
            Height = Application.GetRealHeight (Application.DesignHeight - 126 - userMenuItemHeight),
        };
        public static PageLayout RoomPageView = new PageLayout () {
            IsShowPoint = false,
        };
        public static FrameLayout RoomBodyView = new FrameLayout () {
            Width = Application.GetRealWidth (640),
            Height = Application.GetRealHeight (1136)
            Width = Application.GetRealWidth (Application.DesignWidth),
            Height = Application.GetRealHeight (Application.DesignHeight)
        };
        public static PageLayout SettingPageView = new PageLayout () {
@@ -68,18 +68,18 @@
        };
        public static FrameLayout SettingBodyView = new FrameLayout () {
            BackgroundColor = SkinStyle.Current.MainColor,
            Height = Application.GetRealHeight (1136)
            Height = Application.GetRealHeight (Application.DesignHeight)
        };
        public static VerticalScrolViewLayout SettingView = new VerticalScrolViewLayout () {
            Y = Application.GetRealHeight (126),
            Width = Application.GetRealWidth (640),
            Height = Application.GetRealHeight (1136 - 126 - 90 - 90),
            Width = Application.GetRealWidth (Application.DesignWidth),
            Height = Application.GetRealHeight (Application.DesignHeight - 126 - userMenuItemHeight - 90),
            BackgroundColor = SkinStyle.Current.ViewColor,
            //ScrollEnabled = true
        };
        public static Button btnVersion = new Button () {
            Y = Application.GetRealHeight (1136 - 90 - 90),
            Width = Application.GetRealWidth (640),
            Y = Application.GetRealHeight (Application.DesignHeight - userMenuItemHeight - 90),
            Width = Application.GetRealWidth (Application.DesignWidth),
            Height = Application.GetRealHeight (90),
            Text = Language.StringByID (R.MyInternationalizationString.Version) + " : " + MainPage.RequestVersion,
            TextColor = SkinStyle.Current.TextColor1,
@@ -88,8 +88,8 @@
        };
        public static FrameLayout UserMenuItem = new FrameLayout () {
            Y = Application.GetRealHeight (Application.DesignHeight - 90),
            Height = Application.GetRealHeight (95),
            Y = Application.GetRealHeight (Application.DesignHeight - userMenuItemHeight),
            Height = Application.GetRealHeight (userMenuItemHeight+5),
            BackgroundColor = SkinStyle.Current.MainColor
        };
@@ -269,9 +269,11 @@
                                    //2020-01-14 登录成功后,刷新一次当前住宅网关
                                    GetNowHomeGatewayAfterLoginSuccess ();
                                } else if (!string.IsNullOrEmpty (revertObj.StateCode)) {
                                    MainPage.LoginUser.LastTime = DateTime.Now.AddDays (-30);
                                    MainPage.LoginUser.SaveUserInfo ();
                                    new AccountLogin ().Show ();
                                    if (revertObj.StateCode != ErrorCode.NetworkError && revertObj.StateCode != "Data Exception") {
                                        MainPage.LoginUser.LastTime = DateTime.Now.AddDays (-30);
                                        MainPage.LoginUser.SaveUserInfo ();
                                        new AccountLogin ().Show ();
                                    }
                                }
                            });
                        }