From e74f8bfbe6c52f220deef5fc99a53c3a7872808d Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期二, 11 四月 2023 17:08:34 +0800
Subject: [PATCH] Merge branch 'Dev-Wxr' into wjc

---
 HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs                             |    6 
 HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage.cs                |  585 +++++++++++
 HDL-ON_Android/Properties/AndroidManifest.xml                             |    2 
 HDL_ON/UI/UI2/1-HomePage/HomePage.cs                                      |    2 
 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs            |  150 ++
 HDL-ON_Android/Assets/Language.ini                                        |  193 ++-
 HDL-ON_iOS/HDL-ON_iOS.csproj                                              |    4 
 HDL_ON/Common/ApiUtlis.cs                                                 |   75 +
 HDL_ON/DAL/Mqtt/MqttClient.cs                                             |   20 
 HDL_ON/HDL_ON.projitems                                                   |    7 
 HDL-ON_Android/HDL-ON_Android.csproj                                      |    1 
 HDL_ON/UI/UI0-Public/DiySelectPopupDialog.cs                              |    8 
 HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs        |    3 
 HDL-ON_iOS/Info.plist                                                     |    2 
 HDL-ON_iOS/Resources/Language.ini                                         |  221 +++-
 HDL_ON/DAL/Server/NewApiRes.cs                                            |    5 
 HDL-ON_Android/Resources/Resource.designer.cs                             |    2 
 HDL_ON/DAL/DriverLayer/Control.cs                                         |   68 +
 HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs                  |   11 
 SiriIntents/Server/HttpUtil.cs                                            |    4 
 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs |  159 ++
 ys/ys.csproj                                                              |    5 
 HDL_ON/Entity/FunctionList.cs                                             |    6 
 HDL_ON/Entity/Function/Function.cs                                        |   28 
 HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs                     |    5 
 HDL_ON/UI/UI2/2-Classification/FunctionPage.cs                            |    5 
 HDL_ON/DAL/Server/HttpUtil.cs                                             |   14 
 HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs     | 1228 +++---------------------
 HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs                      |    5 
 HDL_ON/Common/R.cs                                                        |    5 
 HDL_ON/DAL/Server/HttpServerRequest.cs                                    |  106 ++
 HDL_ON/Common/Utlis/FloorRoomSelectPopupView.cs                           |    4 
 HDL_ON/DAL/DriverLayer/Control_TcpClient.cs                               |    5 
 HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs                             |    4 
 34 files changed, 1,656 insertions(+), 1,292 deletions(-)

diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index 0ca0dab..d5ce5d0 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -585,7 +585,7 @@
 598=Select device
 599=Please input name
 600=Add combined dimming
-
+601=Please select two or more devices
 
 
 
@@ -951,23 +951,6 @@
 
  
  
-6000=Rename
-6001=Please enter a name
-6002=Xiaodu
-6003=aispeech
-6004="Unbind requires a third-party APP for operation", "transfer to a third-party APP"
-6005=Unbind
-6006=Smart speaker
-6007=Control content
-6008=Failed to upload data
-6009=Failed to configure data
-6010="There is no speaker yet,", "Please go to the third-party APP to bind the smart speaker."
-6011=Modification of remarks is unsuccessful!
-6012=Do you want to unbind?
-6013=Unbinding...
-6014=transfer to third-party APP
-6015=Add speakers
- 
     
 7000=Create automation
 7001=Edit automation
@@ -1152,9 +1135,6 @@
 8511=User Education
 8512=Serial number
 8513=Model
-
-  
-
 
 
 
@@ -1860,6 +1840,7 @@
 598=閫夋嫨缇ゆ帶璁惧
 599=璇疯緭鍏ョ粍鍚嶇О
 600=娣诲姞缁勫悎璋冨厜
+601=璇烽�夋嫨涓や釜浠ヤ笂鐨勮澶�
 
 
 
@@ -2412,9 +2393,6 @@
 8511=鐢ㄦ埛浜哄憳
 8512=搴忓垪鍙�
 8513=鍨嬪彿
-
-
-
 
 
 
@@ -3116,6 +3094,7 @@
 598=Select device
 599=Please input name
 600=Add combined dimming
+601=Please select two or more devices
 
 
 
@@ -3378,6 +3357,8 @@
 5045=袨褋薪芯胁薪邪褟 谐褉芯屑泻芯褋褌褜
 5046=袪械谐褍谢懈褉芯胁泻邪 谐褉芯屑泻芯褋褌懈
 5047=小械褉胁懈褋"QQ music" 薪械 褍褋褌邪薪芯胁谢械薪 薪邪 胁邪褕械屑 屑芯斜懈谢褜薪芯屑 褌械谢械褎芯薪械, 锌芯卸邪谢褍泄褋褌邪, 锌械褉械泄写懈褌械 胁 褑械薪褌褉 锌褉懈谢芯卸械薪懈泄.
+5048= Progressive cycle
+5049=Single play
 
 6000=袧芯褉屑邪谢褜薪褘泄
 6001=小芯褋褌芯褟薪懈械 褍褋褌褉芯泄褋褌胁邪
@@ -3477,23 +3458,6 @@
 
 
 
-
-6000=袩械褉械懈屑械薪芯胁邪褌褜
-6001=袩芯卸邪谢褍泄褋褌邪, 胁胁械写懈褌械 薪邪蟹胁邪薪懈械
-6002=屑邪褉泻邪 Xiaodu
-6003=袪邪褋锌芯蟹薪邪胁邪褌械谢褜 褉械褔懈
-6004="袛谢褟 芯褌屑械薪褘 锌褉懈胁褟蟹泻懈 褌褉械斜褍械褌褋褟 褋褌芯褉芯薪薪械械 锌褉懈谢芯卸械薪懈械 ", "锌械褉械写邪褌褜 胁 褋褌芯褉芯薪薪械械 锌褉懈谢芯卸械薪懈械"
-6005=袨褌胁褟蟹邪褌褜
-6006=校屑薪褘泄 写懈薪邪屑懈泻
-6007=校锌褉邪胁谢械薪懈械 褋芯写械褉卸懈屑褘屑
-6008=袧械 褍写邪谢芯褋褜 蟹邪谐褉褍蟹懈褌褜 写邪薪薪褘械
-6009=袧械 褍写邪谢芯褋褜 薪邪褋褌褉芯懈褌褜 写邪薪薪褘械
-6010="袛懈薪邪屑懈泻 械褖械 薪械 褍褋褌邪薪芯胁谢械薪", "袩芯卸邪谢褍泄褋褌邪, 锌械褉械泄写懈褌械 胁 褋褌芯褉芯薪薪械械 锌褉懈谢芯卸械薪懈械, 褔褌芯斜褘 锌褉懈胁褟蟹邪褌褜 褋屑邪褉褌 写懈薪邪屑懈泻".
-6011=袠蟹屑械薪械薪懈械 锌褉懈屑械褔邪薪懈泄 薪械 褍写邪谢芯褋褜!
-6012=袙褘 褏芯褌懈褌械 芯褌屑械薪懈褌褜 锌褉懈胁褟蟹泻褍?
-6013=袨褌胁褟蟹褘胁邪薪懈械...
-6014=锌械褉械褏芯写 胁 褋褌芯褉芯薪薪械械 锌褉懈谢芯卸械薪懈械
-6015=袛芯斜邪胁懈褌褜 写懈薪邪屑懈泻懈
 
 
 7000=小芯蟹写邪褌褜 邪胁褌芯屑邪褌懈蟹邪褑懈褞
@@ -3651,6 +3615,34 @@
 7152=袩芯泻懈薪褍褌褜 懈谢懈 锌褉懈斜褘褌褜
 7153=袩芯泻懈薪褍褌褜
 7154=袩褉懈斜褘褌褜
+7155=Distress/Normal
+7156=Distress
+7157=whether to unlock
+7158=Is
+7159=Fall in the alarm
+7160=Someone called the police
+7161=Warning tone
+7162=Face to open the door
+7163=Video call
+7164=Manipulator
+7165=Area intrusion alarm
+7166=Camera
+7167=Main switch
+7168=PM10
+
+8501=Video door lock
+8502=Electric quantity
+8503=The door is now closed
+8504=The door is not closed
+8505=RVC
+8506=One click to open the lock
+8507=Temporary password
+8508=History
+8509=Fluorite video door lock
+8510=Call from the doorbell
+8511=User Education
+8512=Serial number
+8513=Model
 
 
 
@@ -4351,6 +4343,7 @@
 598=Select device
 599=Please input name
 600=Add combined dimming
+601=Please select two or more devices
 
 
 2532=Visitor Invitation Record
@@ -4612,6 +4605,8 @@
 5045=Volumen general
 5046=Ajustar volumen 
 5047="QQ music" no se ha instalado en su tel茅fono celular, proceda en el Centro de aplicaciones.
+5048= Progressive cycle
+5049=Single play
 
 6000=Normal 
 6001=Estado del dispositivo
@@ -4707,22 +4702,7 @@
 6093=El dispositivo no esta en linea
 6094=El dispositivo de puerta de enlace no existe
 6095=Mas de 30 botondes de adici贸n 
-6000=Renombrar
-6001=Introduzca el nombre
-6002=Xiaodu
-6003=aispeech
-6004=El sistema est谩 en mantenimiento ~ Int茅ntelo de nuevo m谩s tarde ~
-6005=Desvinculado
-6006=Altavoz inteligente
-6007=Controlar contenido
-6008=Error al cagar datos 
-6009=Error al configurar datos 
-6010="Todav铆a no hay altavoz", "Vaya a la aplicaci贸n de terceros para vincular el altavoz inteligente".
-6011=La modificaci贸n de los comentarios no tiene 茅xito
-6012=Quieres desvincularte? 
-6013=Desvinculaci贸n 
-6014=transferir a app de terceros 
-6015=A帽adir altavoces
+
 7000=Crear automatizaci贸n
 7001=Etidar automatizaci贸n
 7002=Si
@@ -4878,6 +4858,35 @@
 7152=Dejar o Arrivar a un lugar 
 7153=Salir 
 7154=Llegar 
+7155=Distress/Normal
+7156=Distress
+7157=whether to unlock
+7158=Is
+7159=Fall in the alarm
+7160=Someone called the police
+7161=Warning tone
+7162=Face to open the door
+7163=Video call
+7164=Manipulator
+7165=Area intrusion alarm
+7166=Camera
+7167=Main switch
+7168=PM10
+
+8501=Video door lock
+8502=Electric quantity
+8503=The door is now closed
+8504=The door is not closed
+8505=RVC
+8506=One click to open the lock
+8507=Temporary password
+8508=History
+8509=Fluorite video door lock
+8510=Call from the doorbell
+8511=User Education
+8512=Serial number
+8513=Model
+
 9000=Inicio sesi贸n con un nuevo n煤mero de tel茅fono celular 
 9001=Inicie sesi贸n con una nueva direcci贸n de correo el茅ctr贸nico 
 9002=Nuevo numero de celular revisado
@@ -5570,6 +5579,30 @@
 598=Select device
 599=Please input name
 600=Add combined dimming
+601=Please select two or more devices
+
+
+2532=Visitor Invitation Record
+2533=Visitor management
+2534=Visitor Invitation
+2535=Record
+2536=*After you initiate the visitor certificate, you can  unlock the door by password or swipe the code  freely within the validity period you set. Please share the certificate carefully.
+2537=Input phone number of the visitor
+2538=Input 6-digits temporary password
+2539=Random Generation
+2540=After confirmation, the visitor QR code will be generated, and the 6-digit dynamic digital password SMS will also be sent to the visitor mobile phone.
+2541=Are you sure to delete visitor credentials?
+2542=Long press the QR code to save the QR code to the album
+2543=QR code is invalid
+2544=Generate Visitor Credentials
+2545=Cancle Visitor Credentials
+2546=Visitor QR Code
+2547=Phone Number
+2548=Please enter a correct phone number
+2549=Please select a effective time
+2550=Please select a expire time
+2551=Temporary password is invalid
+
 
 
 1000=袙谢邪卸薪芯褋褌 胁 褋褌邪褟褌邪
@@ -5810,6 +5843,8 @@
 5045=小懈谢邪 薪邪 芯褋薪芯胁薪懈褟 蟹胁褍泻
 5046=袪械谐褍谢懈褉邪薪械 薪邪 蟹胁褍泻邪
 5047="鈥濹Q Music鈥� 薪械 械 懈薪褋褌邪谢懈褉邪薪 薪邪 胁邪褕懈褟 屑芯斜懈谢械薪 褌械谢械褎芯薪{\r\n}袦芯谢褟, 懈薪褋褌邪谢懈褉邪泄褌械 谐芯.
+5048= Progressive cycle
+5049=Single play
 
 6000=袧芯褉屑邪谢薪芯
 6001=小褗褋褌芯褟薪懈械 薪邪 褍褋褌褉芯泄褋褌胁芯褌芯
@@ -5910,22 +5945,6 @@
 
 
 
-6000=袩褉械懈屑械薪褍胁邪薪械
-6001=袦芯谢褟, 胁褗胁械写械褌械 懈屑械
-6002=Xiaodu
-6003=aispeech
-6004="袨褌胁褗褉蟹胁邪薪械褌芯 懈蟹懈褋泻胁邪 锌褉懈谢芯卸械薪懈械 薪邪 褌褉械褌邪 褋褌褉邪薪邪 蟹邪 褉邪斜芯褌邪", "锌褉械褏胁褗褉谢褟薪械 泻褗屑 锌褉懈谢芯卸械薪懈械 薪邪 褌褉械褌邪 褋褌褉邪薪邪"
-6005=袨褌胁褗褉蟹邪薪芯
-6006=校屑械薪 胁懈褋芯泻芯谐芯胁芯褉懈褌械谢
-6007=袣芯薪褌褉芯谢 薪邪 褋褗写褗褉卸邪薪懈械褌芯
-6008=袧械褍褋锌械褕薪芯 泻邪褔胁邪薪械 薪邪 写邪薪薪懈
-6009=袧械褍褋锌械褕薪芯 泻芯薪褎懈谐褍褉懈褉邪薪械 薪邪 写邪薪薪懈褌械
-6010="袙褋械 芯褖械 薪褟屑邪 胁懈褋芯泻芯谐芯胁芯褉懈褌械谢,", "袦芯谢褟, 芯褌懈写械褌械 胁 锌褉懈谢芯卸械薪懈械褌芯 薪邪 褌褉械褌邪 褋褌褉邪薪邪, 蟹邪 写邪 褋胁褗褉卸械褌械 懈薪褌械谢懈谐械薪褌薪懈褟 胁懈褋芯泻芯谐芯胁芯褉懈褌械谢."
-6011=袩褉芯屑褟薪邪褌邪 薪邪 蟹邪斜械谢械卸泻懈褌械 械 薪械褍褋锌械褕薪邪!
-6012=袠褋泻邪褌械 谢懈 写邪 芯褌胁褗褉卸械褌械?
-6013=袨褌胁褗褉蟹胁邪薪械...
-6014=锌褉械褏胁褗褉谢褟薪械 泻褗屑 锌褉懈谢芯卸械薪懈械 薪邪 褌褉械褌邪 褋褌褉邪薪邪
-6015=袛芯斜邪胁械褌械 胁懈褋芯泻芯谐芯胁芯褉懈褌械谢懈
 
 
 7000=袧芯胁邪 邪胁褌芯屑邪褌懈蟹邪褑懈褟
@@ -6083,6 +6102,34 @@
 7152=孝褉褗谐薪械褌械 懈谢懈 锌褉懈褋褌懈谐薪械褌械 薪邪 屑褟褋褌芯
 7153=袧邪锌褍褋泻邪薪械
 7154=袩褉懈褋褌懈谐邪薪械
+7155=Distress/Normal
+7156=Distress
+7157=whether to unlock
+7158=Is
+7159=Fall in the alarm
+7160=Someone called the police
+7161=Warning tone
+7162=Face to open the door
+7163=Video call
+7164=Manipulator
+7165=Area intrusion alarm
+7166=Camera
+7167=Main switch
+7168=PM10
+
+8501=Video door lock
+8502=Electric quantity
+8503=The door is now closed
+8504=The door is not closed
+8505=RVC
+8506=One click to open the lock
+8507=Temporary password
+8508=History
+8509=Fluorite video door lock
+8510=Call from the doorbell
+8511=User Education
+8512=Serial number
+8513=Model
 
 
 
diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj
index d26fef3..18901d3 100644
--- a/HDL-ON_Android/HDL-ON_Android.csproj
+++ b/HDL-ON_Android/HDL-ON_Android.csproj
@@ -411,6 +411,7 @@
     <AndroidAsset Include="Assets\h5\static\img\coal-save-ic.6c5fd125.png" />
     <AndroidAsset Include="Assets\h5\static\font\SourceHanSansCN-Normal.otf" />
     <AndroidAsset Include="Assets\Phone\MusicIcon\currentPlayList.png" />
+    <AndroidAsset Include="Assets\Phone\PersonalCenter\CombinedDimmingIcon.png" />
     <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\OneOpenLock.png" />
     <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\RTV.png" />
     <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\UnLocked.png" />
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index 3b360ad..f451081 100644
--- a/HDL-ON_Android/Properties/AndroidManifest.xml
+++ b/HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
 锘�<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.6.6" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202303221">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.7" package="com.hdl.onpro" xmlns:tools="http://schemas.android.com/tools" android:versionCode="202304111">
 	<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" />
 	<!--鍙嬬洘-->
 	<!--<uses-sdk android:minSdkVersion="8"></uses-sdk>-->
diff --git a/HDL-ON_Android/Resources/Resource.designer.cs b/HDL-ON_Android/Resources/Resource.designer.cs
index 2d4c546..4ace83c 100644
--- a/HDL-ON_Android/Resources/Resource.designer.cs
+++ b/HDL-ON_Android/Resources/Resource.designer.cs
@@ -14,7 +14,7 @@
 {
 	
 	
-	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
+	[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "12.2.8.165")]
 	public partial class Resource
 	{
 		
diff --git a/HDL-ON_iOS/HDL-ON_iOS.csproj b/HDL-ON_iOS/HDL-ON_iOS.csproj
index ddeb849..8958497 100644
--- a/HDL-ON_iOS/HDL-ON_iOS.csproj
+++ b/HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -68,7 +68,7 @@
         <WarningLevel>4</WarningLevel>
         <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
         <MtouchArch>ARM64</MtouchArch>
-        <CodesignKey>iPhone Distribution: HDL Automation Co., Ltd (BVTA78PRYA)</CodesignKey>
+        <CodesignKey>Apple Distribution: HDL Automation Co., Ltd (BVTA78PRYA)</CodesignKey>
         <MtouchLink>SdkOnly</MtouchLink>
         <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs>
         <MtouchI18n>cjk</MtouchI18n>
@@ -1544,6 +1544,8 @@
       <BundleResource Include="Resources\h5\static\img\equal-plant-ic.7ef6befa.png" />
       <BundleResource Include="Resources\h5\static\img\coal-save-ic.6c5fd125.png" />
       <BundleResource Include="Resources\h5\static\font\SourceHanSansCN-Normal.otf" />
+      <BundleResource Include="Resources\Phone\MusicIcon\currentPlayList.png" />
+      <BundleResource Include="Resources\Phone\PersonalCenter\CombinedDimmingIcon.png" />
       <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\Redistribution.png" />
       <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\DoorLock.png" />
       <BundleResource Include="Resources\Phone\FunctionIcon\DoorLock\OneOpenLock.png" />
diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist
index aa051fd..511589d 100644
--- a/HDL-ON_iOS/Info.plist
+++ b/HDL-ON_iOS/Info.plist
@@ -144,5 +144,7 @@
 	<string>LC Video will be use</string>
 	<key>NSLocationWhenInUseUsageDescription</key>
 	<string>EZ video will be use</string>
+	<key>UILaunchStoryboardName</key>
+	<string>LaunchScreen</string>
 </dict>
 </plist>
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
index dafbdd6..d5ce5d0 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -580,6 +580,13 @@
 593=Face photo
 594=Please enter member name
 595=Delete
+596=Group Name
+597=Please enter
+598=Select device
+599=Please input name
+600=Add combined dimming
+601=Please select two or more devices
+
 
 
 2532=Visitor Invitation Record
@@ -943,23 +950,6 @@
  
 
  
- 
-6000=Rename
-6001=Please enter a name
-6002=Xiaodu
-6003=aispeech
-6004="Unbind requires a third-party APP for operation", "transfer to a third-party APP"
-6005=Unbind
-6006=Smart speaker
-6007=Control content
-6008=Failed to upload data
-6009=Failed to configure data
-6010="There is no speaker yet,", "Please go to the third-party APP to bind the smart speaker."
-6011=Modification of remarks is unsuccessful!
-6012=Do you want to unbind?
-6013=Unbinding...
-6014=transfer to third-party APP
-6015=Add speakers
  
     
 7000=Create automation
@@ -1845,6 +1835,12 @@
 593=浜鸿劯鐓х墖
 594=璇疯緭鍏ユ垚鍛樺悕绉�
 595=鍒犻櫎浜鸿劯鏁版嵁
+596=缁勫悕绉�
+597=璇疯緭鍏�
+598=閫夋嫨缇ゆ帶璁惧
+599=璇疯緭鍏ョ粍鍚嶇О
+600=娣诲姞缁勫悎璋冨厜
+601=璇烽�夋嫨涓や釜浠ヤ笂鐨勮澶�
 
 
 
@@ -2383,6 +2379,7 @@
 7167=鎬绘帶寮�鍏�
 7168=PM10
 
+
 8501=瑙嗛闂ㄩ攣
 8502=鐢甸噺
 8503=褰撳墠闂ㄥ凡鍏�
@@ -2396,6 +2393,13 @@
 8511=鐢ㄦ埛浜哄憳
 8512=搴忓垪鍙�
 8513=鍨嬪彿
+
+
+
+
+
+
+
 
 
  
@@ -3085,6 +3089,12 @@
 593=Face photo
 594=Please enter member name
 595=Delete
+596=Group Name
+597=Please enter
+598=Select device
+599=Please input name
+600=Add combined dimming
+601=Please select two or more devices
 
 
 
@@ -3347,6 +3357,8 @@
 5045=袨褋薪芯胁薪邪褟 谐褉芯屑泻芯褋褌褜
 5046=袪械谐褍谢懈褉芯胁泻邪 谐褉芯屑泻芯褋褌懈
 5047=小械褉胁懈褋"QQ music" 薪械 褍褋褌邪薪芯胁谢械薪 薪邪 胁邪褕械屑 屑芯斜懈谢褜薪芯屑 褌械谢械褎芯薪械, 锌芯卸邪谢褍泄褋褌邪, 锌械褉械泄写懈褌械 胁 褑械薪褌褉 锌褉懈谢芯卸械薪懈泄.
+5048= Progressive cycle
+5049=Single play
 
 6000=袧芯褉屑邪谢褜薪褘泄
 6001=小芯褋褌芯褟薪懈械 褍褋褌褉芯泄褋褌胁邪
@@ -3446,23 +3458,6 @@
 
 
 
-
-6000=袩械褉械懈屑械薪芯胁邪褌褜
-6001=袩芯卸邪谢褍泄褋褌邪, 胁胁械写懈褌械 薪邪蟹胁邪薪懈械
-6002=屑邪褉泻邪 Xiaodu
-6003=袪邪褋锌芯蟹薪邪胁邪褌械谢褜 褉械褔懈
-6004="袛谢褟 芯褌屑械薪褘 锌褉懈胁褟蟹泻懈 褌褉械斜褍械褌褋褟 褋褌芯褉芯薪薪械械 锌褉懈谢芯卸械薪懈械 ", "锌械褉械写邪褌褜 胁 褋褌芯褉芯薪薪械械 锌褉懈谢芯卸械薪懈械"
-6005=袨褌胁褟蟹邪褌褜
-6006=校屑薪褘泄 写懈薪邪屑懈泻
-6007=校锌褉邪胁谢械薪懈械 褋芯写械褉卸懈屑褘屑
-6008=袧械 褍写邪谢芯褋褜 蟹邪谐褉褍蟹懈褌褜 写邪薪薪褘械
-6009=袧械 褍写邪谢芯褋褜 薪邪褋褌褉芯懈褌褜 写邪薪薪褘械
-6010="袛懈薪邪屑懈泻 械褖械 薪械 褍褋褌邪薪芯胁谢械薪", "袩芯卸邪谢褍泄褋褌邪, 锌械褉械泄写懈褌械 胁 褋褌芯褉芯薪薪械械 锌褉懈谢芯卸械薪懈械, 褔褌芯斜褘 锌褉懈胁褟蟹邪褌褜 褋屑邪褉褌 写懈薪邪屑懈泻".
-6011=袠蟹屑械薪械薪懈械 锌褉懈屑械褔邪薪懈泄 薪械 褍写邪谢芯褋褜!
-6012=袙褘 褏芯褌懈褌械 芯褌屑械薪懈褌褜 锌褉懈胁褟蟹泻褍?
-6013=袨褌胁褟蟹褘胁邪薪懈械...
-6014=锌械褉械褏芯写 胁 褋褌芯褉芯薪薪械械 锌褉懈谢芯卸械薪懈械
-6015=袛芯斜邪胁懈褌褜 写懈薪邪屑懈泻懈
 
 
 7000=小芯蟹写邪褌褜 邪胁褌芯屑邪褌懈蟹邪褑懈褞
@@ -3620,6 +3615,34 @@
 7152=袩芯泻懈薪褍褌褜 懈谢懈 锌褉懈斜褘褌褜
 7153=袩芯泻懈薪褍褌褜
 7154=袩褉懈斜褘褌褜
+7155=Distress/Normal
+7156=Distress
+7157=whether to unlock
+7158=Is
+7159=Fall in the alarm
+7160=Someone called the police
+7161=Warning tone
+7162=Face to open the door
+7163=Video call
+7164=Manipulator
+7165=Area intrusion alarm
+7166=Camera
+7167=Main switch
+7168=PM10
+
+8501=Video door lock
+8502=Electric quantity
+8503=The door is now closed
+8504=The door is not closed
+8505=RVC
+8506=One click to open the lock
+8507=Temporary password
+8508=History
+8509=Fluorite video door lock
+8510=Call from the doorbell
+8511=User Education
+8512=Serial number
+8513=Model
 
 
 
@@ -4315,7 +4338,12 @@
 593=Face photo
 594=Please enter member name
 595=Delete
-
+596=Group Name
+597=Please enter
+598=Select device
+599=Please input name
+600=Add combined dimming
+601=Please select two or more devices
 
 
 2532=Visitor Invitation Record
@@ -4577,6 +4605,8 @@
 5045=Volumen general
 5046=Ajustar volumen 
 5047="QQ music" no se ha instalado en su tel茅fono celular, proceda en el Centro de aplicaciones.
+5048= Progressive cycle
+5049=Single play
 
 6000=Normal 
 6001=Estado del dispositivo
@@ -4672,22 +4702,7 @@
 6093=El dispositivo no esta en linea
 6094=El dispositivo de puerta de enlace no existe
 6095=Mas de 30 botondes de adici贸n 
-6000=Renombrar
-6001=Introduzca el nombre
-6002=Xiaodu
-6003=aispeech
-6004=El sistema est谩 en mantenimiento ~ Int茅ntelo de nuevo m谩s tarde ~
-6005=Desvinculado
-6006=Altavoz inteligente
-6007=Controlar contenido
-6008=Error al cagar datos 
-6009=Error al configurar datos 
-6010="Todav铆a no hay altavoz", "Vaya a la aplicaci贸n de terceros para vincular el altavoz inteligente".
-6011=La modificaci贸n de los comentarios no tiene 茅xito
-6012=Quieres desvincularte? 
-6013=Desvinculaci贸n 
-6014=transferir a app de terceros 
-6015=A帽adir altavoces
+
 7000=Crear automatizaci贸n
 7001=Etidar automatizaci贸n
 7002=Si
@@ -4843,6 +4858,35 @@
 7152=Dejar o Arrivar a un lugar 
 7153=Salir 
 7154=Llegar 
+7155=Distress/Normal
+7156=Distress
+7157=whether to unlock
+7158=Is
+7159=Fall in the alarm
+7160=Someone called the police
+7161=Warning tone
+7162=Face to open the door
+7163=Video call
+7164=Manipulator
+7165=Area intrusion alarm
+7166=Camera
+7167=Main switch
+7168=PM10
+
+8501=Video door lock
+8502=Electric quantity
+8503=The door is now closed
+8504=The door is not closed
+8505=RVC
+8506=One click to open the lock
+8507=Temporary password
+8508=History
+8509=Fluorite video door lock
+8510=Call from the doorbell
+8511=User Education
+8512=Serial number
+8513=Model
+
 9000=Inicio sesi贸n con un nuevo n煤mero de tel茅fono celular 
 9001=Inicie sesi贸n con una nueva direcci贸n de correo el茅ctr贸nico 
 9002=Nuevo numero de celular revisado
@@ -5530,6 +5574,35 @@
 593=Face photo
 594=Please enter member name
 595=Delete
+596=Group Name
+597=Please enter
+598=Select device
+599=Please input name
+600=Add combined dimming
+601=Please select two or more devices
+
+
+2532=Visitor Invitation Record
+2533=Visitor management
+2534=Visitor Invitation
+2535=Record
+2536=*After you initiate the visitor certificate, you can  unlock the door by password or swipe the code  freely within the validity period you set. Please share the certificate carefully.
+2537=Input phone number of the visitor
+2538=Input 6-digits temporary password
+2539=Random Generation
+2540=After confirmation, the visitor QR code will be generated, and the 6-digit dynamic digital password SMS will also be sent to the visitor mobile phone.
+2541=Are you sure to delete visitor credentials?
+2542=Long press the QR code to save the QR code to the album
+2543=QR code is invalid
+2544=Generate Visitor Credentials
+2545=Cancle Visitor Credentials
+2546=Visitor QR Code
+2547=Phone Number
+2548=Please enter a correct phone number
+2549=Please select a effective time
+2550=Please select a expire time
+2551=Temporary password is invalid
+
 
 
 1000=袙谢邪卸薪芯褋褌 胁 褋褌邪褟褌邪
@@ -5770,6 +5843,8 @@
 5045=小懈谢邪 薪邪 芯褋薪芯胁薪懈褟 蟹胁褍泻
 5046=袪械谐褍谢懈褉邪薪械 薪邪 蟹胁褍泻邪
 5047="鈥濹Q Music鈥� 薪械 械 懈薪褋褌邪谢懈褉邪薪 薪邪 胁邪褕懈褟 屑芯斜懈谢械薪 褌械谢械褎芯薪{\r\n}袦芯谢褟, 懈薪褋褌邪谢懈褉邪泄褌械 谐芯.
+5048= Progressive cycle
+5049=Single play
 
 6000=袧芯褉屑邪谢薪芯
 6001=小褗褋褌芯褟薪懈械 薪邪 褍褋褌褉芯泄褋褌胁芯褌芯
@@ -5870,22 +5945,6 @@
 
 
 
-6000=袩褉械懈屑械薪褍胁邪薪械
-6001=袦芯谢褟, 胁褗胁械写械褌械 懈屑械
-6002=Xiaodu
-6003=aispeech
-6004="袨褌胁褗褉蟹胁邪薪械褌芯 懈蟹懈褋泻胁邪 锌褉懈谢芯卸械薪懈械 薪邪 褌褉械褌邪 褋褌褉邪薪邪 蟹邪 褉邪斜芯褌邪", "锌褉械褏胁褗褉谢褟薪械 泻褗屑 锌褉懈谢芯卸械薪懈械 薪邪 褌褉械褌邪 褋褌褉邪薪邪"
-6005=袨褌胁褗褉蟹邪薪芯
-6006=校屑械薪 胁懈褋芯泻芯谐芯胁芯褉懈褌械谢
-6007=袣芯薪褌褉芯谢 薪邪 褋褗写褗褉卸邪薪懈械褌芯
-6008=袧械褍褋锌械褕薪芯 泻邪褔胁邪薪械 薪邪 写邪薪薪懈
-6009=袧械褍褋锌械褕薪芯 泻芯薪褎懈谐褍褉懈褉邪薪械 薪邪 写邪薪薪懈褌械
-6010="袙褋械 芯褖械 薪褟屑邪 胁懈褋芯泻芯谐芯胁芯褉懈褌械谢,", "袦芯谢褟, 芯褌懈写械褌械 胁 锌褉懈谢芯卸械薪懈械褌芯 薪邪 褌褉械褌邪 褋褌褉邪薪邪, 蟹邪 写邪 褋胁褗褉卸械褌械 懈薪褌械谢懈谐械薪褌薪懈褟 胁懈褋芯泻芯谐芯胁芯褉懈褌械谢."
-6011=袩褉芯屑褟薪邪褌邪 薪邪 蟹邪斜械谢械卸泻懈褌械 械 薪械褍褋锌械褕薪邪!
-6012=袠褋泻邪褌械 谢懈 写邪 芯褌胁褗褉卸械褌械?
-6013=袨褌胁褗褉蟹胁邪薪械...
-6014=锌褉械褏胁褗褉谢褟薪械 泻褗屑 锌褉懈谢芯卸械薪懈械 薪邪 褌褉械褌邪 褋褌褉邪薪邪
-6015=袛芯斜邪胁械褌械 胁懈褋芯泻芯谐芯胁芯褉懈褌械谢懈
 
 
 7000=袧芯胁邪 邪胁褌芯屑邪褌懈蟹邪褑懈褟
@@ -6043,6 +6102,34 @@
 7152=孝褉褗谐薪械褌械 懈谢懈 锌褉懈褋褌懈谐薪械褌械 薪邪 屑褟褋褌芯
 7153=袧邪锌褍褋泻邪薪械
 7154=袩褉懈褋褌懈谐邪薪械
+7155=Distress/Normal
+7156=Distress
+7157=whether to unlock
+7158=Is
+7159=Fall in the alarm
+7160=Someone called the police
+7161=Warning tone
+7162=Face to open the door
+7163=Video call
+7164=Manipulator
+7165=Area intrusion alarm
+7166=Camera
+7167=Main switch
+7168=PM10
+
+8501=Video door lock
+8502=Electric quantity
+8503=The door is now closed
+8504=The door is not closed
+8505=RVC
+8506=One click to open the lock
+8507=Temporary password
+8508=History
+8509=Fluorite video door lock
+8510=Call from the doorbell
+8511=User Education
+8512=Serial number
+8513=Model
 
 
 
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index da5ba70..9661856 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -349,12 +349,77 @@
                             complateDevice = true;
                             MainPage.Log($"============璁惧============瀹屾垚" + FunctionList.List.Functions.Count);
                         }
-                        //})
-                        //{ IsBackground = true }.Start();
 
-                        ////===================鍦烘櫙==========================
-                        //new System.Threading.Thread(() =>
-                        //{
+
+#if DEBUG
+                        DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl = true;
+#endif
+                        if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
+                        {
+                            var pack = Ins.HttpRequest.GetGroupControlList();
+                            if (pack != null)
+                            {
+                                if (pack.Code == StateCode.SUCCESS)
+                                {
+                                    try
+                                    {
+                                        var groupControlList = JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString());
+                                        var readSidList = new List<string>();
+                                        foreach(var temp in groupControlList)
+                                        {
+                                            FunctionList.List.groupControls.Clear();
+                                            readSidList.Add(temp.userDeviceGroupControlId);
+                                            if (readSidList.Count >= 20)
+                                            {
+                                                var data = Ins.httpRequest.GetGroupControInfo(readSidList);
+                                                if(data != null)
+                                                {
+                                                    if(data.Code == StateCode.SUCCESS)
+                                                    {
+                                                        var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString());
+                                                        FunctionList.List.groupControls.AddRange(groupControlInfoList);
+                                                    }
+                                                    else
+                                                    {
+                                                        IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                                                    }
+                                                }
+                                                readSidList.Clear();
+                                            }
+                                        }
+                                        if (readSidList.Count > 0)
+                                        {
+                                            var data = Ins.httpRequest.GetGroupControInfo(readSidList);
+                                            if (data != null)
+                                            {
+                                                if (data.Code == StateCode.SUCCESS)
+                                                {
+                                                    var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString());
+                                                    FunctionList.List.groupControls.AddRange(groupControlInfoList);
+                                                }
+                                                else
+                                                {
+                                                    IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                                                }
+                                            }
+                                            readSidList.Clear();
+                                        }
+                                    }
+                                    catch (Exception ex)
+                                    {
+                                        MainPage.Log($"璇诲彇缁勬帶鍒楄〃澶辫触:{ex.Message}");
+                                    }
+                                }
+                                else
+                                {
+                                    IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                                }
+                            }
+                        }
+
+
+                    //})
+                    //{ IsBackground = true }.Start();
 
                         try
                         {
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index 2569013..beaacdf 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -4,7 +4,10 @@
 {
     public static class StringId
     {
-
+        /// <summary>
+        /// 璇烽�夋嫨2涓互涓婄殑璁惧
+        /// </summary>
+        public const int PlsSelectMoreData = 601;
         /// <summary>
         /// 娣诲姞缁勫悎璋冨厜
         /// </summary>
diff --git a/HDL_ON/Common/Utlis/FloorRoomSelectPopupView.cs b/HDL_ON/Common/Utlis/FloorRoomSelectPopupView.cs
index b6c1cb3..704758b 100644
--- a/HDL_ON/Common/Utlis/FloorRoomSelectPopupView.cs
+++ b/HDL_ON/Common/Utlis/FloorRoomSelectPopupView.cs
@@ -131,7 +131,7 @@
         /// <param name="i_listAllFun">鍏ㄩ儴鐨勮澶囧垪琛�,闇�瑕佹墜鍔ㄦ寚瀹�</param>
         /// <param name="SelectEvent">鏍规嵁閫夋嫨鐨勬潯浠�,绛涢�変箣鍚庣殑璁惧鍒楄〃(绗竴涓弬鏁版槸閫夋嫨鐨刄ID,涓嶇鏈夋病鏈夌敤,鎬讳箣鍏堣繑鍥�)</param>
         /// <param name="i_defultSelectId">榛樿鍝釜涓洪�夋嫨鐘舵��</param>
-        public void ShowDeviceFunctionView(Button btnFloor, List<Function> i_listAllFun, Action<string, List<Function>> SelectEvent, string i_defultSelectId = null)
+        public void ShowDeviceFunctionView(Button btnFloor, List<Function> i_listAllFun, Action<string, List<Function>> SelectEvent, string i_defultSelectId = null, int offsetY = 0)
         {
             //娓呯紦瀛�
             this.ClearMemory();
@@ -155,7 +155,7 @@
                 SelectEvent?.Invoke(this.nowShowSelectId, listDevice);
                 SelectEvent = null;
 
-            }, i_defultSelectId);
+            }, i_defultSelectId, offsetY);
         }
 
         /// <summary>
diff --git a/HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs b/HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs
index 6c86100..020c744 100644
--- a/HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs
+++ b/HDL_ON/Common/Utlis/FloorSelectPopupDialog.cs
@@ -30,7 +30,7 @@
         /// </summary>
         /// <param name="selectAction">鍥炶皟閫変腑浜嬩欢锛屽洖璋冮�変腑鐨剈id</param>
         /// <param name="selectTag">璁剧疆閫変腑鐨則ga鏍囪</param>
-        public void ShowView(Action<string> selectAction, string selectTag = DiySelectPopupDialog.ALLSELECT)
+        public void ShowView(Action<string> selectAction, string selectTag = DiySelectPopupDialog.ALLSELECT, int offsetY = 0)
         {
             //妤煎眰闆嗗悎鏁版嵁
             var floorList = SpatialInfo.CurrentSpatial.FloorList;
@@ -54,7 +54,7 @@
                 }
                 //寮圭獥涓�绾ц仈鍔ㄩ�夋嫨绐楀彛
                 var roomSelectPopupDialog = new DiySelectPopupDialog();
-                roomSelectPopupDialog.ShowView(mFirstList, null, selectAction, selectTag);
+                roomSelectPopupDialog.ShowView(mFirstList, null, selectAction, selectTag,offsetY);
             }
             else
             {
@@ -80,7 +80,7 @@
                 }
                 //寮圭獥浜岀骇鑱斿姩閫夋嫨绐楀彛
                 var roomSelectPopupDialog = new DiySelectPopupDialog();
-                roomSelectPopupDialog.ShowView(mFirstList, mSecondList, selectAction, selectTag);
+                roomSelectPopupDialog.ShowView(mFirstList, mSecondList, selectAction, selectTag,offsetY);
 
             }
  
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index bed293b..eeb2431 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -1175,11 +1175,62 @@
 
         }
 
+
         /// <summary>
         /// 鏇存柊璁惧鐘舵��
         /// A鍗忚鏁版嵁
         /// </summary>
-        /// <param name="updateBytes"></param>
+        public void UpdataGroupControlStatus(string revString, byte[] usefulBytes, bool isCloudData = false)
+        {
+            var temp = JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(revString);
+            if (temp != null)
+            {
+                Control_Udp.ReceiveRepeatManager(temp.id, usefulBytes);
+                var allLocalFuntion = FunctionList.List.groupControls;
+                foreach (var updateTemp in temp.objects)
+                {
+                    try
+                    {
+                        var localFunction = allLocalFuntion.Find((obj) => obj.sid == updateTemp.sid);
+                        if (localFunction == null)
+                        {
+                            continue;
+                        }
+                        MainPage.Log($"鏀跺埌鏁版嵁:{revString}");
+                        foreach (var attr in updateTemp.status)
+                        {
+                            localFunction.time_stamp = temp.time_stamp;
+                            localFunction.SetAttrState(attr.key, attr.value);
+
+                        }
+
+                        //鏇存柊鐣岄潰鐘舵��
+                        switch (localFunction.spk)
+                        {
+                            case SPK.ElectricEnergy:
+                                EnergyMainPage.UpdataStatus(localFunction);
+                                break;
+                        }
+
+                        HomePage.UpdataFunctionStates(localFunction);
+                        RoomPage.UpdataStates(localFunction);
+                        FunctionPage.UpdataStates(localFunction);
+                        ClassificationPage.UpdataInfo(localFunction);
+
+                    }
+                    catch (Exception ex)
+                    {
+                        MainPage.Log($"A鍗忚鏇存柊鐘舵�佸紓甯�:{ex.Message}");
+                    }
+                }
+            }
+        }
+
+
+        /// <summary>
+        /// 鏇存柊璁惧鐘舵��
+        /// A鍗忚鏁版嵁
+        /// </summary>
         public void UpdataFunctionStatus(string revString, byte[] usefulBytes, bool isCloudData = false)
         {
             ////test 浜戠杩炴帴鎴愬姛鏃讹紝涓嶉�傜敤鏈湴鏁版嵁鏇存柊
@@ -1231,11 +1282,16 @@
                             }
                         }
 
-                        if (SPK.MusicSpkList().Contains(localFunction.spk))
-                        {
-                            MainPage.Log($"闊充箰鏀跺埌鏁版嵁:{revString}");
-
-                        }
+                        //if (SPK.MusicSpkList().Contains(localFunction.spk))
+                        //{
+                        //    if (updateTemp.status.Count < 3)
+                        //    {
+                        //        ///鏄煶涔愬姛鑳界殑
+                        //        ///涓婃姤灞炴�у皯3鏉′笉鍋氬鐞�
+                        //        return;
+                        //    }
+                        //}
+                        MainPage.Log($"鏀跺埌鏁版嵁:{revString}");
                         foreach (var attr in updateTemp.status)
                         {
                             localFunction.time_stamp = temp.time_stamp;
diff --git a/HDL_ON/DAL/DriverLayer/Control_TcpClient.cs b/HDL_ON/DAL/DriverLayer/Control_TcpClient.cs
index c90eac3..251f039 100644
--- a/HDL_ON/DAL/DriverLayer/Control_TcpClient.cs
+++ b/HDL_ON/DAL/DriverLayer/Control_TcpClient.cs
@@ -295,7 +295,10 @@
                     }
                     finally
                     {
-                        heartBeatThread = null;
+                        if (heartBeatThread != null)
+                        {
+                            heartBeatThread = null;
+                        }
                         HeartBeat();
                     }
                 }
diff --git a/HDL_ON/DAL/Mqtt/MqttClient.cs b/HDL_ON/DAL/Mqtt/MqttClient.cs
index 2dde971..f5b5a83 100644
--- a/HDL_ON/DAL/Mqtt/MqttClient.cs
+++ b/HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -204,6 +204,12 @@
                         Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/event/irCodeStudyDone/up",
                         QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce
                     };
+                    //App璁㈤槄缇ゆ帶鐘舵�佷富棰�
+                    var groupControlStatus = new MqttTopicFilter()
+                    {
+                        Topic = $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/device/group/control/property/send",
+                        QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce
+                    };
 
 
                     #region 鏁版嵁鏇存柊鎺ㄩ�佷富棰�
@@ -262,6 +268,11 @@
                         topicFilterPush2, topicAlinkStatus ,mqttkeyChange,
                         deviceOnlinePush,
                         securityStatusChange});
+                    //璁㈤槄缇ゆ帶鐘舵��
+                    if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
+                    {
+                        await RemoteMqttClient.SubscribeAsync(groupControlStatus);
+                    }
                     if (result.Items[0].ResultCode == MQTTnet.Client.Subscribing.MqttClientSubscribeResultCode.GrantedQoS0)
                     {
                         isSubscribeSuccess = true;
@@ -563,11 +574,18 @@
                                     }
                                 }
                                 #endregion
+                                //缇ゆ帶鐘舵��
+                                else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/device/group/control/property/send")
+                                {
+                                    var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey);
+                                    var revString = Encoding.UTF8.GetString(bytes);
+                                    MainPage.Log($"mqtt 缇ゆ帶鐘舵�佹洿鏂�:{revString}");
+                                    Control.Ins.UpdataGroupControlStatus(revString, null, true);
+                                }
                                 //A缃戝叧璁惧鐘舵��-鍖呭惈娑傞甫璁惧
                                 //Tag 缃戠粶鐘舵�佽В鏋�
                                 else if (topic == $"/user/{DB_ResidenceData.Instance.CurrentRegion.id}/app/thing/property/send")
                                 {
-
                                     var bytes = Securitys.EncryptionService.AesDecryptPayload(e.ApplicationMessage.Payload, tuyaEncryptKey);
                                     var revString = Encoding.UTF8.GetString(bytes);
                                     MainPage.Log($"mqtt 鐘舵�佹洿鏂�:{revString}");
diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs
index c2dec7d..e46d548 100644
--- a/HDL_ON/DAL/Server/HttpServerRequest.cs
+++ b/HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -3203,13 +3203,39 @@
             var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson);
             return pack;
         }
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶璇︽儏
+        /// </summary>
+        public ResponsePackNew GetGroupControInfo(string userDeviceGroupControlIds)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            var ids = new List<string>()
+            {
+                userDeviceGroupControlIds,
+            };
+            d.Add("userDeviceGroupControlIds", ids);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson);
+            return pack;
+        }
 
+        /// <summary>
+        /// 鑾峰彇缇ゆ帶璇︽儏
+        /// </summary>
+        public ResponsePackNew GetGroupControInfo(List<string> ids)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlIds", ids);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlInfos, requestJson);
+            return pack;
+        }
 
         /// <summary>
         /// 娣诲姞缇ゆ帶鍒楄〃
         /// </summary>
-        /// <param name="spk"></param>
-        /// <returns></returns>
         public ResponsePackNew AddGroupControl(List<GroupControl> groupControls)
         {
             Dictionary<string, object> d = new Dictionary<string, object>();
@@ -3217,7 +3243,81 @@
             d.Add("gatewayId", DB_ResidenceData.Instance.HomeGateway.gatewayId);
             d.Add("infos", groupControls);
             var requestJson = HttpUtil.GetSignRequestJson(d);
-            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetGroupControlListByHome, requestJson);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddGroupControl, requestJson);
+            return pack;
+        }
+
+
+        /// <summary>
+        /// 娣诲姞缇ゆ帶鍒楄〃
+        /// </summary>
+        public ResponsePackNew DelGroupControl(string groupControlId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId });
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_DeleteGroupControl, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 缂栬緫缇ゆ帶鍒楄〃
+        /// </summary>
+        /// <param name="spk"></param>
+        /// <returns></returns>
+        public ResponsePackNew EditGroupControl(List<GroupControl> groupControls)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("infos", groupControls);
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_AddGroupControl, requestJson);
+            return pack;
+        }
+
+
+        /// <summary>
+        /// 缇ゆ帶鎺у埗
+        /// </summary>
+        public ResponsePackNew ControlGroupControl(string userDeviceGroupControlId, Dictionary<string, object> pair)
+        {
+            var d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlId", userDeviceGroupControlId);
+            List<Dictionary<string, object>> dd = new List<Dictionary<string, object>>();
+            dd.Add(pair);
+            d.Add("status",dd);
+
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_ControlGroupControl, requestJson);
+            return pack;
+        }
+
+        /// <summary>
+        /// 鏀惰棌缇ゆ帶
+        /// </summary>
+        public ResponsePackNew CollectGroupControl(string groupControlId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId });
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CollectGroupControl, requestJson);
+            return pack;
+        }
+
+
+        /// <summary>
+        /// 鍙栨秷鏀惰棌缇ゆ帶
+        /// </summary>
+        public ResponsePackNew CancelCollectGroupControl(string groupControlId)
+        {
+            Dictionary<string, object> d = new Dictionary<string, object>();
+            d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id);
+            d.Add("userDeviceGroupControlIds", new List<string>() { groupControlId });
+            var requestJson = HttpUtil.GetSignRequestJson(d);
+            var pack = HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_CancelCollectGroupControl, requestJson);
             return pack;
         }
 
diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs
index aa884c3..211486b 100644
--- a/HDL_ON/DAL/Server/HttpUtil.cs
+++ b/HDL_ON/DAL/Server/HttpUtil.cs
@@ -238,7 +238,19 @@
                 }
                 else
                 {
-                    HDL_ON.Utlis.WriteLine($"鎺ュ彛寮傚父:{requestFullUrl} \r\n"+response.ErrorMessage);
+                    HDL_ON.Utlis.WriteLine($"鎺ュ彛寮傚父:{requestFullUrl} \r\n"+response.Content);
+                    if(response.Content!= null)
+                    {
+                        try
+                        {
+                            var pack = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePackNew>(response.Content);
+                            if (pack != null)
+                            {
+                                return pack;
+                            }
+                        }
+                        catch { }
+                    }
                     return new ResponsePackNew() { Code = StateCode.NETWORK_ERROR };
                 }
 
diff --git a/HDL_ON/DAL/Server/NewApiRes.cs b/HDL_ON/DAL/Server/NewApiRes.cs
index 955e396..8447527 100644
--- a/HDL_ON/DAL/Server/NewApiRes.cs
+++ b/HDL_ON/DAL/Server/NewApiRes.cs
@@ -633,6 +633,11 @@
         /// </summary>
         public bool gatewayStatus;
 
+        /// <summary>
+        /// 鏄惁鏀寔缇ゆ帶
+        /// </summary>
+        public bool isSupportGroupControl = false;
+
         ///// <summary>
         ///// 
         ///// </summary>
diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs
index 96d30fd..a562b51 100644
--- a/HDL_ON/Entity/Function/Function.cs
+++ b/HDL_ON/Entity/Function/Function.cs
@@ -565,13 +565,27 @@
 
             new System.Threading.Thread(() =>
             {
-                if (collect)
-                {
-                    result = ApiUtlis.Ins.HttpRequest.CollectDevice(deviceId).Code;
+                if (spk == SPK.GroupControl) {
+                    var groupControl = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
+                    if (collect)
+                    {
+                        result = ApiUtlis.Ins.HttpRequest.CollectGroupControl(groupControl.userDeviceGroupControlId).Code;
+                    }
+                    else
+                    {
+                        result = ApiUtlis.Ins.HttpRequest.CancelCollectGroupControl(groupControl.userDeviceGroupControlId).Code;
+                    }
                 }
                 else
                 {
-                    result = ApiUtlis.Ins.HttpRequest.CancelCollectDevice(deviceId).Code;
+                    if (collect)
+                    {
+                        result = ApiUtlis.Ins.HttpRequest.CollectDevice(deviceId).Code;
+                    }
+                    else
+                    {
+                        result = ApiUtlis.Ins.HttpRequest.CancelCollectDevice(deviceId).Code;
+                    }
                 }
                 //鎻愮ず閿欒
                 if (result != StateCode.SUCCESS)
@@ -1360,6 +1374,10 @@
     public static class SPK
     {
         /// <summary>
+        /// 缇ゆ帶锛堣嚜瀹氫箟锛�
+        /// </summary>
+        public const string GroupControl = "GroupControl";
+        /// <summary>
         /// 閫氱敤寮�鍏�
         /// </summary>
         public const string OtherCommon = "other.common";
@@ -1508,7 +1526,7 @@
         public const string HvacAC = "hvac.ac";
         /// <summary>
         /// 姣涚粏绠$┖璋�
-        /// </summary>
+        /// </summaryc
         public const string HvacCac = "hvac.cac";
 
         /// <summary>
diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs
index 2f075d3..aecf05a 100644
--- a/HDL_ON/Entity/FunctionList.cs
+++ b/HDL_ON/Entity/FunctionList.cs
@@ -56,6 +56,12 @@
         /// </summary>
         public List<Function> Functions = new List<Function>();
         /// <summary>
+        /// 缇ゆ帶鍒楄〃
+        /// </summary>
+        public List<GroupControl> groupControls = new List<GroupControl>();
+
+
+        /// <summary>
         /// 鏈烘鑷傚垪琛�
         /// </summary>
         /// <returns></returns>
diff --git a/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs b/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs
index 387964a..f64b239 100644
--- a/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs
+++ b/HDL_ON/Entity/ResponseEntity/RegionInfoRes.cs
@@ -131,10 +131,6 @@
         /// 浜や粯閾炬帴
         /// </summary>
         public string deliverUrl;
-        /// <summary>
-        /// 鏄惁鏀寔缇ゆ帶
-        /// </summary>
-        public bool isSupportGroupControl = false;
     }
 
 }
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
index 5386afe..2943751 100644
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -544,6 +544,13 @@
     <Compile Include="$(MSBuildThisFileDirectory)Entity\ResponseEntity\FreeviewMemberInfo.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\CombinedDimming\GroupChooseRoomPage.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\CombinedDimming\AddGroupControlPage.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideDoorLockSend.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\StackTraceLog.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\ObjectClass.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\CommonMethod.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorLockPage.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorLockListPage.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\GroupControlPage.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
diff --git a/HDL_ON/UI/UI0-Public/DiySelectPopupDialog.cs b/HDL_ON/UI/UI0-Public/DiySelectPopupDialog.cs
index 980ea4d..db258bb 100644
--- a/HDL_ON/UI/UI0-Public/DiySelectPopupDialog.cs
+++ b/HDL_ON/UI/UI0-Public/DiySelectPopupDialog.cs
@@ -70,7 +70,7 @@
         /// <param name="mSecondList">浜岀骇鏁版嵁闆嗗悎</param>
         /// <param name="SelectAction">閫夋嫨鍥炶皟浜嬩欢</param>
         /// <param name="selectTagId"></param>
-        public void ShowView(List<RoomCellInfo> mFirstList, List<List<RoomCellInfo>> mSecondList, Action<string> SelectAction, string selectTagId = ALLSELECT)
+        public void ShowView(List<RoomCellInfo> mFirstList, List<List<RoomCellInfo>> mSecondList, Action<string> SelectAction, string selectTagId = ALLSELECT, int offsetY = 0)
         {
             if (mFirstList == null)
             {
@@ -109,7 +109,7 @@
                 }
 
                 //View鏄剧ず
-                ShowDoubleBaseView();
+                ShowDoubleBaseView(offsetY);
                 //鏁版嵁鍐呭濉厖
                 RefreshDoubleBaseView();
                 //閫変腑鏁堟灉
@@ -206,7 +206,7 @@
         /// <summary>
         /// 鏄剧ず浜岀骇view
         /// </summary>
-        void ShowDoubleBaseView()
+        void ShowDoubleBaseView(int offsetY = 0)
         {
             bodyView.BackgroundColor = CSS_Color.DialogTransparentColor1;
             this.AddChidren(bodyView);
@@ -218,7 +218,7 @@
             BackView = new FrameLayout()
             {
                 X = Application.GetRealWidth(10),
-                Y = Application.GetRealHeight(104),
+                Y = Application.GetRealHeight(104+ offsetY),
                 Width = Application.GetRealWidth(283),
                 Height = Application.GetRealWidth(242),
             };
diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
index 70a5fc2..631866a 100644
--- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -725,7 +725,7 @@
             {
                 int index = 0;
                 var list = FunctionList.List.GetDeviceFunctionList();
-
+                list.AddRange(FunctionList.List.groupControls);//鍔犲叆缇ゆ帶
                 foreach (var function in list)
                 {
                     //闊充箰妯″潡鏈変富浠庡叧绯伙紝闇�瑕佺壒娈婂鐞�
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
index afc8c39..7cb16f3 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -78,7 +78,10 @@
             }
 
             btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png";
-
+            if(function.spk == SPK.GroupControl)
+            {
+                btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/lightswitch.png";
+            }
             if (SPK.CurtainSpkList().Contains(function.spk))
             {//绐楀笜娌℃湁寮�鍏虫寜閽�
                 CurtainFragment();
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
index 1fb2267..a639e02 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs
@@ -405,6 +405,17 @@
         /// </summary>
         void LoadEvent_DivSkipEvent()
         {
+            if (function.spk == SPK.GroupControl)
+            {
+                EventHandler<MouseEventArgs> handler = (sender, e) => {
+                    var dialog = new GroupControlPage(FunctionList.List.groupControls.Find((obj) => obj.sid == function.sid));
+                    dialog.ShowDialog();
+                };
+                this.MouseUpEventHandler = handler;
+                btnName.MouseUpEventHandler = handler;
+                btnFromFloor.MouseUpEventHandler = handler;
+                return;
+            }
             var eventHandler = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollectionIcon, btnName, btnFromFloor, UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom.room,this.action);
             this.MouseUpEventHandler = eventHandler;
             btnName.MouseUpEventHandler = eventHandler;
diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
index 74b7a31..dee3d46 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
@@ -39,7 +39,7 @@
         {
 
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
-            if (titleId == StringId.Lights && !DB_ResidenceData.Instance.CurrentRegion.isSupportGroupControl)
+            if (titleId == StringId.Lights && !DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
             {
                 Action action = () =>
                 {
@@ -142,6 +142,9 @@
             if (titleId == StringId.Lights)
             {
                 functionList.AddRange(FunctionList.List.GetLightList());
+                functionList.AddRange(FunctionList.List.groupControls);
+
+
                 var lightScene = FunctionList.List.scenes.FindAll((obj) => obj.sceneType == SceneType.LightScene);
 
                 foreach (var scene in lightScene)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs
index 2d893bc..b64cdd0 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/AddGroupControlPage.cs
@@ -51,19 +51,35 @@
         /// 鍥炶皟鍒锋柊
         /// </summary>
         Action backActon;
-
+        /// <summary>
+        /// 鏄惁鏂板缇ゆ帶
+        /// </summary>
+        bool isAdd = true;
+        /// <summary>
+        /// 缂栬緫鐨勭粍鎺ф暟鎹�
+        /// </summary>
+        string editDataString = "";
 
         GroupControl groupControl;
 
+        GroupControlType groupControlType = new GroupControlType();
 
-
-        public AddGroupControlPage(List<Function> functions, GroupControl groupControl, Action action)
+        public AddGroupControlPage(GroupControl groupControl, Action action)
         {
             bodyView = this;
-            groupControlLightList = functions;
+            if(groupControl == null)
+            {
+                this.groupControl = new GroupControl();
+            }
+            else
+            {
+                isAdd = false;
+                this.groupControl = groupControl;
+                editDataString = Newtonsoft.Json.JsonConvert.SerializeObject(this.groupControl);
+            }
+            groupControlLightList = new List<Function>();
             backActon = action;
             lightList = FunctionList.List.GetLightList();
-            this.groupControl = groupControl;
         }
 
         public void LoadPage()
@@ -105,6 +121,7 @@
                 TextSize = CSS_FontSize.TextFontSize,
                 TextAlignment = TextAlignment.CenterRight,
                 TextColor = CSS_Color.TextualColor,
+                PlaceholderTextColor = CSS_Color.PromptingColor1,
             };
             groupNameView.AddChidren(etGroupName);
 
@@ -160,6 +177,7 @@
             locationMagtView.AddChidren(btnLocationInfoRight);
             EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
             {
+                Application.HideSoftInput();
                 //淇敼鍔熻兘鎵�灞炴埧闂翠箣鍚庣殑鍥炶皟浜嬩欢
                 Action chooseRoomBackAction = () => {
                     try
@@ -173,8 +191,8 @@
                 view.LoadPage();
                 MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
             };
-                btnLocationInfoRight.MouseUpEventHandler = eventHandler;
-                btnLocationValues.MouseUpEventHandler = eventHandler;
+            btnLocationInfoRight.MouseUpEventHandler = eventHandler;
+            btnLocationValues.MouseUpEventHandler = eventHandler;
             
 
             //locationMagtView.AddChidren(
@@ -266,7 +284,6 @@
             bodyView.AddChidren(functionListView);
 
 
-            LoadLightRow(lightList);
             functionListView.AddChidren(new Button()
             {
                 Height = Application.GetRealHeight(10),
@@ -296,6 +313,7 @@
                 TextSize = CSS_FontSize.SubheadingFontSize,
                 SelectedTextColor = CSS_Color.MainBackgroundColor,
                 SelectedBackgroundColor = CSS_Color.MainColor,
+                IsSelected = !isAdd
             };
             bottomView.AddChidren(btnConfrim);
             btnConfrim.MouseUpEventHandler = (sender, e) => {
@@ -308,50 +326,161 @@
                         new PublicAssmebly().TipMsg(StringId.Tip, StringId.PlsEntryGroupName);
                         return;
                     }
-                    groupControl.name = name;
-                    groupControl.sids.Clear();
-                    foreach (var light in groupControlLightList)
+                    if (groupControlLightList.Count < 2)
                     {
+                        new PublicAssmebly().TipMsg(StringId.Tip, StringId.PlsSelectMoreData);
+                        return;
+                    }
+                    if (isAdd)
+                    {
+                        groupControl.name = name;
+                        groupControl.sids.Clear();
+                        foreach (var light in groupControlLightList)
+                        {
+                            try
+                            {
+                                var gc = new GroupControlFunction();
+                                gc.sid = light.sid;
+                                gc.spk = light.spk;
+                                groupControl.sids.Add(gc);
+                            }
+                            catch (Exception ex)
+                            {
+                                MainPage.Log($"鏂板缇ゆ帶杞崲鏁版嵁寮傚父:{ex.Message}");
+                            }
+                        }
                         try
                         {
-                            var gc = new GroupControlFunction();
-                            gc.sid = light.sid;
-                            gc.spk = light.spk;
-                            groupControl.sids.Add(gc);
+                            groupControl.type = groupControlType.type;
+                            groupControl.sid = groupControl.NewGroupControlSid();
+                            var pack = Common.ApiUtlis.Ins.HttpRequest.AddGroupControl(new List<GroupControl>() { groupControl });
+                            if (pack != null)
+                            {
+                                if (pack.Code == StateCode.SUCCESS)
+                                {
+                                    backActon?.Invoke();
+                                    this.RemoveFromParent();
+                                }
+                                else
+                                {
+                                    IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                                }
+                            }
                         }
                         catch (Exception ex)
                         {
-                            MainPage.Log($"鏂板缇ゆ帶杞崲鏁版嵁寮傚父:{ex.Message}");
+                            MainPage.Log($"鏂板缇ゆ帶寮傚父:{ex.Message}");
                         }
                     }
-                    try
+                    else
                     {
-                        var http = new HttpServerRequest();
-                        var pack = http.AddGroupControl(new List<GroupControl>() { groupControl });
-                        if (pack != null)
+                        try
                         {
-                            if(pack.Code == StateCode.SUCCESS)
+                            var newEditDataString = Newtonsoft.Json.JsonConvert.SerializeObject(this.groupControl);
+                            //娌℃湁鏇存柊鏁版嵁鍒欑洿鎺ラ��鍑�
+                            if (newEditDataString == editDataString)
                             {
-                                backActon?.Invoke();
                                 this.RemoveFromParent();
+                                return;
                             }
-                            else
+                            var pack = Common.ApiUtlis.Ins.HttpRequest.EditGroupControl(new List<GroupControl>() { groupControl });
+                            if (pack != null)
                             {
-                                IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                                if (pack.Code == StateCode.SUCCESS)
+                                {
+                                    backActon?.Invoke();
+                                    this.RemoveFromParent();
+                                }
+                                else
+                                {
+                                    IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                                }
                             }
                         }
-                    }
-                    catch (Exception ex)
-                    {
-                        MainPage.Log($"鏂板缇ゆ帶寮傚父:{ex.Message}");
+                        catch (Exception ex)
+                        {
+                            MainPage.Log($"缂栬緫缇ゆ帶寮傚父:{ex.Message}");
+                        }
+
                     }
                 }
             };
 
             #endregion
 
-            //鍔犺浇鍔熻兘绛涢�夌粍浠�
+
             LoadDialog_ChangeFloor();
+
+
+            new Thread(() => {
+                if (isAdd)
+                {
+                    var pack = Common.ApiUtlis.Ins.HttpRequest.GetGroupControlTypes("light.switch");
+                    if (pack != null)
+                    {
+                        if (pack.Code == StateCode.SUCCESS)
+                        {
+                            try
+                            {
+
+                                var groupControlTypes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControlType>>(pack.Data.ToString());
+                                if (groupControlTypes != null && groupControlTypes.Count > 0)
+                                {
+                                    groupControlType = groupControlTypes[0];
+                                    Application.RunOnMainThread(() => {
+                                        LoadLightRow(lightList);
+                                    });
+                                }
+                            }
+                            catch (Exception ex)
+                            {
+                                MainPage.Log($"璇诲彇缁勬帶绫诲瀷澶辫触:{ex.Message}");
+                            }
+                        }
+                        else
+                        {
+                            IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                        }
+                    }
+                }
+                else
+                {
+                    var pack = Common.ApiUtlis.Ins.HttpRequest.GetGroupControInfo(groupControl.userDeviceGroupControlId);
+                    if (pack != null)
+                    {
+                        if (pack.Code == StateCode.SUCCESS)
+                        {
+                            try
+                            {
+
+                                var groupControlTemps = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString());
+                                if (groupControlTemps != null && groupControlTemps.Count > 0)
+                                {
+                                    groupControl = groupControlTemps[0];
+                                    Application.RunOnMainThread(() =>
+                                    {
+                                        LoadLightRow(lightList);
+                                    });
+                                }
+                            }
+                            catch (Exception ex)
+                            {
+                                MainPage.Log($"璇诲彇缁勬帶淇℃伅澶辫触:{ex.Message}");
+                            }
+                        }
+                        else
+                        {
+                            IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                        }
+                    }
+                }
+            }) { IsBackground = true }.Start();
+
+            if (!isAdd)
+            {
+                etGroupName.Text = groupControl.name;
+                btnLocationValues.Text = groupControl.GetRoomListName();
+            }
         }
 
         /// <summary>
@@ -392,7 +521,6 @@
                             var functionDiv = new LightRow(function)
                             {
                                 Gravity = Gravity.CenterHorizontal,
-                                //Width = Application.GetRealWidth(343),
                                 Height = Application.GetRealHeight(62),
                                 BorderColor = 0x00FFFFFF,
                                 BorderWidth = 1,
@@ -419,6 +547,10 @@
                                     btnConfrim.IsSelected = false;
                                 }
                             };
+                            if (groupControl.sids.Find((obj) => obj.sid == function.sid) != null)
+                            {
+                                groupControlLightList.Add(function);
+                            }
 
                             functionDiv.LoadDiv(groupControlLightList, setAction);
                             functionListView.AddChidren(functionDiv);
@@ -476,6 +608,7 @@
             string nowSelectId = null;
             btnFloor.MouseUpEventHandler += (sender, e) =>
             {
+                Application.HideSoftInput();
                 //鏄剧ず涓嬫媺鍒楄〃
                 var form = new FloorRoomSelectPopupView();
                 form.ShowDeviceFunctionView(btnFloor, this.lightList, (selectId, listFunc) =>
@@ -498,1044 +631,11 @@
                     nowSelectId = selectId;
                     //閲嶆柊鍔犺浇鐣岄潰
                     LoadLightRow(listFunc);
-                }, nowSelectId);
+                }, nowSelectId,100);
             };
         }
 
     }
 
-
-    //public class LightRow : FrameLayout
-    //{
-    //    #region 鍖哄煙鎺т欢
-    //    static FrameLayout bodyDiv;
-    //    /// <summary>
-    //    /// 鍔熻兘/鍦烘櫙icon
-    //    /// </summary>
-    //    Button btnIcon;
-    //    /// <summary>
-    //    /// 鍔熻兘鍚嶇О/鍦烘櫙鍚嶇О
-    //    /// </summary>
-    //    Button btnName;
-    //    /// <summary>
-    //    /// 妤煎眰淇℃伅鏄剧ず鎸夐挳
-    //    /// </summary>
-    //    Button btnFromFloor;
-    //    /// <summary>
-    //    /// 閫変腑鎸夐挳
-    //    /// </summary>
-    //    Button btnSelect;
-    //    #endregion
-
-    //    #region 鍖哄煙鍙橀噺
-    //    Function function;
-    //    #endregion
-    //    public LightRow(Function func)
-    //    {
-    //        bodyDiv = this;
-    //        bodyDiv.Tag = func.sid;
-    //        function = func;
-    //    }
-
-
-    //    /// <summary>
-    //    /// 鍔犺浇鎺у埗鍗$墖鍖哄煙
-    //    /// </summary>
-    //    public void LoadDiv(List<Function> functions, Action action)
-    //    {
-    //        btnIcon = new Button()
-    //        {
-    //            X = Application.GetRealWidth(10),
-    //            Y = Application.GetRealHeight(15),
-    //            Width = Application.GetRealWidth(32),
-    //            Height = Application.GetRealWidth(32),
-    //            UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"
-    //        };
-    //        bodyDiv.AddChidren(btnIcon);
-
-    //        btnName = new Button()
-    //        {
-    //            X = Application.GetRealWidth(8 + 10 + 32),
-    //            Y = Application.GetRealHeight(10),
-    //            Width = Application.GetRealWidth(200),
-    //            Height = Application.GetRealHeight(24),
-    //            Text = function.name,
-    //            TextAlignment = TextAlignment.CenterLeft,
-    //            TextColor = CSS_Color.FirstLevelTitleColor,
-    //            TextSize = CSS_FontSize.TextFontSize,
-    //        };
-    //        bodyDiv.AddChidren(btnName);
-
-    //        btnFromFloor = new Button()
-    //        {
-    //            X = Application.GetRealWidth(8 + 10 + 32),
-    //            Y = Application.GetRealHeight(10 + 24),
-    //            Width = Application.GetRealWidth(200),
-    //            Height = Application.GetRealHeight(18),
-    //            Text = function.GetRoomListName(),
-    //            TextAlignment = TextAlignment.CenterLeft,
-    //            TextColor = CSS_Color.PromptingColor1,
-    //            TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-    //        };
-    //        bodyDiv.AddChidren(btnFromFloor);
-
-    //        btnSelect = new Button()
-    //        {
-    //            X = Application.GetRealWidth(303),
-    //            Gravity = Gravity.CenterVertical,
-    //            Width = Application.GetRealWidth(32),
-    //            Height = Application.GetRealWidth(32),
-    //            UnSelectedImagePath = "FunctionIcon/Light/LightScene/CheckIcon.png",
-    //            SelectedImagePath = "FunctionIcon/Light/LightScene/CheckOnIcon.png",
-    //            IsSelected = functions.Find((obj) => obj.deviceId == function.deviceId) != null
-    //        };
-    //        bodyDiv.AddChidren(btnSelect);
-
-    //        btnSelect.MouseUpEventHandler = (sender, e) => {
-    //            btnSelect.IsSelected = !btnSelect.IsSelected;
-    //            if (btnSelect.IsSelected)
-    //            {
-    //                var addTemp = functions.Find((obj) => obj.deviceId == function.deviceId);
-    //                if (addTemp == null)
-    //                {
-    //                    functions.Add(function);
-    //                }
-    //            }
-    //            else
-    //            {
-    //                var removeTemp = functions.Find((obj) => obj.deviceId == function.deviceId);
-    //                if (removeTemp != null)
-    //                {
-    //                    functions.Remove(removeTemp);
-    //                }
-    //            }
-    //            ///鍒锋柊鐣岄潰
-    //            if (functions.Count == 0 || functions.Count == 1)
-    //            {
-    //                action();
-    //            }
-    //        };
-
-    //    }
-
-
-    //}
-
-    ///// <summary>
-    ///// 鐏厜鍦烘櫙缂栬緫寮圭獥
-    ///// </summary>
-    //public class LightSceneEditDialog : Dialog
-    //{
-
-
-    //    Dictionary<string, string> d = new Dictionary<string, string>();
-    //    List<Function> listSwitch = new List<Function>();
-    //    List<Function> lightDimming = new List<Function>();
-    //    List<Function> lightCCT = new List<Function>();
-    //    List<Function> lightRGB = new List<Function>();
-
-    //    /// <summary>
-    //    /// 浼犲叆鐨勭伅鍏夊垪琛�
-    //    /// 鍔犲叆鍦烘櫙鎺у埗鍔熻兘鍒楄〃
-    //    /// </summary>
-    //    List<Function> lights;
-    //    /// <summary>
-    //    /// 涓存椂鐏厜瀵硅薄
-    //    /// 澶勭悊鐏厜鏂规硶
-    //    /// </summary>
-    //    Light tempLight = new Light();
-    //    //鍙戦�佹暟鎹敹闆�
-    //    Dictionary<string, string> commandDic = new Dictionary<string, string>();
-
-    //    Scene scene;
-    //    Action<Scene> backAction;
-    //    public LightSceneEditDialog(List<Function> functions, Scene inParScene, Action<Scene> action)
-    //    {
-    //        lights = functions;
-    //        scene = inParScene;
-    //        backAction = action;
-    //    }
-
-
-    //    public void ShowDialog()
-    //    {
-    //        commandDic.Clear();
-    //        commandDic.Add(FunctionAttributeKey.OnOff, "off");
-
-    //        listSwitch = lights.FindAll((obj) => obj.spk == SPK.LightSwitch);
-    //        lightDimming = lights.FindAll((obj) => obj.spk == SPK.LightDimming);
-    //        lightCCT = lights.FindAll((obj) => obj.spk == SPK.LightCCT);
-    //        lightRGB = lights.FindAll((obj) => obj.spk == SPK.LightRGB);
-
-
-
-    //        var hadDimming = lightDimming.Count > 0;
-    //        var hadCCT = lightCCT.Count > 0;
-    //        var hadRGB = lightRGB.Count > 0;
-    //        if (hadRGB)
-    //        {
-    //            commandDic.Add(FunctionAttributeKey.RGB, lightRGB[0].GetAttrState(FunctionAttributeKey.RGB));
-    //            commandDic.Add(FunctionAttributeKey.Brightness, lightRGB[0].GetAttrState(FunctionAttributeKey.Brightness));
-    //        }
-    //        if (hadCCT)
-    //        {
-    //            commandDic.Add(FunctionAttributeKey.CCT, lightCCT[0].GetAttrState(FunctionAttributeKey.CCT));
-    //            if (!commandDic.ContainsKey(FunctionAttributeKey.Brightness))
-    //            {
-    //                commandDic.Add(FunctionAttributeKey.Brightness, lightCCT[0].GetAttrState(FunctionAttributeKey.Brightness));
-    //            }
-    //        }
-    //        if (hadDimming)
-    //        {
-    //            if (!commandDic.ContainsKey(FunctionAttributeKey.Brightness))
-    //            {
-    //                commandDic.Add(FunctionAttributeKey.Brightness, lightDimming[0].GetAttrState(FunctionAttributeKey.Brightness));
-    //            }
-    //        }
-
-    //        var bodyView = new FrameLayout();
-    //        this.AddChidren(bodyView);
-    //        bodyView.MouseUpEventHandler = (sender, e) => {
-    //            this.Close();
-    //        };
-
-    //        var contentView = new FrameLayout()
-    //        {
-    //            BackgroundColor = CSS_Color.MainBackgroundColor,
-    //            Width = Application.GetRealWidth(343),
-    //            Radius = (uint)Application.GetRealWidth(12),
-    //        };
-    //        bodyView.AddChidren(contentView);
-
-    //        #region 鏍囬鍖�
-    //        var titleView = new FrameLayout()
-    //        {
-    //            Width = Application.GetRealWidth(343),
-    //            Height = Application.GetRealHeight(52),
-    //        };
-    //        contentView.AddChidren(titleView);
-
-    //        var btnTitle = new Button()
-    //        {
-    //            Height = Application.GetRealHeight(52),
-    //            Gravity = Gravity.Center,
-    //            TextSize = CSS_FontSize.SubheadingFontSize,
-    //            TextColor = CSS_Color.MainColor,
-    //            TextID = StringId.CombinedDimming,
-    //            TextAlignment = TextAlignment.Center,
-    //        };
-    //        if (btnTitle.GetTextWidth() > Application.GetRealWidth(197))//247
-    //        {
-    //            btnTitle.Width = Application.GetRealWidth(197);
-    //            btnTitle.IsMoreLines = true;
-    //        }
-    //        else
-    //        {
-    //            btnTitle.Width = btnTitle.GetTextWidth() + Application.GetRealWidth(10);
-    //            btnTitle.IsMoreLines = false;
-    //        }
-    //        titleView.AddChidren(btnTitle);
-
-    //        var btnEditIcon = new Button()
-    //        {
-    //            Width = Application.GetRealWidth(24),
-    //            Height = Application.GetRealWidth(24),
-    //            X = Application.GetRealWidth(12) + btnTitle.Right,
-    //            Gravity = Gravity.CenterVertical,
-    //            UnSelectedImagePath = "Public/Edit.png",
-    //        };
-    //        if (string.IsNullOrEmpty(scene.userSceneId))
-    //        {
-    //            titleView.AddChidren(btnEditIcon);
-    //        }
-    //        else
-    //        {
-    //            btnTitle.Text = scene.name;
-    //            btnTitle.Width = btnTitle.GetTextWidth() + Application.GetRealWidth(10);
-    //            btnTitle.Gravity = Gravity.Center;
-    //        }
-
-    //        Action<string> callBack = (str) =>
-    //        {
-    //            //鍚嶇О涓嶈兘涓虹┖
-    //            if (string.IsNullOrEmpty(str))
-    //            {
-    //                new Tip()
-    //                {
-    //                    CloseTime = 1,
-    //                    Text = Language.StringByID(StringId.NameCannotBeEmpty),
-    //                    Direction = AMPopTipDirection.None,
-    //                }.Show(bodyView);
-    //                return;
-    //            }
-    //            btnTitle.Text = str;
-    //            scene.name = str;
-
-
-    //            if (btnTitle.GetTextWidth() > Application.GetRealWidth(197))//247
-    //            {
-    //                btnTitle.Width = Application.GetRealWidth(197);
-    //            }
-    //            else
-    //            {
-    //                btnTitle.Width = btnTitle.GetTextWidth();
-    //            }
-
-    //        };
-    //        EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
-    //        {
-    //            List<string> sceneNameList = new List<string>();
-    //            foreach (var tempScene in FunctionList.List.scenes)
-    //            {
-    //                sceneNameList.Add(tempScene.name);
-    //            }
-    //            new PublicAssmebly().LoadDialog_EditParater(StringId.SceneName, scene.name, callBack, StringId.SceneNameCannotBeEmpty, StringId.SceneNameAlreadyExists, sceneNameList);
-    //        };
-    //        btnTitle.MouseUpEventHandler = eventHandler;
-    //        btnEditIcon.MouseUpEventHandler = eventHandler;
-
-    //        titleView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor, Y = Application.GetRealHeight(51) });
-
-    //        #endregion
-
-
-    //        //var dimmingLight = lights.Find((obj) => obj.spk == SPK.LightDimming);
-    //        //var cctLight = lights.Find((obj) => obj.spk == SPK.LightCCT);
-    //        //var rgbLight = lights.Find((obj) => obj.spk == SPK.LightRGB);
-    //        var dimmingLight = scene.functions.Find((obj) => obj.localFunction.spk == SPK.LightDimming);
-    //        var cctLight = scene.functions.Find((obj) => obj.localFunction.spk == SPK.LightCCT);
-    //        var rgbLight = scene.functions.Find((obj) => obj.localFunction.spk == SPK.LightRGB);
-
-    //        var brightnessValue = 0;
-    //        var cctValue = 27;
-    //        //if(rgbLight!= null)
-    //        //{
-    //        //    int.TryParse(rgbLight.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness).value, out brightnessValue);
-    //        //}
-    //        //if (cctLight != null)
-    //        //{
-    //        //    int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness).value, out brightnessValue);
-    //        //    int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.CCT).value, out cctValue);
-    //        //}
-    //        //if(dimmingLight!=null)
-    //        //{
-    //        //    int.TryParse(cctLight.status.Find((obj) => obj.key == FunctionAttributeKey.CCT).value, out brightnessValue);
-    //        //}
-
-
-    //        //灞炴�ц缃尯鍩�
-    //        var attrView = new VerticalScrolViewLayout()
-    //        {
-    //            Y = Application.GetRealHeight(52),
-    //            Width = Application.GetRealWidth(343),
-    //            ScrollEnabled = false,
-    //        };
-    //        //灞炴�ц缃尯鍩熼珮搴�
-    //        int attrViewHight = Application.GetRealHeight(18 + 22);
-
-
-    //        //鍙湁缁х數鍣�
-    //        if (!hadDimming && !hadCCT && !hadRGB)
-    //        {
-    //            attrViewHight += Application.GetRealHeight(50);
-    //            attrView.Height = attrViewHight;
-    //            contentView.AddChidren(attrView);
-    //            attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) });
-
-    //            var view = new FrameLayout()
-    //            {
-    //                Width = Application.GetRealWidth(343),
-    //                Height = Application.GetRealHeight(50),
-    //            };
-    //            attrView.AddChidren(view);
-
-
-    //            var btnClose = new Button()
-    //            {
-    //                X = Application.GetRealWidth(50),
-    //                Gravity = Gravity.CenterVertical,
-    //                Width = Application.GetRealWidth(98),
-    //                Height = Application.GetRealHeight(40),
-    //                TextColor = CSS_Color.TextualColor,
-    //                SelectedBackgroundColor = CSS_Color.MainColor,
-    //                SelectedTextColor = CSS_Color.MainBackgroundColor,
-    //                BackgroundColor = CSS_Color.DividingLineColor,
-    //                TextID = StringId.OFF,
-    //                TextSize = CSS_FontSize.TextFontSize,
-    //                Radius = (uint)Application.GetRealWidth(5),
-    //                IsSelected = true,
-    //                //BorderWidth = 1,
-    //                //BorderColor = 0x00000000
-    //            };
-    //            view.AddChidren(btnClose);
-
-    //            var btnOpen = new Button()
-    //            {
-    //                X = Application.GetRealWidth(100 + 98),
-    //                Gravity = Gravity.CenterVertical,
-    //                Width = Application.GetRealWidth(98),
-    //                Height = Application.GetRealHeight(40),
-    //                TextColor = CSS_Color.TextualColor,
-    //                SelectedBackgroundColor = CSS_Color.MainColor,
-    //                SelectedTextColor = CSS_Color.MainBackgroundColor,
-    //                BackgroundColor = CSS_Color.DividingLineColor,
-    //                TextID = StringId.On,
-    //                TextSize = CSS_FontSize.TextFontSize,
-    //                Radius = (uint)Application.GetRealWidth(5),
-    //            };
-    //            view.AddChidren(btnOpen);
-
-    //            btnClose.MouseUpEventHandler = (sender, e) =>
-    //            {
-    //                btnClose.IsSelected = true;
-    //                btnOpen.IsSelected = false;
-    //                commandDic[FunctionAttributeKey.OnOff] = "off";
-    //                d.Clear();
-    //                d.Add(FunctionAttributeKey.OnOff, "off");
-    //                foreach (var light in lights)
-    //                {
-    //                    Control.Ins.SendWriteCommand(light, d);
-    //                }
-    //            };
-    //            btnOpen.MouseUpEventHandler = (sender, e) =>
-    //            {
-    //                btnClose.IsSelected = false;
-    //                btnOpen.IsSelected = true;
-    //                commandDic[FunctionAttributeKey.OnOff] = "on";
-    //                d.Clear();
-    //                d.Add(FunctionAttributeKey.OnOff, "on");
-    //                foreach (var light in lights)
-    //                {
-    //                    Control.Ins.SendWriteCommand(light, d);
-    //                }
-    //            };
-
-    //        }
-
-    //        else
-    //        {
-    //            if (hadRGB)
-    //            {
-    //                attrViewHight += Application.GetRealHeight(248);
-    //                hadDimming = true;
-    //            }
-    //            if (hadCCT)
-    //            {
-    //                attrViewHight += Application.GetRealHeight(54 + 11);
-    //                hadDimming = true;
-    //            }
-    //            if (hadDimming)
-    //            {
-    //                attrViewHight += Application.GetRealHeight(54 + 11);
-    //            }
-    //            attrView.Height = attrViewHight;
-    //            contentView.AddChidren(attrView);
-    //            attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) });
-
-
-    //            if (hadDimming)
-    //            {
-    //                LoadDimmingAttrView(attrView);
-    //            }
-    //            if (hadCCT)
-    //            {
-    //                LoadCctAttrView(attrView);
-    //            }
-    //            if (hadRGB)
-    //            {
-    //                LoadRgbAttrView(attrView);
-    //            }
-    //        }
-
-    //        contentView.Height = Application.GetRealHeight(52 + 44) + attrViewHight;
-    //        contentView.Gravity = Gravity.Center;
-
-
-
-
-    //        #region bottom View
-    //        var bottomView = new FrameLayout()
-    //        {
-    //            Y = Application.GetRealHeight(52) + attrViewHight,
-    //            Height = Application.GetRealHeight(46),
-    //        };
-    //        contentView.AddChidren(bottomView);
-    //        bottomView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor });
-
-    //        if (string.IsNullOrEmpty(scene.userSceneId))
-    //        {
-    //            var btnCacel = new Button()
-    //            {
-    //                Width = Application.GetRealWidth(172),
-    //                Height = Application.GetRealHeight(44),
-    //                TextAlignment = TextAlignment.Center,
-    //                TextSize = CSS_FontSize.SubheadingFontSize,
-    //                TextColor = CSS_Color.TextualColor,
-    //                TextID = StringId.Cancel,
-    //            };
-    //            bottomView.AddChidren(btnCacel);
-
-    //            var btnSave = new Button()
-    //            {
-    //                X = Application.GetRealWidth(172),
-    //                Width = Application.GetRealWidth(172),
-    //                Height = Application.GetRealHeight(46),
-    //                BackgroundColor = CSS_Color.MainColor,
-    //                TextColor = CSS_Color.MainBackgroundColor,
-    //                TextAlignment = TextAlignment.Center,
-    //                TextSize = CSS_FontSize.SubheadingFontSize,
-    //                TextID = StringId.Save
-    //            };
-    //            bottomView.AddChidren(btnSave);
-
-    //            //渚嬶細鍙充笅鍦嗚 澶у皬涓�50
-    //            int mRectCornerID = HDLUtils.RectCornerBottomRight;
-    //            btnSave.SetCornerWithSameRadius((uint)Application.GetRealWidth(14), mRectCornerID);
-
-    //            btnCacel.MouseUpEventHandler = (sender, e) =>
-    //            {
-    //                this.Close();
-
-    //                //var waitPage = new Loading();
-    //                //MainPage.BaseView.AddChidren(waitPage);
-    //                //waitPage.Start(Language.StringByID(StringId.PleaseWait));
-    //                //new Thread(() =>
-    //                //{
-    //                //    try
-    //                //    {
-    //                //        foreach (var light in lights)
-    //                //        {
-    //                //            Dictionary<string, string> sendDate = new Dictionary<string, string>();
-    //                //            //璧嬪�煎満鏅姛鑳芥暟鎹�
-    //                //            foreach (var attr in light.GetAttributes())
-    //                //            {
-    //                //                if (commandDic.ContainsKey(attr))
-    //                //                {
-    //                //                    try
-    //                //                    {
-    //                //                        sendDate.Add(attr, commandDic[attr]);
-    //                //                    }
-    //                //                    catch { }
-    //                //                }
-
-    //                //            }
-    //                //                Control.Ins.SendWriteCommand(light, sendDate);
-    //                //            Thread.Sleep(50);
-    //                //        }
-    //                //    }
-    //                //    catch
-    //                //    { }
-    //                //    finally
-    //                //    {
-    //                //        Application.RunOnMainThread(() =>
-    //                //        {
-    //                //            waitPage.Hide();
-    //                //            new PublicAssmebly().TipMsgAutoClose("缁勫悎鎺у埗宸叉墽琛�", true);
-    //                //            if (waitPage != null)
-    //                //            {
-    //                //                //backAction(null);
-    //                //                waitPage.RemoveFromParent();
-    //                //            }
-    //                //        });
-    //                //    }
-    //                //})
-    //                //{ IsBackground = true }.Start();
-    //            };
-
-    //            btnSave.MouseUpEventHandler = (sender, e) =>
-    //            {
-    //                if (string.IsNullOrEmpty(scene.name))
-    //                {
-    //                    new Tip()
-    //                    {
-    //                        CloseTime = 1,
-    //                        Text = Language.StringByID(StringId.NameCannotBeEmpty),
-    //                        Direction = AMPopTipDirection.None,
-    //                    }.Show(bodyView);
-    //                    return;
-    //                }
-    //                foreach (var tempRoom in FunctionList.List.scenes)
-    //                {
-    //                    if (scene.name == tempRoom.name)
-    //                    {
-    //                        new PublicAssmebly().TipMsg(StringId.Tip, StringId.NameAlreadyExists);
-    //                        return;
-    //                    }
-    //                }
-    //                var waitPage = new Loading();
-    //                MainPage.BaseView.AddChidren(waitPage);
-    //                waitPage.Start(Language.StringByID(StringId.PleaseWait));
-    //                new Thread(() =>
-    //                {
-    //                    try
-    //                    {
-    //                        var serverScene = new Scene();
-    //                        for (int i = 0; i < lights.Count; i++)
-    //                        {
-    //                            var light = lights[i];
-    //                            //璧嬪�煎満鏅姛鑳芥暟鎹�
-    //                            foreach (var attr in light.GetAttributes())
-    //                            {
-    //                                if (commandDic.ContainsKey(attr))
-    //                                {
-    //                                    try
-    //                                    {
-    //                                        light.SetAttrState(attr, commandDic[attr]);
-    //                                    }
-    //                                    catch { }
-    //                                }
-    //                            }
-    //                            //杞崲鍦烘櫙鐨勫姛鑳藉璞�
-    //                            var sceneFunction = light.ConvertSceneFunction();
-    //                            //鏌ヨ鏈夋病鏈夊瓨鍦�
-    //                            var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid);
-    //                            //璧嬪��
-    //                            if (temp != null)
-    //                            {
-    //                                temp = sceneFunction;
-    //                            }
-    //                            else
-    //                            {
-    //                                scene.functions.Add(sceneFunction);
-    //                            }
-    //                        }
-    //                        var result = FunctionList.List.AddScene(scene, out serverScene);
-    //                        Application.RunOnMainThread(() =>
-    //                        {
-    //                            if (result == StateCode.SUCCESS)
-    //                            {
-    //                                scene.userSceneId = serverScene.userSceneId;
-    //                                FunctionList.List.scenes.Add(scene);
-    //                                backAction?.Invoke(scene);
-    //                                this.Close();
-    //                            }
-    //                            else
-    //                            {
-    //                                if (result == "124005")
-    //                                    IMessageCommon.Current.ShowErrorInfoAlter(Language.StringByID(StringId.GatewayOffline));
-    //                                else
-    //                                    IMessageCommon.Current.ShowErrorInfoAlter(result);
-    //                            }
-    //                        });
-    //                    }
-    //                    catch { }
-    //                    finally
-    //                    {
-    //                        Application.RunOnMainThread(() =>
-    //                        {
-    //                            waitPage.Hide();
-    //                            waitPage.RemoveFromParent();
-    //                        });
-    //                    }
-    //                })
-    //                { IsBackground = true, Priority = ThreadPriority.AboveNormal }.Start();
-    //            };
-    //        }
-    //        else
-    //        {
-    //            var btnCacel = new Button()
-    //            {
-    //                Height = Application.GetRealHeight(44),
-    //                TextAlignment = TextAlignment.Center,
-    //                TextSize = CSS_FontSize.SubheadingFontSize,
-    //                TextColor = CSS_Color.TextualColor,
-    //                TextID = StringId.Close,
-    //            };
-    //            bottomView.AddChidren(btnCacel);
-
-
-    //            //渚嬶細鍙充笅鍦嗚 澶у皬涓�50
-    //            //int mRectCornerID = HDLUtils.RectCornerBottomRight;
-    //            //btnSave.SetCornerWithSameRadius((uint)Application.GetRealWidth(14), mRectCornerID);
-
-    //            btnCacel.MouseUpEventHandler = (sender, e) =>
-    //            {
-    //                this.Close();
-    //            };
-
-    //        }
-
-
-
-
-
-    //        #endregion
-
-
-    //        this.Show();
-
-    //    }
-
-    //    /// <summary>
-    //    /// 鍔犺浇璋冨厜灞炴�ц缃帶浠�
-    //    /// </summary>
-    //    /// <param name="attrView"></param>
-    //    void LoadDimmingAttrView(VerticalScrolViewLayout attrView)
-    //    {
-    //        string briValue = "";
-    //        commandDic.TryGetValue(FunctionAttributeKey.Brightness, out briValue);
-
-    //        var dimmingView = new FrameLayout()
-    //        {
-    //            Height = Application.GetRealHeight(54 + 11)
-    //        };
-    //        attrView.AddChidren(dimmingView);
-
-    //        #region 浜害璋冭妭
-    //        var btnBrightnessText = new Button()
-    //        {
-    //            X = Application.GetRealWidth(35),
-    //            Y = Application.GetRealHeight(1),
-    //            Width = Application.GetRealWidth(224),
-    //            Height = Application.GetRealHeight(25),
-    //            TextAlignment = TextAlignment.CenterLeft,
-    //            TextColor = CSS_Color.FirstLevelTitleColor,
-    //            TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-    //            TextID = StringId.Brightness,
-    //        };
-    //        btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + commandDic[FunctionAttributeKey.Brightness] + "%";
-    //        dimmingView.AddChidren(btnBrightnessText);
-
-
-    //        var btnMinValuesText = new Button()
-    //        {
-    //            X = Application.GetRealWidth(35),
-    //            Y = btnBrightnessText.Bottom,
-    //            Width = Application.GetRealWidth(40),
-    //            Height = Application.GetRealHeight(21),
-    //            Text = "0%",
-    //            TextAlignment = TextAlignment.CenterLeft,
-    //            TextColor = CSS_Color.PromptingColor1,
-    //            TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-    //        };
-    //        dimmingView.AddChidren(btnMinValuesText);
-
-    //        var dimmerBar = new DiyImageSeekBar()
-    //        {
-    //            X = Application.GetRealWidth(45 + 10),
-    //            Y = Application.GetRealHeight(11),
-    //            Width = Application.GetRealWidth(220),
-    //            Height = Application.GetRealHeight(54),
-    //            SeekBarViewHeight = Application.GetRealHeight(8),
-    //            ThumbImagePath = "Public/ThumbImage.png",
-    //            ThumbImageHeight = Application.GetRealHeight(54),
-    //            ProgressTextColor = CSS_Color.FirstLevelTitleColor,
-    //            ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-    //            ProgressBarColor = CSS_Color.AuxiliaryColor1,
-    //            MaxValue = 100,
-    //            Progress = Convert.ToInt32(commandDic[FunctionAttributeKey.Brightness]),
-    //            SeekBarPadding = Application.GetRealWidth(20),
-    //            IsProgressTextShow = false,
-    //            ProgressChangeDelayTime = 0,
-    //        };
-    //        dimmingView.AddChidren(dimmerBar);
-    //        dimmerBar.OnProgressChangedEvent = (sender, e) => {
-    //            btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + e + "%";
-    //        };
-    //        dimmerBar.OnStopTrackingTouchEvent = (sender, e) => {
-    //            commandDic[FunctionAttributeKey.Brightness] = dimmerBar.Progress.ToString();
-    //            btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + e + "%";
-
-    //            foreach (var light in lights)
-    //            {
-    //                if (light.spk == SPK.LightSwitch)
-    //                {
-    //                    d.Clear();
-    //                    d.Add(FunctionAttributeKey.OnOff, e > 0 ? "on" : "off");
-    //                    Control.Ins.SendWriteCommand(light, d);
-    //                }
-    //                else
-    //                {
-    //                    d.Clear();
-    //                    d.Add(FunctionAttributeKey.Brightness, e.ToString());
-    //                    Control.Ins.SendWriteCommand(light, d);
-    //                }
-    //            }
-    //        };
-
-
-    //        var btnMaxValuesText = new Button()
-    //        {
-    //            X = dimmerBar.Right,
-    //            Y = btnBrightnessText.Bottom,
-    //            Width = Application.GetRealWidth(55),
-    //            Height = Application.GetRealHeight(21),
-    //            Text = "100%",
-    //            TextAlignment = TextAlignment.CenterLeft,
-    //            TextColor = CSS_Color.PromptingColor1,
-    //            TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-    //        };
-    //        dimmingView.AddChidren(btnMaxValuesText);
-    //        #endregion
-
-    //    }
-
-    //    /// <summary>
-    //    /// 鍔犺浇cct灞炴�ц缃帶浠�
-    //    /// </summary>
-    //    /// <param name="attrView"></param>
-    //    void LoadCctAttrView(VerticalScrolViewLayout attrView)
-    //    {
-    //        #region 鑹叉俯
-
-    //        string valueStr = "2700";
-    //        commandDic.TryGetValue(FunctionAttributeKey.CCT, out valueStr);
-    //        int value = Convert.ToInt32(valueStr) / 100;
-
-    //        var cctView = new FrameLayout()
-    //        {
-    //            Height = Application.GetRealHeight(54 + 11)
-    //        };
-    //        attrView.AddChidren(cctView);
-
-
-    //        //鑹叉俯
-    //        var btnTempClolor = new Button();
-    //        btnTempClolor.X = Application.GetRealWidth(35);
-    //        btnTempClolor.Y = Application.GetRealHeight(1);
-    //        btnTempClolor.Width = Application.GetRealWidth(224);
-    //        btnTempClolor.Height = Application.GetRealHeight(21);
-    //        btnTempClolor.TextAlignment = TextAlignment.CenterLeft;
-    //        btnTempClolor.TextColor = CSS_Color.FirstLevelTitleColor;
-    //        btnTempClolor.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
-    //        btnTempClolor.TextID = StringId.ColorTemperature;
-    //        cctView.AddChidren(btnTempClolor);
-
-    //        //2700K
-    //        var btnTempClolorMin = new Button()
-    //        {
-    //            X = Application.GetRealWidth(35),
-    //            Y = btnTempClolor.Bottom,
-    //            Width = Application.GetRealWidth(40),
-    //            Height = Application.GetRealHeight(21),
-    //        };
-    //        btnTempClolorMin.Width = Application.GetRealWidth(54);
-    //        btnTempClolorMin.Height = Application.GetRealHeight(21);
-    //        btnTempClolorMin.Text = "2700K";
-    //        btnTempClolorMin.TextAlignment = TextAlignment.CenterLeft;
-    //        btnTempClolorMin.TextColor = CSS_Color.PromptingColor1;
-    //        btnTempClolorMin.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
-    //        cctView.AddChidren(btnTempClolorMin);
-
-    //        //婊戝姩鏉$殑鑳屾櫙鍥剧墖
-    //        var btnColorTemplatrueBack = new Button()
-    //        {
-    //            X = Application.GetRealWidth(55 + 22 + 15),
-    //            Y = Application.GetRealHeight(11),
-    //            Width = Application.GetRealWidth(180),
-    //            Height = Application.GetRealHeight(54),
-    //        };
-    //        btnColorTemplatrueBack.UnSelectedImagePath = "FunctionIcon/Light/ColorTemperatureBar.png";
-    //        btnColorTemplatrueBack.Height = Application.GetRealHeight(8);
-    //        btnColorTemplatrueBack.Gravity = Gravity.CenterHorizontal;
-    //        cctView.AddChidren(btnColorTemplatrueBack);
-    //        //婊戝姩鏉℃帶浠�
-    //        var barColorTemplatrue = new CCTSeekBarControl()
-    //        {
-    //            X = Application.GetRealWidth(55 + 22),
-    //            Y = Application.GetRealHeight(11),
-    //            Width = Application.GetRealWidth(220),
-    //            Height = Application.GetRealHeight(54),
-    //        };
-    //        barColorTemplatrue.MinValue = 27;
-    //        barColorTemplatrue.MaxValue = 65;
-    //        barColorTemplatrue.ProgressBarColor = 0x00000000;//鍏ㄩ儴閫忔槑
-    //        barColorTemplatrue.ProgressBarUnEnableColor = 0x00000000;
-    //        barColorTemplatrue.SeekBarBackgroundColor = 0x00000000;
-    //        cctView.AddChidren(barColorTemplatrue);
-    //        barColorTemplatrue.Y = btnTempClolorMin.Y - (barColorTemplatrue.Height - btnTempClolorMin.Height) / 2;
-    //        barColorTemplatrue.Progress = value;
-    //        //璁剧疆鍒濆鍊�
-    //        btnTempClolor.Text = Language.StringByID(StringId.ColorTemperature) + " " + (barColorTemplatrue.Progress * 100 + "K");
-    //        barColorTemplatrue.OnProgressChangedEvent = (sender, e) =>
-    //        {
-    //            btnTempClolor.Text = Language.StringByID(StringId.ColorTemperature) + " " + (barColorTemplatrue.Progress * 100 + "K");
-    //        };
-    //        barColorTemplatrue.OnStopTrackingTouchEvent = (sender, e) =>
-    //        {
-    //            commandDic[FunctionAttributeKey.CCT] = (barColorTemplatrue.Progress * 100).ToString();
-
-    //            d.Clear();
-    //            d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
-    //            foreach (var light in lightCCT)
-    //            {
-    //                if (light.spk == SPK.LightCCT)
-    //                {
-    //                    Control.Ins.SendWriteCommand(light, d);
-    //                }
-    //            }
-    //        };
-    //        //鍙樻洿鑳屾櫙鍥剧殑Y杞村潗鏍�
-    //        btnColorTemplatrueBack.Y = barColorTemplatrue.Y + (barColorTemplatrue.Height - btnColorTemplatrueBack.Height) / 2;
-
-    //        //6500K
-    //        var btnTempClolorMax = new Button();
-    //        btnTempClolorMax.Y = btnTempClolorMin.Y;
-    //        btnTempClolorMax.X = barColorTemplatrue.Right - Application.GetRealWidth(30);
-    //        btnTempClolorMax.Width = Application.GetRealWidth(54);
-    //        btnTempClolorMax.Height = Application.GetRealHeight(21);
-    //        btnTempClolorMax.Text = "6500K";
-    //        btnTempClolorMax.TextAlignment = TextAlignment.CenterRight;
-    //        btnTempClolorMax.TextColor = CSS_Color.PromptingColor1;
-    //        btnTempClolorMax.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
-    //        cctView.AddChidren(btnTempClolorMax);
-
-    //        #endregion
-
-
-    //    }
-
-    //    /// <summary>
-    //    /// 鍔犺浇rgb灞炴�ц缃帶浠�
-    //    /// </summary>
-    //    /// <param name="attrView"></param>
-    //    void LoadRgbAttrView(VerticalScrolViewLayout attrView)
-    //    {
-
-    //        #region RGB
-
-    //        string value = "255,255,255";
-    //        commandDic.TryGetValue(FunctionAttributeKey.RGB, out value);
-
-    //        var rgbView = new FrameLayout()
-    //        {
-    //            Height = Application.GetRealHeight(248)
-    //        };
-    //        attrView.AddChidren(rgbView);
-
-
-    //        var btnCurColor = new Button()
-    //        {
-    //            X = Application.GetRealWidth(24),
-    //            Y = Application.GetRealHeight(10),
-    //            Width = Application.GetMinRealAverage(24),
-    //            Height = Application.GetMinRealAverage(24),
-    //            Radius = (uint)Application.GetMinRealAverage(8),
-    //            BorderColor = CSS_Color.PromptingColor2,
-    //            BorderWidth = 1,
-    //            BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(commandDic[FunctionAttributeKey.RGB]))
-    //        };
-    //        rgbView.AddChidren(btnCurColor);
-
-    //        //鑹茬洏鐨勬甯冩帶浠�(闄愬埗閭d釜鐧借壊婊戝姩鐞冧娇鐢�)
-    //        var framePickerBack = new FrameLayout();
-    //        framePickerBack.Gravity = Gravity.CenterHorizontal;
-    //        framePickerBack.Y = Application.GetRealHeight(20);
-    //        framePickerBack.Width = Application.GetMinRealAverage(198);
-    //        framePickerBack.Height = Application.GetMinRealAverage(198);
-    //        rgbView.AddChidren(framePickerBack);
-
-    //        var colorPicker = new ColorPicker()
-    //        {
-    //            ColorImagePath = "FunctionIcon/Light/ColorWheel.png",
-    //        };
-    //        framePickerBack.AddChidren(colorPicker);
-
-
-
-
-
-
-    //        //鐧界偣鎺т欢
-    //        var btnWhiteRound = new Button();
-    //        btnWhiteRound.Width = Application.GetRealWidth(24);
-    //        btnWhiteRound.Height = Application.GetRealWidth(24);
-    //        btnWhiteRound.UnSelectedImagePath = "FunctionIcon/Light/ColorWheelTip.png";
-    //        btnWhiteRound.Visible = false;
-    //        framePickerBack.AddChidren(btnWhiteRound);
-
-
-    //        //褰撳墠鐐瑰嚮鐨勩�愮偣銆戞槸鍚︽纭�
-    //        bool pointIsRight = false;
-    //        //鍦嗙殑鍗婂緞(鑰冭檻杈圭晫,闇�瑕佽缃畠鐨勫崐寰勬瘮杈冨皬涓�鐐�)
-    //        int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12);
-
-    //        colorPicker.MouseUpEventHandler = (sender2, e) => {
-    //            d.Clear();
-    //            d.Add(FunctionAttributeKey.RGB, commandDic[FunctionAttributeKey.RGB]);
-    //            foreach (var light in lightCCT)
-    //            {
-    //                if (light.spk == SPK.LightCCT)
-    //                {
-    //                    Control.Ins.SendWriteCommand(light, d);
-    //                }
-    //            }
-    //        };
-    //        colorPicker.ColorChaged += (sender2, e2) => {
-    //            string rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString();
-    //            commandDic[FunctionAttributeKey.RGB] = rgbString;
-    //            btnCurColor.BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(rgbString));
-    //            foreach (var rgbTemp in lightRGB)
-    //            {
-    //                rgbTemp.SetAttrState(FunctionAttributeKey.RGB, rgbString);
-    //            }
-    //        };
-    //        colorPicker.MouseDownEventHandler += (sender, e) =>
-    //        {
-    //            pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y);
-    //            if (pointIsRight == false)
-    //            {
-    //                //鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐�
-    //                return;
-    //            }
-    //            //鏄剧ず鐧界偣
-    //            btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2;
-    //            btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2;
-    //            if (btnWhiteRound.Visible == false)
-    //            {
-    //                btnWhiteRound.Visible = true;
-    //            }
-    //        };
-    //        colorPicker.MouseUpEventHandler = (sender, e) => {
-    //            foreach (var rgbTemp in lightRGB)
-    //            {
-    //                Dictionary<string, string> d = new Dictionary<string, string>();
-    //                d.Add(FunctionAttributeKey.RGB, tempLight.GetRGBcolorString(rgbTemp));
-    //                Control.Ins.SendWriteCommand(rgbTemp, d, false, 0);
-    //            }
-    //        };
-
-    //        colorPicker.MouseMoveEventHandler += (sender, e) =>
-    //        {
-    //            //褰撻紶鏍囩偣涓嬩簨浠跺鐞�
-    //            colorPicker.MouseDownEventHandler(sender, e);
-    //        };
-
-
-    //        #endregion
-
-    //    }
-
-
-    //    /// <summary>
-    //    /// 妫�娴嬬偣鍑荤偣
-    //    /// </summary>
-    //    /// <param name="circleR">鍦嗙殑鍗婂緞</param>
-    //    /// <param name="circleX">鍦嗗績X杞�</param>
-    //    /// <param name="circleY">鍦嗗績Y杞�</param>
-    //    /// <param name="pointX">鐐瑰嚮鐐圭殑X杞�</param>
-    //    /// <param name="pointY">鐐瑰嚮鐐圭殑Y杞�</param>
-    //    /// <returns></returns>
-    //    private bool CheckPoint(int circleR, int circleX, int circleY, int pointX, int pointY)
-    //    {
-    //        int dwidth = circleX - pointX;
-    //        if (dwidth < 0) { dwidth *= -1; }
-
-    //        int dHeight = circleY - pointY;
-    //        if (dHeight < 0) { dHeight *= -1; }
-
-    //        //鏍规嵁涓夎鍑芥暟,姹備笁瑙掑舰鐨勬枩杈归暱
-    //        int dlength = dwidth * dwidth + dHeight * dHeight;
-    //        //鍗婂緞闀垮害(涓嶅紑鏂�,鎵�浠ユ槸鎸夊钩鏂圭畻)
-    //        circleR *= circleR;
-    //        if (dlength < circleR)
-    //        {
-    //            //濡傛灉缁勬垚鐨勪笁瑙掑舰骞舵病鏈夐暱杩囧崐寰�,鍒欎唬琛ㄨ繕鍦ㄥ渾鍐�(涓嶅厑璁哥偣杈圭晫)
-    //            return true;
-    //        }
-    //        return false;
-    //    }
-
-    //}
 
 }
\ No newline at end of file
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs
index 770551c..886a2f0 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs
@@ -1,5 +1,6 @@
 锘縰sing System;
 using System.Collections.Generic;
+using HDL_ON.Common;
 using HDL_ON.DAL.Server;
 using HDL_ON.Entity;
 using HDL_ON.UI.CSS;
@@ -24,9 +25,9 @@
                 (s,c)=>{
                     try
                     {
-                        var page = new AddGroupControlPage(new System.Collections.Generic.List<Function>(),new GroupControl(),
+                        var page = new AddGroupControlPage(null,
                             ()=> {
-
+                                ReadGroupControlList();
                             });
                         MainPage.BasePageView.AddChidren(page);
                         page.LoadPage();
@@ -43,18 +44,35 @@
             };
             bodyView.AddChidren(contentView);
 
+            ReadGroupControlList();
+
+            #region 
+            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
+
+            
+
+            #endregion
+
+        }
+        /// <summary>
+        /// 璇诲彇缁勬帶鏁版嵁
+        /// </summary>
+        private void ReadGroupControlList()
+        {
 
             new System.Threading.Thread(() => {
-                var http = new HttpServerRequest();
-                var pack = http.GetGroupControlList();
-                if(pack != null)
+                var pack = ApiUtlis.Ins.HttpRequest.GetGroupControlList();
+                if (pack != null)
                 {
-                    if(pack.Code == StateCode.SUCCESS  )
+                    if (pack.Code == StateCode.SUCCESS)
                     {
                         try
                         {
                             var groupControlList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString());
-                            LoadGroupControlView(groupControlList);
+                            Application.RunOnMainThread(() =>
+                            {
+                                LoadGroupControlView(groupControlList);
+                            });
                         }
                         catch (Exception ex)
                         {
@@ -66,22 +84,39 @@
                         IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
                     }
                 }
-
-            }) { IsBackground = true }.Start();
-
-            #region 
-            contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8) });
-
-            
-
-            #endregion
+            })
+            { IsBackground = true }.Start();
 
         }
 
 
         private void LoadGroupControlView(List<GroupControl> list)
         {
-            if(list.Count == 0)
+#if DEBUG
+            if (list.Count == 0)
+            {
+                list.Add(new GroupControl()
+                {
+                    name = "缁勫悎璋冨厜1",
+                    roomIds = new List<string> { Room.CurrentSpatial.RoomList[0].roomId },
+                    sid = "00000000000000001",
+                    type = "light",
+                    uids = new List<string>() { Room.CurrentSpatial.RoomList[0].uid },
+                });
+
+                list.Add(new GroupControl()
+                {
+                    name = "缁勫悎璋冨厜2",
+                    roomIds = new List<string> { Room.CurrentSpatial.RoomList[0].roomId },
+                    sid = "00000000000000002",
+                    type = "light",
+                    uids = new List<string>() { Room.CurrentSpatial.RoomList[0].uid },
+                });
+            }
+
+#endif
+
+            if (list.Count == 0)
             {
 
             }
@@ -89,14 +124,25 @@
             {
                 contentView.RemoveAll();
 
-                foreach (var function in list)
+                foreach (var groupControl in list)
                 {
-                    var functionRow = new FrameLayout()
+                    var functionRow = new RowLayout()
                     {
                         Height = Application.GetRealHeight(65),
                         BackgroundColor = CSS_Color.MainBackgroundColor,
+                        LineColor = 0x00000000
                     };
                     contentView.AddChidren(functionRow);
+
+                    var btnRight = new Button()
+                    {
+                        X = Application.GetRealWidth(339),
+                        Gravity = Gravity.CenterVertical,
+                        Width = Application.GetMinRealAverage(16),
+                        Height = Application.GetMinRealAverage(16),
+                        UnSelectedImagePath = "Public/Right.png",
+                    };
+                    functionRow.AddChidren(btnRight);
 
                     var btnFunctionName = new Button()
                     {
@@ -107,7 +153,7 @@
                         TextAlignment = TextAlignment.CenterLeft,
                         TextSize = CSS_FontSize.SubheadingFontSize,
                         TextColor = CSS_Color.FirstLevelTitleColor,
-                        Text = function.name,
+                        Text = groupControl.name,
                     };
                     functionRow.AddChidren(btnFunctionName);
 
@@ -120,7 +166,7 @@
                         TextAlignment = TextAlignment.CenterLeft,
                         TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                         TextColor = CSS_Color.PromptingColor1,
-                        Text = function.GetRoomListName(),
+                        Text = groupControl.GetRoomListName(),
                     };
                     functionRow.AddChidren(btnFunctionLocationInfo);
 
@@ -136,6 +182,77 @@
                             BackgroundColor = CSS_Color.DividingLineColor,
                         });
 
+                    EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
+                        var page = new AddGroupControlPage(groupControl,
+                           () => {
+
+                           });
+                        MainPage.BasePageView.AddChidren(page);
+                        page.LoadPage();
+                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                    };
+                    functionRow.MouseUpEventHandler = eventHandler;
+                    btnRight.MouseUpEventHandler = eventHandler;
+                    btnFunctionName.MouseUpEventHandler = eventHandler;
+                    btnFunctionLocationInfo.MouseUpEventHandler = eventHandler;
+
+                    var btnDelGroupControl = new Button()
+                    {
+                        TextColor = CSS_Color.MainBackgroundColor,
+                        BackgroundColor = CSS_Color.WarningColor,
+                        TextID = StringId.Del,
+                        TextAlignment = TextAlignment.Center,
+                    };
+                    functionRow.AddRightView(btnDelGroupControl);
+                    btnDelGroupControl.MouseUpEventHandler = (sender1, e1) => {
+                        var waitPage = new Loading();
+                        this.AddChidren(waitPage);
+                        waitPage.Start("");
+                        new System.Threading.Thread(() =>
+                        {
+                            try
+                            {
+                                var pack = ApiUtlis.Ins.HttpRequest.DelGroupControl(groupControl.userDeviceGroupControlId);
+                                if (pack != null)
+                                {
+                                    Application.RunOnMainThread(() =>
+                                    {
+                                        try
+                                        {
+                                            if (pack.Code == StateCode.SUCCESS)
+                                            {
+                                                list.Remove(groupControl);
+                                                LoadGroupControlView(list);
+                                            }
+                                            else
+                                            {
+                                                IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                                            }
+                                        }catch(Exception ex)
+                                        {
+                                            MainPage.Log($"鍒锋柊缁勬帶鏁版嵁寮傚父:{ex.Message}");
+                                        }
+                                    });
+                                }
+                            }catch(Exception ex)
+                            {
+                                MainPage.Log($"鍒犻櫎缁勬帶寮傚父:{ex.Message}");
+                            }
+                            finally
+                            {
+                                Application.RunOnMainThread(() => {
+                                    if (waitPage != null)
+                                    {
+                                        waitPage.Hide();
+                                        waitPage.RemoveFromParent();
+                                        waitPage = null;
+                                    }
+                                });
+                            }
+                        })
+                        { IsBackground = true }.Start();
+                    };
+
                 }
 
             }
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs
index 28dea93..1c25db0 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/GroupControl.cs
@@ -1,22 +1,79 @@
 锘縰sing System;
 using System.Collections.Generic;
+using HDL_ON.Common;
+using HDL_ON.DAL.Server;
 using Shared;
 
 namespace HDL_ON.Entity
 {
-    public class GroupControl
+    public class GroupControl : Function
     {
         public GroupControl()
         {
+            spk = "GroupControl";
         }
+        /// <summary>
+        /// 缇ゆ帶ID
+        /// </summary>
+        public string userDeviceGroupControlId = string.Empty;
         /// <summary>
         /// 缇ゆ帶sid
         /// </summary>
-        public string sid = string.Empty;
+        //public string sid = string.Empty;
+        /// <summary>
+        /// 鐢熸垚缇ゆ帶sid
+        /// </summary>
+        public string NewGroupControlSid()
+        {
+            string sceneId = "";
+            try
+            {
+                string sOidBeginsWith = "000101";//鍘傚晢 + 閫氳鏂瑰紡
+                DateTime dt = DateTime.Now;
+                DateTime startTime = TimeZoneInfo.ConvertTimeToUtc(new DateTime(2020, 1, 1));
+                long m = (long)((dt - startTime).TotalMilliseconds / 10);
+                string sTimeSpan = "00000000";
+
+                byte[] arry = new byte[4];
+                arry[0] = (byte)(m & 0xFF);
+                arry[1] = (byte)((m & 0xFF00) >> 8);
+                arry[2] = (byte)((m & 0xFF0000) >> 16);
+                arry[3] = (byte)((m >> 24) & 0xFF);
+                sTimeSpan = arry[0].ToString("X2") + arry[1].ToString("X2") + arry[2].ToString("X2") + arry[3].ToString("X2");
+
+
+                if (sTimeSpan.Length >= 8)
+                {
+                    sTimeSpan = sTimeSpan.Substring(0, 8);
+                }
+                else
+                {
+                    sTimeSpan = Guid.NewGuid().ToString().Substring(0, 8);
+                    //sTimeSpan = "00000000";
+                }
+
+                sceneId = sOidBeginsWith + sTimeSpan;
+
+                sceneId += "AA";
+                sceneId += "AA01";
+                int maxId = 1;
+
+                Random random = new Random(Guid.NewGuid().GetHashCode());
+                maxId = random.Next(10);
+
+                sceneId += (maxId + 1).ToString("X4");
+                sceneId += "0000";
+            }
+            catch
+            {
+                return sceneId;
+            }
+            return sceneId;
+        }
         /// <summary>
         /// 缇ゆ帶鍚嶇О
         /// </summary>
-        public string name = string.Empty;
+        //public string name = string.Empty;
         /// <summary>
         /// 缇ゆ帶绫诲瀷
         /// </summary>
@@ -25,39 +82,69 @@
         /// 鎴块棿uid
         /// </summary>
         public List<String> uids = new List<string>();
-        public List<String> roomIds = new List<string>();
+        //public List<String> roomIds = new List<string>();
         /// <summary>
         /// 缇ゆ帶鍔熻兘sid閰嶇疆
         /// </summary>
         public List<GroupControlFunction> sids = new List<GroupControlFunction>();
 
-
+        ///// <summary>
+        ///// 鑾峰彇璁惧娣诲姞鍒版埧闂寸殑鎴块棿鍚嶇О
+        ///// </summary>
+        ///// <returns></returns>
+        //public string GetRoomListName()
+        //{
+        //    string roomNameList = "";
+        //    foreach (var roomId in roomIds)
+        //    {
+        //        var findRoom = SpatialInfo.CurrentSpatial.RoomList.Find(obj => obj.roomId == roomId);
+        //        if (findRoom == null)
+        //        {
+        //            continue;
+        //        }
+        //        if (roomNameList != "")
+        //        {
+        //            roomNameList += ",";
+        //        }
+        //        roomNameList += findRoom.floorName + "-" + findRoom.roomName;
+        //    }
+        //    if (roomNameList == "")
+        //    {
+        //        roomNameList = Language.StringByID(StringId.WholeZone);
+        //    }
+        //    return roomNameList;
+        //}
 
         /// <summary>
-        /// 鑾峰彇璁惧娣诲姞鍒版埧闂寸殑鎴块棿鍚嶇О
+        /// 缇ゆ帶鎺у埗
         /// </summary>
-        /// <returns></returns>
-        public string GetRoomListName()
+        /// <param name="pairs"></param>
+        public void Control(Dictionary<string,object> pairs)
         {
-            string roomNameList = "";
-            foreach (var roomId in roomIds)
+            try
             {
-                var findRoom = SpatialInfo.CurrentSpatial.RoomList.Find(obj => obj.roomId == roomId);
-                if (findRoom == null)
+                var controlValues = new Dictionary<string, object>();
+                foreach(var p in pairs)
                 {
-                    continue;
+                    controlValues.Add("key", p.Key);
+                    controlValues.Add("value", p.Value);
                 }
-                if (roomNameList != "")
+                var pack = ApiUtlis.Ins.HttpRequest.ControlGroupControl(userDeviceGroupControlId, controlValues);
+                if (pack != null)
                 {
-                    roomNameList += ",";
+                    if (pack.Code == StateCode.SUCCESS)
+                    {
+                        //DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl.
+                    }
+                    else
+                    {
+                        MainPage.Log($"缇ゆ帶鎺у埗澶辫触,Code: {pack.Code}");
+                    }
                 }
-                roomNameList += findRoom.floorName + "-" + findRoom.roomName;
             }
-            if (roomNameList == "")
-            {
-                roomNameList = Language.StringByID(StringId.WholeZone);
+            catch (Exception ex){
+                MainPage.Log($"缇ゆ帶鎺у埗澶辫触: {ex.Message}");
             }
-            return roomNameList;
         }
     }
 
@@ -71,6 +158,29 @@
         /// 鍔熻兘spk
         /// </summary>
         public string spk = string.Empty;
+
+
+    }
+
+
+    public class GroupControlType
+    {
+        /// <summary>
+        /// 绫诲瀷
+        /// </summary>
+        public string type = string.Empty;
+        /// <summary>
+        /// 绫诲瀷鍚嶇О
+        /// </summary>
+        public string typeName = string.Empty;
+        /// <summary>
+        /// 缇ゆ帶鏀寔鐨剆pk
+        /// </summary>
+        public List<string> spks = new List<string>();
+        /// <summary>
+        /// 缇ゆ帶鏀寔鐨剆pk灞炴��
+        /// </summary>
+        public List<string> spkAttrs = new List<string>();
     }
 }
 
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
index 4ca2bdf..b5b4628 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs
@@ -164,6 +164,7 @@
             bodyView = this;
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
         }
+
         public void LoadView()
         {
             #region 涓汉淇℃伅
@@ -296,7 +297,7 @@
             #region 浣忓畢淇℃伅鍖哄煙
             if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare
                 && DB_ResidenceData.Instance.GatewayType == 1
-                && DB_ResidenceData.Instance.CurrentRegion.isSupportGroupControl)
+                && DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
             {
                 residenceInfoView = new FrameLayout()
                 {
@@ -586,7 +587,7 @@
                     residenceAddFunctionView.AddChidren(btnResidenceAddFunctionText);
                     #endregion
 
-                    if (DB_ResidenceData.Instance.CurrentRegion.isSupportGroupControl)
+                    if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
                     {
                         residenceFunctionCount++;
                         #region ---缁勫悎璋冨厜
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage.cs
new file mode 100644
index 0000000..9b0088a
--- /dev/null
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/GroupControlPage.cs
@@ -0,0 +1,585 @@
+锘�
+using System;
+using System.Collections.Generic;
+using HDL_ON.Entity;
+using HDL_ON.UI.CSS;
+using Shared;
+
+namespace HDL_ON.UI
+{
+    /// <summary>
+    /// 鐏厜鍦烘櫙缂栬緫寮圭獥
+    /// </summary>
+    public class GroupControlPage : Dialog
+    {
+        GroupControl group;
+        public GroupControlPage(GroupControl groupControl)
+        {
+            group = groupControl;
+            if(group == null)
+            {
+                group = new GroupControl();
+            }
+        }
+
+
+        public void ShowDialog()
+        {
+            var hadDimming = false;
+            var hadCCT = false;
+            var hadRGB = false;
+
+            foreach (var temp in group.sids)
+            {
+                if (temp.spk == SPK.LightRGB)
+                {
+                    hadRGB = true;
+                }
+                else if (temp.spk == SPK.LightCCT)
+                {
+                    hadCCT = true;
+                }else if (temp.spk == SPK.LightDimming)
+                {
+                    hadDimming = true;
+                }
+
+                if(hadDimming && hadCCT && hadRGB)
+                {
+                    break;
+                }
+            }
+
+
+            var bodyView = new FrameLayout();
+            this.AddChidren(bodyView);
+            //bodyView.MouseUpEventHandler = (sender, e) =>
+            //{
+            //    this.Close();
+            //};
+
+            var contentView = new FrameLayout()
+            {
+                BackgroundColor = CSS_Color.MainBackgroundColor,
+                Width = Application.GetRealWidth(343),
+                Radius = (uint)Application.GetRealWidth(12),
+            };
+            bodyView.AddChidren(contentView);
+
+            #region 鏍囬鍖�
+            var titleView = new FrameLayout()
+            {
+                Width = Application.GetRealWidth(343),
+                Height = Application.GetRealHeight(52),
+            };
+            contentView.AddChidren(titleView);
+
+            var btnTitle = new Button()
+            {
+                Height = Application.GetRealHeight(52),
+                Gravity = Gravity.Center,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextColor = CSS_Color.MainColor,
+                TextID = StringId.CombinedDimming,
+                TextAlignment = TextAlignment.Center,
+            };
+            if (btnTitle.GetTextWidth() > Application.GetRealWidth(197))//247
+            {
+                btnTitle.Width = Application.GetRealWidth(197);
+                btnTitle.IsMoreLines = true;
+            }
+            else
+            {
+                btnTitle.Width = btnTitle.GetTextWidth() + Application.GetRealWidth(10);
+                btnTitle.IsMoreLines = false;
+            }
+            titleView.AddChidren(btnTitle);
+
+            var btnEditIcon = new Button()
+            {
+                Width = Application.GetRealWidth(24),
+                Height = Application.GetRealWidth(24),
+                X = Application.GetRealWidth(12) + btnTitle.Right,
+                Gravity = Gravity.CenterVertical,
+                UnSelectedImagePath = "Public/Edit.png",
+            };
+           
+            btnTitle.Text = group.name;
+            btnTitle.Width = btnTitle.GetTextWidth() + Application.GetRealWidth(10);
+            btnTitle.Gravity = Gravity.Center;
+
+            titleView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor, Y = Application.GetRealHeight(51) });
+
+            #endregion
+
+            //灞炴�ц缃尯鍩�
+            var attrView = new VerticalScrolViewLayout()
+            {
+                Y = Application.GetRealHeight(52),
+                Width = Application.GetRealWidth(343),
+                ScrollEnabled = false,
+            };
+            //灞炴�ц缃尯鍩熼珮搴�
+            int attrViewHight = Application.GetRealHeight(18 + 22);
+
+
+            //鍙湁缁х數鍣�
+            if (!hadDimming && !hadCCT && !hadRGB)
+            {
+                attrViewHight += Application.GetRealHeight(50);
+                attrView.Height = attrViewHight;
+                contentView.AddChidren(attrView);
+                attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) });
+
+                var view = new FrameLayout()
+                {
+                    Width = Application.GetRealWidth(343),
+                    Height = Application.GetRealHeight(50),
+                };
+                attrView.AddChidren(view);
+
+
+                var btnClose = new Button()
+                {
+                    X = Application.GetRealWidth(50),
+                    Gravity = Gravity.CenterVertical,
+                    Width = Application.GetRealWidth(98),
+                    Height = Application.GetRealHeight(40),
+                    TextColor = CSS_Color.TextualColor,
+                    SelectedBackgroundColor = CSS_Color.MainColor,
+                    SelectedTextColor = CSS_Color.MainBackgroundColor,
+                    BackgroundColor = CSS_Color.DividingLineColor,
+                    TextID = StringId.OFF,
+                    TextSize = CSS_FontSize.TextFontSize,
+                    Radius = (uint)Application.GetRealWidth(5),
+                    IsSelected = true,
+                    //BorderWidth = 1,
+                    //BorderColor = 0x00000000
+                };
+                view.AddChidren(btnClose);
+
+                var btnOpen = new Button()
+                {
+                    X = Application.GetRealWidth(100 + 98),
+                    Gravity = Gravity.CenterVertical,
+                    Width = Application.GetRealWidth(98),
+                    Height = Application.GetRealHeight(40),
+                    TextColor = CSS_Color.TextualColor,
+                    SelectedBackgroundColor = CSS_Color.MainColor,
+                    SelectedTextColor = CSS_Color.MainBackgroundColor,
+                    BackgroundColor = CSS_Color.DividingLineColor,
+                    TextID = StringId.On,
+                    TextSize = CSS_FontSize.TextFontSize,
+                    Radius = (uint)Application.GetRealWidth(5),
+                };
+                view.AddChidren(btnOpen);
+
+                btnClose.MouseUpEventHandler = (sender, e) =>
+                {
+                    btnClose.IsSelected = true;
+                    btnOpen.IsSelected = false;
+                    var d = new Dictionary<string, object>();
+                    d.Add(FunctionAttributeKey.OnOff, "off");
+                    group.Control(d);
+                };
+                btnOpen.MouseUpEventHandler = (sender, e) =>
+                {
+                    btnClose.IsSelected = false;
+                    btnOpen.IsSelected = true;
+
+                    var d = new Dictionary<string, object>();
+                    d.Add(FunctionAttributeKey.OnOff, "on");
+                    group.Control(d);
+                };
+
+            }
+
+            else
+            {
+                if (hadRGB)
+                {
+                    attrViewHight += Application.GetRealHeight(248);
+                    hadDimming = true;
+                }
+                if (hadCCT)
+                {
+                    attrViewHight += Application.GetRealHeight(54 + 11);
+                    hadDimming = true;
+                }
+                if (hadDimming)
+                {
+                    attrViewHight += Application.GetRealHeight(54 + 11);
+                }
+                attrView.Height = attrViewHight;
+                contentView.AddChidren(attrView);
+                attrView.AddChidren(new Button() { Height = Application.GetRealHeight(18) });
+
+
+                if (hadDimming)
+                {
+                    LoadDimmingAttrView(attrView);
+                }
+                if (hadCCT)
+                {
+                    LoadCctAttrView(attrView);
+                }
+                if (hadRGB)
+                {
+                    LoadRgbAttrView(attrView);
+                }
+            }
+
+            contentView.Height = Application.GetRealHeight(52 + 44) + attrViewHight;
+            contentView.Gravity = Gravity.Center;
+
+
+            var bottomView = new FrameLayout()
+            {
+                Y = Application.GetRealHeight(52) + attrViewHight,
+                Height = Application.GetRealHeight(46),
+            };
+            contentView.AddChidren(bottomView);
+            bottomView.AddChidren(new Button() { Height = 1, BackgroundColor = CSS_Color.DividingLineColor });
+
+            var btnCloseDialog = new Button()
+            {
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS_Color.TextualColor,
+                TextID = StringId.Close,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+            };
+            bottomView.AddChidren(btnCloseDialog);
+            btnCloseDialog.MouseUpEventHandler = (sender, e) => {
+                this.Close();
+            };
+
+
+            this.Show();
+
+        }
+
+        /// <summary>
+        /// 鍔犺浇璋冨厜灞炴�ц缃帶浠�
+        /// </summary>
+        /// <param name="attrView"></param>
+        void LoadDimmingAttrView(VerticalScrolViewLayout attrView)
+        {
+            var dimmingView = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(54 + 11)
+            };
+            attrView.AddChidren(dimmingView);
+
+            #region 浜害璋冭妭
+            var btnBrightnessText = new Button()
+            {
+                X = Application.GetRealWidth(35),
+                Y = Application.GetRealHeight(1),
+                Width = Application.GetRealWidth(224),
+                Height = Application.GetRealHeight(25),
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = CSS_Color.FirstLevelTitleColor,
+                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                TextID = StringId.Brightness,
+            };
+            btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + group.GetAttrState(FunctionAttributeKey.Brightness) + "%";
+            dimmingView.AddChidren(btnBrightnessText);
+
+
+            var btnMinValuesText = new Button()
+            {
+                X = Application.GetRealWidth(35),
+                Y = btnBrightnessText.Bottom,
+                Width = Application.GetRealWidth(40),
+                Height = Application.GetRealHeight(21),
+                Text = "0%",
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = CSS_Color.PromptingColor1,
+                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+            };
+            dimmingView.AddChidren(btnMinValuesText);
+
+            var dimmerBar = new DiyImageSeekBar()
+            {
+                X = Application.GetRealWidth(45 + 10),
+                Y = Application.GetRealHeight(11),
+                Width = Application.GetRealWidth(220),
+                Height = Application.GetRealHeight(54),
+                SeekBarViewHeight = Application.GetRealHeight(8),
+                ThumbImagePath = "Public/ThumbImage.png",
+                ThumbImageHeight = Application.GetRealHeight(54),
+                ProgressTextColor = CSS_Color.FirstLevelTitleColor,
+                ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+                ProgressBarColor = CSS_Color.AuxiliaryColor1,
+                MaxValue = 100,
+                SeekBarPadding = Application.GetRealWidth(20),
+                IsProgressTextShow = false,
+                ProgressChangeDelayTime = 0,
+            };
+            dimmingView.AddChidren(dimmerBar);
+            dimmerBar.OnProgressChangedEvent = (sender, e) =>
+            {
+                btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + e + "%";
+            };
+            dimmerBar.OnStopTrackingTouchEvent = (sender, e) =>
+            {
+                btnBrightnessText.Text = Language.StringByID(StringId.Brightness) + " " + e + "%";
+
+                var d = new Dictionary<string, object>();
+                d.Add(FunctionAttributeKey.Brightness, e.ToString());
+                group.Control(d);
+            };
+
+
+            var btnMaxValuesText = new Button()
+            {
+                X = dimmerBar.Right,
+                Y = btnBrightnessText.Bottom,
+                Width = Application.GetRealWidth(55),
+                Height = Application.GetRealHeight(21),
+                Text = "100%",
+                TextAlignment = TextAlignment.CenterLeft,
+                TextColor = CSS_Color.PromptingColor1,
+                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+            };
+            dimmingView.AddChidren(btnMaxValuesText);
+            #endregion
+
+        }
+
+        /// <summary>
+        /// 鍔犺浇cct灞炴�ц缃帶浠�
+        /// </summary>
+        /// <param name="attrView"></param>
+        void LoadCctAttrView(VerticalScrolViewLayout attrView)
+        {
+            #region 鑹叉俯
+            var cctView = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(54 + 11)
+            };
+            attrView.AddChidren(cctView);
+
+
+            //鑹叉俯
+            var btnTempClolor = new Button();
+            btnTempClolor.X = Application.GetRealWidth(35);
+            btnTempClolor.Y = Application.GetRealHeight(1);
+            btnTempClolor.Width = Application.GetRealWidth(224);
+            btnTempClolor.Height = Application.GetRealHeight(21);
+            btnTempClolor.TextAlignment = TextAlignment.CenterLeft;
+            btnTempClolor.TextColor = CSS_Color.FirstLevelTitleColor;
+            btnTempClolor.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+            btnTempClolor.TextID = StringId.ColorTemperature;
+            cctView.AddChidren(btnTempClolor);
+
+            //2700K
+            var btnTempClolorMin = new Button()
+            {
+                X = Application.GetRealWidth(35),
+                Y = btnTempClolor.Bottom,
+                Width = Application.GetRealWidth(40),
+                Height = Application.GetRealHeight(21),
+            };
+            btnTempClolorMin.Width = Application.GetRealWidth(54);
+            btnTempClolorMin.Height = Application.GetRealHeight(21);
+            btnTempClolorMin.Text = "2700K";
+            btnTempClolorMin.TextAlignment = TextAlignment.CenterLeft;
+            btnTempClolorMin.TextColor = CSS_Color.PromptingColor1;
+            btnTempClolorMin.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+            cctView.AddChidren(btnTempClolorMin);
+
+            //婊戝姩鏉$殑鑳屾櫙鍥剧墖
+            var btnColorTemplatrueBack = new Button()
+            {
+                X = Application.GetRealWidth(55 + 22 + 15),
+                Y = Application.GetRealHeight(11),
+                Width = Application.GetRealWidth(180),
+                Height = Application.GetRealHeight(54),
+            };
+            btnColorTemplatrueBack.UnSelectedImagePath = "FunctionIcon/Light/ColorTemperatureBar.png";
+            btnColorTemplatrueBack.Height = Application.GetRealHeight(8);
+            btnColorTemplatrueBack.Gravity = Gravity.CenterHorizontal;
+            cctView.AddChidren(btnColorTemplatrueBack);
+            //婊戝姩鏉℃帶浠�
+            var barColorTemplatrue = new CCTSeekBarControl()
+            {
+                X = Application.GetRealWidth(55 + 22),
+                Y = Application.GetRealHeight(11),
+                Width = Application.GetRealWidth(220),
+                Height = Application.GetRealHeight(54),
+            };
+            barColorTemplatrue.MinValue = 27;
+            barColorTemplatrue.MaxValue = 65;
+            barColorTemplatrue.ProgressBarColor = 0x00000000;//鍏ㄩ儴閫忔槑
+            barColorTemplatrue.ProgressBarUnEnableColor = 0x00000000;
+            barColorTemplatrue.SeekBarBackgroundColor = 0x00000000;
+            cctView.AddChidren(barColorTemplatrue);
+            barColorTemplatrue.Y = btnTempClolorMin.Y - (barColorTemplatrue.Height - btnTempClolorMin.Height) / 2;
+            //璁剧疆鍒濆鍊�
+            btnTempClolor.Text = Language.StringByID(StringId.ColorTemperature) + " " + (barColorTemplatrue.Progress * 100 + "K");
+            barColorTemplatrue.OnProgressChangedEvent = (sender, e) =>
+            {
+                btnTempClolor.Text = Language.StringByID(StringId.ColorTemperature) + " " + (barColorTemplatrue.Progress * 100 + "K");
+            };
+            barColorTemplatrue.OnStopTrackingTouchEvent = (sender, e) =>
+            {
+                var d = new Dictionary<string, object>();
+                d.Add(FunctionAttributeKey.CCT, (barColorTemplatrue.Progress * 100).ToString());
+                group.Control(d);
+            };
+            //鍙樻洿鑳屾櫙鍥剧殑Y杞村潗鏍�
+            btnColorTemplatrueBack.Y = barColorTemplatrue.Y + (barColorTemplatrue.Height - btnColorTemplatrueBack.Height) / 2;
+
+            //6500K
+            var btnTempClolorMax = new Button();
+            btnTempClolorMax.Y = btnTempClolorMin.Y;
+            btnTempClolorMax.X = barColorTemplatrue.Right - Application.GetRealWidth(30);
+            btnTempClolorMax.Width = Application.GetRealWidth(54);
+            btnTempClolorMax.Height = Application.GetRealHeight(21);
+            btnTempClolorMax.Text = "6500K";
+            btnTempClolorMax.TextAlignment = TextAlignment.CenterRight;
+            btnTempClolorMax.TextColor = CSS_Color.PromptingColor1;
+            btnTempClolorMax.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+            cctView.AddChidren(btnTempClolorMax);
+
+            #endregion
+
+
+        }
+
+        /// <summary>
+        /// 鍔犺浇rgb灞炴�ц缃帶浠�
+        /// </summary>
+        /// <param name="attrView"></param>
+        void LoadRgbAttrView(VerticalScrolViewLayout attrView)
+        {
+
+            #region RGB
+            var rgbView = new FrameLayout()
+            {
+                Height = Application.GetRealHeight(248)
+            };
+            attrView.AddChidren(rgbView);
+
+
+            var btnCurColor = new Button()
+            {
+                X = Application.GetRealWidth(24),
+                Y = Application.GetRealHeight(10),
+                Width = Application.GetMinRealAverage(24),
+                Height = Application.GetMinRealAverage(24),
+                Radius = (uint)Application.GetMinRealAverage(8),
+                BorderColor = CSS_Color.PromptingColor2,
+                BorderWidth = 1,
+                //BackgroundColor = (uint)(0xFF000000 + tempLight.GetRGBcolor(commandDic[FunctionAttributeKey.RGB]))
+            };
+            rgbView.AddChidren(btnCurColor);
+
+            //鑹茬洏鐨勬甯冩帶浠�(闄愬埗閭d釜鐧借壊婊戝姩鐞冧娇鐢�)
+            var framePickerBack = new FrameLayout();
+            framePickerBack.Gravity = Gravity.CenterHorizontal;
+            framePickerBack.Y = Application.GetRealHeight(20);
+            framePickerBack.Width = Application.GetMinRealAverage(198);
+            framePickerBack.Height = Application.GetMinRealAverage(198);
+            rgbView.AddChidren(framePickerBack);
+
+            var colorPicker = new ColorPicker()
+            {
+                ColorImagePath = "FunctionIcon/Light/ColorWheel.png",
+            };
+            framePickerBack.AddChidren(colorPicker);
+
+
+
+
+
+
+            //鐧界偣鎺т欢
+            var btnWhiteRound = new Button();
+            btnWhiteRound.Width = Application.GetRealWidth(24);
+            btnWhiteRound.Height = Application.GetRealWidth(24);
+            btnWhiteRound.UnSelectedImagePath = "FunctionIcon/Light/ColorWheelTip.png";
+            btnWhiteRound.Visible = false;
+            framePickerBack.AddChidren(btnWhiteRound);
+
+
+            //褰撳墠鐐瑰嚮鐨勩�愮偣銆戞槸鍚︽纭�
+            bool pointIsRight = false;
+            //鍦嗙殑鍗婂緞(鑰冭檻杈圭晫,闇�瑕佽缃畠鐨勫崐寰勬瘮杈冨皬涓�鐐�)
+            int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12);
+            string rgbString = "255,255,255";
+            var rgbTemp = new Light();
+            colorPicker.MouseUpEventHandler = (sender2, e2) =>
+            {
+                var d = new Dictionary<string, object>();
+                d.Add(FunctionAttributeKey.RGB, rgbString);
+                group.Control(d);
+            };
+            colorPicker.ColorChaged += (sender2, e2) =>
+            {
+                rgbString = (e2[0] + "," + e2[1] + "," + e2[2]).ToString();
+                btnCurColor.BackgroundColor = (uint)(0xFF000000 + rgbTemp.GetRGBcolor(rgbString));
+                var d = new Dictionary<string, object>();
+                d.Add(FunctionAttributeKey.RGB, rgbString);
+                group.Control(d);
+            };
+            colorPicker.MouseDownEventHandler += (sender, e) =>
+            {
+                pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y);
+                if (pointIsRight == false)
+                {
+                    //鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐�
+                    return;
+                }
+                //鏄剧ず鐧界偣
+                btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2;
+                btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2;
+                if (btnWhiteRound.Visible == false)
+                {
+                    btnWhiteRound.Visible = true;
+                }
+            };
+
+            colorPicker.MouseMoveEventHandler += (sender, e) =>
+            {
+                //褰撻紶鏍囩偣涓嬩簨浠跺鐞�
+                colorPicker.MouseDownEventHandler(sender, e);
+            };
+
+
+            #endregion
+
+        }
+
+
+        /// <summary>
+        /// 妫�娴嬬偣鍑荤偣
+        /// </summary>
+        /// <param name="circleR">鍦嗙殑鍗婂緞</param>
+        /// <param name="circleX">鍦嗗績X杞�</param>
+        /// <param name="circleY">鍦嗗績Y杞�</param>
+        /// <param name="pointX">鐐瑰嚮鐐圭殑X杞�</param>
+        /// <param name="pointY">鐐瑰嚮鐐圭殑Y杞�</param>
+        /// <returns></returns>
+        private bool CheckPoint(int circleR, int circleX, int circleY, int pointX, int pointY)
+        {
+            int dwidth = circleX - pointX;
+            if (dwidth < 0) { dwidth *= -1; }
+
+            int dHeight = circleY - pointY;
+            if (dHeight < 0) { dHeight *= -1; }
+
+            //鏍规嵁涓夎鍑芥暟,姹備笁瑙掑舰鐨勬枩杈归暱
+            int dlength = dwidth * dwidth + dHeight * dHeight;
+            //鍗婂緞闀垮害(涓嶅紑鏂�,鎵�浠ユ槸鎸夊钩鏂圭畻)
+            circleR *= circleR;
+            if (dlength < circleR)
+            {
+                //濡傛灉缁勬垚鐨勪笁瑙掑舰骞舵病鏈夐暱杩囧崐寰�,鍒欎唬琛ㄨ繕鍦ㄥ渾鍐�(涓嶅厑璁哥偣杈圭晫)
+                return true;
+            }
+            return false;
+        }
+
+    }
+}
\ No newline at end of file
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs
index 0eb7ff8..c908e90 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/LightScene/AddLightScene.cs
@@ -421,13 +421,14 @@
                 SelectedImagePath = "FunctionIcon/Light/LightScene/CheckOnIcon.png",
                 IsSelected = functions.Find((obj) => obj.deviceId == function.deviceId) != null
             };
-            if (DB_ResidenceData.Instance.CurrentRegion.isSupportGroupControl)
+            if (DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
             {
                 btnSelect.X = Application.GetRealWidth(323);
             }
             bodyDiv.AddChidren(btnSelect);
             
             btnSelect.MouseUpEventHandler = (sender, e) => {
+                Application.HideSoftInput();
                 btnSelect.IsSelected = !btnSelect.IsSelected;
                 if(btnSelect.IsSelected)
                 {
diff --git a/SiriIntents/Server/HttpUtil.cs b/SiriIntents/Server/HttpUtil.cs
index dc7aca0..8d4483c 100644
--- a/SiriIntents/Server/HttpUtil.cs
+++ b/SiriIntents/Server/HttpUtil.cs
@@ -16,8 +16,8 @@
         /// 鍥哄畾鍩熷悕,姝e紡鐜
         /// 鍏叡鍩熷悕灏辫繎瑙f瀽
         /// </summary>
-        //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
-        public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
+        public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com";
+        //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";
         const string APP_KEY = "HDL-HOME-APP-TEST";
         const string SECRET_KEY = "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss";
         //public const string GlobalRequestHttpsHost = "http://59.41.255.150:7777";//mmmm
diff --git a/ys/ys.csproj b/ys/ys.csproj
index 33fcc4e..3b95c55 100644
--- a/ys/ys.csproj
+++ b/ys/ys.csproj
@@ -54,6 +54,11 @@
     <TransformFile Include="Transforms\EnumMethods.xml" />
   </ItemGroup>
   <ItemGroup>
+    <PackageReference Include="Square.OkHttp3">
+      <Version>3.8.0</Version>
+    </PackageReference>
+  </ItemGroup>
+  <ItemGroup>
     <LibraryProjectZip Include="Jars\hdl_ezvizsdk.aar" />
   </ItemGroup>
   <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.Bindings.targets" />

--
Gitblit v1.8.0