Explorar o código

⚠️⚠️⚠️目前环境地址是测试环境,固定写死⚠️⚠️⚠️
已完成一期所有需求的开发工作,UI 略有不符合设计稿的地方,原因有两点,一是设计不合理,而是改动较为复杂。

Kevin hai 1 ano
pai
achega
98846b48d3
Modificáronse 58 ficheiros con 448 adicións e 197 borrados
  1. 4 2
      Temperature.xcodeproj/project.pbxproj
  2. BIN=BIN
      Temperature/Assets.xcassets/Home/.DS_Store
  3. BIN=BIN
      Temperature/Assets.xcassets/devCtl/.DS_Store
  4. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_fan.imageset/icon_fan@2x.png
  5. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_fan.imageset/icon_fan@3x.png
  6. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_newair.imageset/icon_newair@2x.png
  7. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_newair.imageset/icon_newair@3x.png
  8. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_newair_sel.imageset/icon_newair_sel@2x.png
  9. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_newair_sel.imageset/icon_newair_sel@3x.png
  10. 2 2
      Temperature/Assets.xcassets/devCtl/icon_on_1.imageset/Contents.json
  11. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_on_1.imageset/icon_on_1@2x.png
  12. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_on_1.imageset/icon_on_1@3x.png
  13. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_on_1.imageset/icon_on_sel 1@2x.png
  14. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_on_1.imageset/icon_on_sel 1@3x.png
  15. 2 2
      Temperature/Assets.xcassets/devCtl/icon_on_sel_1.imageset/Contents.json
  16. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_on_sel_1.imageset/icon_on_sel@2x.png
  17. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_on_sel_1.imageset/icon_on_sel@3x.png
  18. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_on_sel_1.imageset/icon_on_sel_1@2x.png
  19. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_on_sel_1.imageset/icon_on_sel_1@3x.png
  20. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_point.imageset/icon_point@2x.png
  21. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_point.imageset/icon_point@3x.png
  22. 22 0
      Temperature/Assets.xcassets/devCtl/icon_sleep.imageset/Contents.json
  23. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_sleep.imageset/icon_sleep@2x.png
  24. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_sleep.imageset/icon_sleep@3x.png
  25. 22 0
      Temperature/Assets.xcassets/devCtl/icon_sleep_sel.imageset/Contents.json
  26. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_sleep_sel.imageset/icon_sleep_sel@2x.png
  27. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_sleep_sel.imageset/icon_sleep_sel@3x.png
  28. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_time.imageset/icon_time@2x.png
  29. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_time.imageset/icon_time@3x.png
  30. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_time_sel.imageset/icon_time_sel@2x.png
  31. BIN=BIN
      Temperature/Assets.xcassets/devCtl/icon_time_sel.imageset/icon_time_sel@3x.png
  32. 3 0
      Temperature/ControlModule/Home/Controller/RDSAddRoomVC.h
  33. 3 1
      Temperature/ControlModule/Home/Controller/RDSAddRoomVC.m
  34. 37 15
      Temperature/ControlModule/Home/Controller/RDSAirControlVC.m
  35. 153 123
      Temperature/ControlModule/Home/Controller/RDSAirControlVC.xib
  36. 3 0
      Temperature/ControlModule/Home/Controller/RDSBindDeviceVC.h
  37. 2 0
      Temperature/ControlModule/Home/Controller/RDSBindSubDeviceVC.h
  38. 1 1
      Temperature/ControlModule/Home/Controller/RDSBindSubDeviceVC.m
  39. 1 1
      Temperature/ControlModule/Home/Controller/RDSHomeVC.m
  40. 2 0
      Temperature/ControlModule/Home/Controller/RDSInputWiFiVC.h
  41. 1 0
      Temperature/ControlModule/Home/Controller/RDSInputWiFiVC.m
  42. 3 0
      Temperature/ControlModule/Home/Controller/RDSResetDeviceVC.h
  43. 4 2
      Temperature/ControlModule/Home/Controller/RDSResetDeviceVC.m
  44. 12 0
      Temperature/ControlModule/Home/Controller/RDSSelectDeviceSubVC.m
  45. 11 11
      Temperature/ControlModule/Home/Controller/RDSSubControlVC.m
  46. 27 19
      Temperature/ControlModule/Home/Controller/RDSSubControlVC.xib
  47. 2 0
      Temperature/ControlModule/Home/Model/RDSDeviceTypeModel.h
  48. 9 0
      Temperature/ControlModule/Home/Model/RDSDeviceTypeModel.m
  49. 1 1
      Temperature/ControlModule/Home/View/RDSCtrlModeView.m
  50. 74 2
      Temperature/ControlModule/Home/View/RDSRoomCell.m
  51. 1 1
      Temperature/ControlModule/Room/Controller/RDSRoomVC.m
  52. 5 0
      Temperature/ControlModule/Room/Model/RDSRoomModel.h
  53. 8 0
      Temperature/ControlModule/Room/Model/RDSRoomModel.m
  54. 0 6
      Temperature/Info.plist
  55. 5 1
      Temperature/NetWork/RDSDemoApiHelper.h
  56. 20 1
      Temperature/NetWork/RDSDemoApiHelper.m
  57. 3 3
      Temperature/ThirdPart/CYCircularSlider/CYCircularSlider.m
  58. 5 3
      Temperature/Tools/Slider/RDSlider.m

+ 4 - 2
Temperature.xcodeproj/project.pbxproj

@@ -1827,7 +1827,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 2023061215;
-				DEVELOPMENT_TEAM = FBAS2Y3Z2S;
+				DEVELOPMENT_TEAM = Z675BR2K4U;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)/Temperature/Tools/Location/BaiduMapSDK",
@@ -1837,6 +1837,7 @@
 				INFOPLIST_FILE = Temperature/Info.plist;
 				INFOPLIST_KEY_CFBundleDisplayName = "永续绿建五恒";
 				INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "开启后,才能连接设备";
+				INFOPLIST_KEY_NSBluetoothPeripheralUsageDescription = "需要打开蓝牙,才能添加主控面板设备";
 				INFOPLIST_KEY_NSCameraUsageDescription = "App需要您的同意,才能使用相机设置用户头像";
 				INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "开启后,才能获取定位信息,用于绑定设备和加载天气信息";
 				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "开启后,才能获取定位信息,用于加载天气信息";
@@ -1873,7 +1874,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
 				CURRENT_PROJECT_VERSION = 2023061215;
-				DEVELOPMENT_TEAM = FBAS2Y3Z2S;
+				DEVELOPMENT_TEAM = Z675BR2K4U;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"$(PROJECT_DIR)/Temperature/Tools/Location/BaiduMapSDK",
@@ -1883,6 +1884,7 @@
 				INFOPLIST_FILE = Temperature/Info.plist;
 				INFOPLIST_KEY_CFBundleDisplayName = "永续绿建五恒";
 				INFOPLIST_KEY_NSBluetoothAlwaysUsageDescription = "开启后,才能连接设备";
+				INFOPLIST_KEY_NSBluetoothPeripheralUsageDescription = "需要打开蓝牙,才能添加主控面板设备";
 				INFOPLIST_KEY_NSCameraUsageDescription = "App需要您的同意,才能使用相机设置用户头像";
 				INFOPLIST_KEY_NSLocationAlwaysUsageDescription = "开启后,才能获取定位信息,用于绑定设备和加载天气信息";
 				INFOPLIST_KEY_NSLocationWhenInUseUsageDescription = "开启后,才能获取定位信息,用于加载天气信息";

BIN=BIN
Temperature/Assets.xcassets/Home/.DS_Store


BIN=BIN
Temperature/Assets.xcassets/devCtl/.DS_Store


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_fan.imageset/icon_fan@2x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_fan.imageset/icon_fan@3x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_newair.imageset/icon_newair@2x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_newair.imageset/icon_newair@3x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_newair_sel.imageset/icon_newair_sel@2x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_newair_sel.imageset/icon_newair_sel@3x.png


+ 2 - 2
Temperature/Assets.xcassets/devCtl/icon_on_1.imageset/Contents.json

@@ -5,12 +5,12 @@
       "scale" : "1x"
     },
     {
-      "filename" : "icon_on_sel 1@2x.png",
+      "filename" : "icon_on_1@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
-      "filename" : "icon_on_sel 1@3x.png",
+      "filename" : "icon_on_1@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_on_1.imageset/icon_on_1@2x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_on_1.imageset/icon_on_1@3x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_on_1.imageset/icon_on_sel 1@2x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_on_1.imageset/icon_on_sel 1@3x.png


+ 2 - 2
Temperature/Assets.xcassets/devCtl/icon_on_sel_1.imageset/Contents.json

@@ -5,12 +5,12 @@
       "scale" : "1x"
     },
     {
-      "filename" : "icon_on_sel@2x.png",
+      "filename" : "icon_on_sel_1@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
-      "filename" : "icon_on_sel@3x.png",
+      "filename" : "icon_on_sel_1@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_on_sel_1.imageset/icon_on_sel@2x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_on_sel_1.imageset/icon_on_sel@3x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_on_sel_1.imageset/icon_on_sel_1@2x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_on_sel_1.imageset/icon_on_sel_1@3x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_point.imageset/icon_point@2x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_point.imageset/icon_point@3x.png


+ 22 - 0
Temperature/Assets.xcassets/devCtl/icon_sleep.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "icon_sleep@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "icon_sleep@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_sleep.imageset/icon_sleep@2x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_sleep.imageset/icon_sleep@3x.png


+ 22 - 0
Temperature/Assets.xcassets/devCtl/icon_sleep_sel.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "icon_sleep_sel@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "icon_sleep_sel@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_sleep_sel.imageset/icon_sleep_sel@2x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_sleep_sel.imageset/icon_sleep_sel@3x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_time.imageset/icon_time@2x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_time.imageset/icon_time@3x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_time_sel.imageset/icon_time_sel@2x.png


BIN=BIN
Temperature/Assets.xcassets/devCtl/icon_time_sel.imageset/icon_time_sel@3x.png


+ 3 - 0
Temperature/ControlModule/Home/Controller/RDSAddRoomVC.h

@@ -6,11 +6,14 @@
 //
 
 #import "RDSBaseViewController.h"
+#import "RDSDeviceTypeModel.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
 @interface RDSAddRoomVC : RDSBaseViewController
 
+@property (nonatomic, strong) RDSDeviceTypeModel *deviceTypeModel;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 3 - 1
Temperature/ControlModule/Home/Controller/RDSAddRoomVC.m

@@ -63,10 +63,12 @@
     
     [self.view endEditing:YES];
     
-    if(TheDataManager.rooms.count == 0){
+//    if(TheDataManager.rooms.count == 0){
+    if (self.deviceTypeModel.isMasterController) {
         RDSInputWiFiVC *vc = [[RDSInputWiFiVC alloc] init];
         vc.roomName = _roomNameTF.text;
         vc.deviceID = _deviceIDTF.text;
+        vc.deviceTypeModel = self.deviceTypeModel;
         [self pushViewController:vc animated:YES];
     }else{
         RDSBindSubDeviceVC *vc = [[RDSBindSubDeviceVC alloc] init];

+ 37 - 15
Temperature/ControlModule/Home/Controller/RDSAirControlVC.m

@@ -40,6 +40,8 @@
 @property (weak, nonatomic) IBOutlet UIButton *newairBtn;
 @property (weak, nonatomic) IBOutlet UIButton *powerBtn;
 @property (weak, nonatomic) IBOutlet UIButton *timingBtn;
+@property (weak, nonatomic) IBOutlet UIButton *sleepBtn;
+
 @property (nonatomic, strong) GCDTimer *gcdTimer;
 @property (nonatomic, strong) SPAlertController *timerAlert;
 @property (nonatomic, strong) NSMutableArray *timerData;// 定时picker数据源
@@ -86,22 +88,22 @@
     
     [self p_setupModeView];
     
-    UIImage *greenImg = [UIImage rds_imageWithColor:RDSGreenColor];
-    UIImage *lightGreenImg = [UIImage rds_imageWithColor:RDSLightGreenColor];
-    
-    [_newairBtn setBackgroundImage:lightGreenImg forState:UIControlStateNormal];
-    [_powerBtn setBackgroundImage:lightGreenImg forState:UIControlStateNormal];
-    [_timingBtn setBackgroundImage:lightGreenImg forState:UIControlStateNormal];
-    
-    
-    [_newairBtn setBackgroundImage:greenImg forState:UIControlStateSelected];
-    [_powerBtn setBackgroundImage:greenImg forState:UIControlStateSelected];
-    [_timingBtn setBackgroundImage:greenImg forState:UIControlStateSelected];
+//    UIImage *greenImg = [UIImage rds_imageWithColor:RDSGreenColor];
+//    UIImage *lightGreenImg = [UIImage rds_imageWithColor:RDSLightGreenColor];
+//
+//    [_newairBtn setBackgroundImage:lightGreenImg forState:UIControlStateNormal];
+//    [_powerBtn setBackgroundImage:lightGreenImg forState:UIControlStateNormal];
+//    [_timingBtn setBackgroundImage:lightGreenImg forState:UIControlStateNormal];
+//
+//
+//    [_newairBtn setBackgroundImage:greenImg forState:UIControlStateSelected];
+//    [_powerBtn setBackgroundImage:greenImg forState:UIControlStateSelected];
+//    [_timingBtn setBackgroundImage:greenImg forState:UIControlStateSelected];
     
 
     
-    CGFloat width = SCREEN_WIDTH-120;
-    _cirSlider =[[CYCircularSlider alloc]initWithFrame:CGRectMake(10, 0, width, width)];
+    CGFloat width = 220;
+    _cirSlider =[[CYCircularSlider alloc]initWithFrame:CGRectMake((246 - width) / 2, (246 - width) / 2, width, width)];
     _cirSlider.delegate = self;
     _cirSlider.backgroundColor = UIColor.clearColor;
     _cirSlider.filledColor = RDSGreenColor;
@@ -113,7 +115,6 @@
     [self.tempView addSubview:_cirSlider];
     
     
-
     _fanSlider.minimumTrackTintColor = RDSGreenColor;
     [_fanSlider setThumbImage:[UIImage imageNamed:@"icon_point"] forState:UIControlStateNormal];
     [_fanSlider setThumbImage:[UIImage imageNamed:@"icon_point"] forState:UIControlStateHighlighted];
@@ -153,7 +154,7 @@
 
 - (void)p_setupModeView{
     
-    CGFloat viewW = (SCREEN_WIDTH-20*5)/4;// 一行显示4个,算上左右2边空白,共5个间隔
+    CGFloat viewW = (SCREEN_WIDTH-20*6)/5;// 一行显示4个,算上左右2边空白,共5个间隔
     RDSCtrlModeView *modeView = [[RDSCtrlModeView alloc] init];
     self.modeView = modeView;
     [self.view addSubview:modeView];
@@ -343,6 +344,26 @@
     }];
 }
 
+- (IBAction)onSleepAction:(UIButton *)sender {
+    if(!_roomModel.power) {
+        [RDSHudShower showCenterToast:@"请先开机再进行其他操作"];
+        return;
+    }
+    
+    [_gcdTimer restartTimer];// 重新开始轮询
+    
+    sender.selected = !sender.isSelected;
+    
+    [RDSDemoApiHelper rds_setSleepPower:sender.isSelected control_number:_roomModel.control_number success:^(id responseObject) {
+        if ([responseObject[@"code"] intValue] != 0) {
+            [RDSHudShower showCenterToast:responseObject[@"message"]];
+        }
+    } failure:^(NSError *error) {
+        [RDSHudShower showCenterToast:@"连接服务器失败"];
+    }];
+    
+}
+
 // 定时
 - (IBAction)onTimingAction:(UIButton *)sender {
     
@@ -534,6 +555,7 @@
         weakSelf.powerBtn.selected = weakSelf.roomModel.power;
         weakSelf.newairBtn.selected = weakSelf.roomModel.new_fan;
         weakSelf.timingBtn.selected = weakSelf.roomModel.timer_status;
+        weakSelf.sleepBtn.selected = weakSelf.roomModel.sleep_mode;
         
         
         NSString *mode;

+ 153 - 123
Temperature/ControlModule/Home/Controller/RDSAirControlVC.xib

@@ -3,7 +3,7 @@
     <device id="retina5_5" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -20,6 +20,7 @@
                 <outlet property="roomHumidityLab" destination="VS1-fQ-gMA" id="EMo-Aj-2s4"/>
                 <outlet property="roomPm25Lab" destination="ppq-FP-eCW" id="NDe-92-GuK"/>
                 <outlet property="roomTempLab" destination="waa-oO-0Y0" id="w4W-wa-4XE"/>
+                <outlet property="sleepBtn" destination="bXy-UU-gfP" id="COk-Nk-POg"/>
                 <outlet property="tempView" destination="Zyq-Wi-E9C" id="n5x-mu-A1k"/>
                 <outlet property="timingBtn" destination="eIS-2H-B8e" id="Iah-kt-Dui"/>
                 <outlet property="timingLab" destination="9CL-54-bjP" id="EyT-Ck-X1G"/>
@@ -32,38 +33,48 @@
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5d0-gu-6DK">
-                    <rect key="frame" x="0.0" y="53" width="414" height="499"/>
+                    <rect key="frame" x="0.0" y="0.0" width="405.33333333333331" height="491"/>
                     <subviews>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Kbl-WG-ZWC">
-                            <rect key="frame" x="53" y="50" width="308" height="261.66666666666669"/>
+                            <rect key="frame" x="52" y="96" width="301.33333333333331" height="256.33333333333331"/>
                             <subviews>
                                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Zyq-Wi-E9C">
-                                    <rect key="frame" x="0.0" y="0.0" width="308" height="261.66666666666669"/>
-                                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                    <rect key="frame" x="27.666666666666686" y="0.0" width="246" height="246"/>
+                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="246" id="DcU-y6-orW"/>
+                                        <constraint firstAttribute="width" constant="246" id="ZYE-41-BFr"/>
+                                    </constraints>
+                                    <userDefinedRuntimeAttributes>
+                                        <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
+                                            <integer key="value" value="123"/>
+                                        </userDefinedRuntimeAttribute>
+                                        <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
+                                    </userDefinedRuntimeAttributes>
                                 </view>
                                 <view userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uRf-pJ-KLN">
-                                    <rect key="frame" x="43.333333333333329" y="0.0" width="221.66666666666669" height="221.66666666666666"/>
+                                    <rect key="frame" x="42.666666666666686" y="0.0" width="216" height="216.33333333333334"/>
                                     <subviews>
                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="28" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q5M-Lo-zcy">
-                                            <rect key="frame" x="66.666666666666671" y="68.666666666666657" width="88.000000000000014" height="84"/>
-                                            <fontDescription key="fontDescription" type="boldSystem" pointSize="70"/>
+                                            <rect key="frame" x="78.333333333333329" y="80" width="59.666666666666671" height="56.333333333333343"/>
+                                            <fontDescription key="fontDescription" type="boldSystem" pointSize="47"/>
                                             <color key="textColor" red="0.15294117647058825" green="0.1803921568627451" blue="0.23137254901960785" alpha="1" colorSpace="calibratedRGB"/>
                                             <nil key="highlightedColor"/>
                                         </label>
                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="℃" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9yS-2d-GcF">
-                                            <rect key="frame" x="154.66666666666669" y="86" width="29.666666666666657" height="30"/>
+                                            <rect key="frame" x="138" y="86" width="29.666666666666657" height="30"/>
                                             <fontDescription key="fontDescription" type="boldSystem" pointSize="25"/>
                                             <color key="textColor" red="0.1529411765" green="0.18039215689999999" blue="0.23137254900000001" alpha="1" colorSpace="calibratedRGB"/>
                                             <nil key="highlightedColor"/>
                                         </label>
                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="制冷 一档" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="V8e-c8-QWi">
-                                            <rect key="frame" x="82.666666666666671" y="155.66666666666669" width="56.333333333333329" height="15.666666666666657"/>
+                                            <rect key="frame" x="79.999999999999986" y="139.33333333333331" width="56.333333333333329" height="15.666666666666657"/>
                                             <fontDescription key="fontDescription" type="boldSystem" pointSize="13"/>
                                             <color key="textColor" red="0.1529411765" green="0.18039215689999999" blue="0.23137254900000001" alpha="1" colorSpace="calibratedRGB"/>
                                             <nil key="highlightedColor"/>
                                         </label>
                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="定时:开" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9CL-54-bjP">
-                                            <rect key="frame" x="84.000000000000014" y="176.33333333333331" width="53.333333333333329" height="15.666666666666657"/>
+                                            <rect key="frame" x="81.333333333333329" y="160" width="53.333333333333329" height="15.666666666666657"/>
                                             <fontDescription key="fontDescription" type="boldSystem" pointSize="13"/>
                                             <color key="textColor" red="0.1529411765" green="0.18039215689999999" blue="0.23137254900000001" alpha="1" colorSpace="calibratedRGB"/>
                                             <nil key="highlightedColor"/>
@@ -75,7 +86,7 @@
                                         <constraint firstItem="V8e-c8-QWi" firstAttribute="top" secondItem="Q5M-Lo-zcy" secondAttribute="bottom" constant="3" id="Fqb-tn-lSg"/>
                                         <constraint firstItem="9CL-54-bjP" firstAttribute="centerX" secondItem="uRf-pJ-KLN" secondAttribute="centerX" id="NFd-Fc-H13"/>
                                         <constraint firstItem="Q5M-Lo-zcy" firstAttribute="centerX" secondItem="uRf-pJ-KLN" secondAttribute="centerX" id="am9-Gj-0de"/>
-                                        <constraint firstItem="Q5M-Lo-zcy" firstAttribute="top" secondItem="9yS-2d-GcF" secondAttribute="top" multiplier="0.8" id="bLL-mu-pSn"/>
+                                        <constraint firstItem="Q5M-Lo-zcy" firstAttribute="top" secondItem="9yS-2d-GcF" secondAttribute="top" constant="-6" id="bLL-mu-pSn"/>
                                         <constraint firstAttribute="width" secondItem="uRf-pJ-KLN" secondAttribute="height" id="bjF-Jr-Vkb"/>
                                         <constraint firstItem="V8e-c8-QWi" firstAttribute="centerX" secondItem="uRf-pJ-KLN" secondAttribute="centerX" id="cqt-mG-IJN"/>
                                         <constraint firstItem="Q5M-Lo-zcy" firstAttribute="centerY" secondItem="uRf-pJ-KLN" secondAttribute="centerY" id="iPg-Gd-xOG"/>
@@ -83,35 +94,27 @@
                                     </constraints>
                                 </view>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9uN-a5-kmu">
-                                    <rect key="frame" x="0.0" y="221.66666666666669" width="40" height="40"/>
-                                    <color key="backgroundColor" red="0.94117647058823528" green="0.96078431372549022" blue="0.96470588235294119" alpha="1" colorSpace="calibratedRGB"/>
+                                    <rect key="frame" x="7.6666666666666643" y="216.33333333333331" width="40" height="40"/>
+                                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="40" id="JZk-up-fMK"/>
                                         <constraint firstAttribute="width" constant="40" id="oYJ-PA-NQr"/>
                                     </constraints>
                                     <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                     <state key="normal" image="icon_reduce"/>
-                                    <userDefinedRuntimeAttributes>
-                                        <userDefinedRuntimeAttribute type="string" keyPath="layer.cornerRadius" value="20"/>
-                                        <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
-                                    </userDefinedRuntimeAttributes>
                                     <connections>
                                         <action selector="onMovTempAction:" destination="-1" eventType="touchUpInside" id="Zfj-2P-PRD"/>
                                     </connections>
                                 </button>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Exg-z6-gwm">
-                                    <rect key="frame" x="268" y="221.66666666666669" width="40" height="40"/>
-                                    <color key="backgroundColor" red="0.94117647059999998" green="0.96078431369999995" blue="0.96470588239999999" alpha="1" colorSpace="calibratedRGB"/>
+                                    <rect key="frame" x="238.66666666666669" y="216.33333333333331" width="40" height="40"/>
+                                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="40" id="m2H-WE-Mc7"/>
                                         <constraint firstAttribute="width" constant="40" id="zuf-8s-sBV"/>
                                     </constraints>
                                     <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                     <state key="normal" image="icon_add_1"/>
-                                    <userDefinedRuntimeAttributes>
-                                        <userDefinedRuntimeAttribute type="string" keyPath="layer.cornerRadius" value="20"/>
-                                        <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
-                                    </userDefinedRuntimeAttributes>
                                     <connections>
                                         <action selector="onAddTempAction:" destination="-1" eventType="touchUpInside" id="7T1-V6-9jU"/>
                                     </connections>
@@ -120,60 +123,65 @@
                             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             <constraints>
                                 <constraint firstItem="uRf-pJ-KLN" firstAttribute="centerX" secondItem="Kbl-WG-ZWC" secondAttribute="centerX" id="0jj-SU-n21"/>
-                                <constraint firstItem="9uN-a5-kmu" firstAttribute="leading" secondItem="Kbl-WG-ZWC" secondAttribute="leading" id="1aA-nV-gnC"/>
                                 <constraint firstItem="uRf-pJ-KLN" firstAttribute="top" secondItem="Kbl-WG-ZWC" secondAttribute="top" id="5x9-zr-gli"/>
                                 <constraint firstAttribute="bottom" secondItem="Exg-z6-gwm" secondAttribute="bottom" id="Bgl-gA-6SV"/>
                                 <constraint firstAttribute="width" secondItem="Kbl-WG-ZWC" secondAttribute="height" multiplier="10:8.5" id="F8E-TE-bs0"/>
-                                <constraint firstAttribute="trailing" secondItem="Exg-z6-gwm" secondAttribute="trailing" id="Hx5-AB-DJy"/>
                                 <constraint firstItem="Zyq-Wi-E9C" firstAttribute="top" secondItem="Kbl-WG-ZWC" secondAttribute="top" id="KRs-vo-blP"/>
                                 <constraint firstAttribute="bottom" secondItem="9uN-a5-kmu" secondAttribute="bottom" id="MGU-rb-05L"/>
-                                <constraint firstAttribute="trailing" secondItem="Zyq-Wi-E9C" secondAttribute="trailing" id="mwS-W1-Af2"/>
-                                <constraint firstItem="Zyq-Wi-E9C" firstAttribute="leading" secondItem="Kbl-WG-ZWC" secondAttribute="leading" id="nAn-lx-TMQ"/>
-                                <constraint firstAttribute="bottom" secondItem="Zyq-Wi-E9C" secondAttribute="bottom" id="npX-q1-Rvf"/>
+                                <constraint firstItem="Exg-z6-gwm" firstAttribute="leading" secondItem="uRf-pJ-KLN" secondAttribute="trailing" constant="-20" id="Q6d-Hv-WMO"/>
+                                <constraint firstItem="Zyq-Wi-E9C" firstAttribute="leading" secondItem="9uN-a5-kmu" secondAttribute="trailing" constant="-20" id="W6q-c7-kPw"/>
+                                <constraint firstItem="Zyq-Wi-E9C" firstAttribute="centerX" secondItem="Kbl-WG-ZWC" secondAttribute="centerX" id="pM3-GX-BLI"/>
                                 <constraint firstItem="9uN-a5-kmu" firstAttribute="top" secondItem="uRf-pJ-KLN" secondAttribute="bottom" id="tDm-DK-4cL"/>
                             </constraints>
                         </view>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uPo-GP-WtY">
-                            <rect key="frame" x="53" y="311.66666666666669" width="308" height="80"/>
+                            <rect key="frame" x="22" y="306" width="361.33333333333331" height="80"/>
                             <subviews>
                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="13℃" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="waa-oO-0Y0">
-                                    <rect key="frame" x="5.6666666666666643" y="50" width="35" height="25.333333333333329"/>
-                                    <fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
+                                    <rect key="frame" x="23.666666666666668" y="42" width="34.666666666666657" height="25.333333333333329"/>
+                                    <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="18"/>
                                     <color key="textColor" red="0.1529411765" green="0.18039215689999999" blue="0.23137254900000001" alpha="1" colorSpace="calibratedRGB"/>
                                     <nil key="highlightedColor"/>
                                 </label>
                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="52%" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VS1-fQ-gMA">
-                                    <rect key="frame" x="87.666666666666657" y="49.666666666666629" width="40" height="25.666666666666671"/>
-                                    <fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
+                                    <rect key="frame" x="114.99999999999999" y="42" width="39.333333333333329" height="25.333333333333329"/>
+                                    <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="18"/>
                                     <color key="textColor" red="0.1529411765" green="0.18039215689999999" blue="0.23137254900000001" alpha="1" colorSpace="calibratedRGB"/>
                                     <nil key="highlightedColor"/>
                                 </label>
                                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_temperature_g" translatesAutoresizingMaskIntoConstraints="NO" id="1DD-Tr-TNt">
-                                    <rect key="frame" x="9.3333333333333357" y="20" width="28" height="28"/>
+                                    <rect key="frame" x="27" y="12" width="28" height="28"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="28" id="Kw1-iD-FQk"/>
+                                        <constraint firstAttribute="height" constant="28" id="LUY-AY-Oly"/>
+                                    </constraints>
                                 </imageView>
                                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_humidity_g" translatesAutoresizingMaskIntoConstraints="NO" id="Byx-CF-qt6">
-                                    <rect key="frame" x="93.666666666666657" y="20" width="28" height="28"/>
+                                    <rect key="frame" x="120.66666666666666" y="12" width="28" height="28"/>
                                 </imageView>
                                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_pm2.5_g" translatesAutoresizingMaskIntoConstraints="NO" id="QY3-Lp-b97">
-                                    <rect key="frame" x="186.33333333333334" y="20" width="28" height="28"/>
+                                    <rect key="frame" x="212.66666666666666" y="12" width="28" height="28"/>
                                 </imageView>
                                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_co2_g" translatesAutoresizingMaskIntoConstraints="NO" id="FUb-zI-XCf">
-                                    <rect key="frame" x="271" y="20" width="28" height="28"/>
+                                    <rect key="frame" x="311.33333333333331" y="12" width="28" height="28"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="28" id="wKf-yq-LUl"/>
+                                    </constraints>
                                 </imageView>
                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="400" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ppq-FP-eCW">
-                                    <rect key="frame" x="184" y="50" width="32.666666666666657" height="25.333333333333329"/>
-                                    <fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
+                                    <rect key="frame" x="210.33333333333334" y="42" width="32.666666666666657" height="25.333333333333329"/>
+                                    <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="18"/>
                                     <color key="textColor" red="0.1529411765" green="0.18039215689999999" blue="0.23137254900000001" alpha="1" colorSpace="calibratedRGB"/>
                                     <nil key="highlightedColor"/>
                                 </label>
                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="480" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zAt-Qd-zbU">
-                                    <rect key="frame" x="268.66666666666669" y="50" width="32.666666666666686" height="25.333333333333329"/>
-                                    <fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="18"/>
+                                    <rect key="frame" x="309" y="42" width="32.666666666666686" height="25.333333333333329"/>
+                                    <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="18"/>
                                     <color key="textColor" red="0.1529411765" green="0.18039215689999999" blue="0.23137254900000001" alpha="1" colorSpace="calibratedRGB"/>
                                     <nil key="highlightedColor"/>
                                 </label>
                             </subviews>
-                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             <constraints>
                                 <constraint firstItem="ppq-FP-eCW" firstAttribute="centerX" secondItem="QY3-Lp-b97" secondAttribute="centerX" id="1iS-Mj-0JU"/>
                                 <constraint firstItem="waa-oO-0Y0" firstAttribute="top" secondItem="1DD-Tr-TNt" secondAttribute="bottom" constant="2" id="3Xj-da-rzY"/>
@@ -181,46 +189,52 @@
                                 <constraint firstItem="Byx-CF-qt6" firstAttribute="centerY" secondItem="1DD-Tr-TNt" secondAttribute="centerY" id="8Tg-qc-lDo"/>
                                 <constraint firstItem="VS1-fQ-gMA" firstAttribute="centerX" secondItem="Byx-CF-qt6" secondAttribute="centerX" id="BvE-CA-nFR"/>
                                 <constraint firstItem="zAt-Qd-zbU" firstAttribute="centerX" secondItem="FUb-zI-XCf" secondAttribute="centerX" id="D6L-6f-TPk"/>
-                                <constraint firstItem="FUb-zI-XCf" firstAttribute="centerX" secondItem="uPo-GP-WtY" secondAttribute="centerX" multiplier="1.85" id="Fd3-Je-9Zn"/>
                                 <constraint firstItem="ppq-FP-eCW" firstAttribute="centerY" secondItem="waa-oO-0Y0" secondAttribute="centerY" id="Kjw-TO-T0B"/>
                                 <constraint firstAttribute="height" constant="80" id="Qe9-mv-UjB"/>
                                 <constraint firstItem="QY3-Lp-b97" firstAttribute="centerY" secondItem="1DD-Tr-TNt" secondAttribute="centerY" id="RDF-hZ-mIQ"/>
+                                <constraint firstItem="1DD-Tr-TNt" firstAttribute="leading" secondItem="uPo-GP-WtY" secondAttribute="leading" constant="27" id="Xts-KQ-rOi"/>
                                 <constraint firstItem="VS1-fQ-gMA" firstAttribute="centerY" secondItem="waa-oO-0Y0" secondAttribute="centerY" id="Yta-d0-ksb"/>
-                                <constraint firstItem="Byx-CF-qt6" firstAttribute="centerX" secondItem="uPo-GP-WtY" secondAttribute="centerX" multiplier="0.7" id="boy-Zo-VJL"/>
-                                <constraint firstItem="1DD-Tr-TNt" firstAttribute="top" secondItem="uPo-GP-WtY" secondAttribute="top" constant="20" id="eLt-7E-zH4"/>
-                                <constraint firstItem="QY3-Lp-b97" firstAttribute="centerX" secondItem="uPo-GP-WtY" secondAttribute="centerX" multiplier="1.3" id="ec8-3y-TUJ"/>
+                                <constraint firstItem="Byx-CF-qt6" firstAttribute="centerX" secondItem="uPo-GP-WtY" secondAttribute="centerX" constant="-46" id="boy-Zo-VJL"/>
+                                <constraint firstItem="1DD-Tr-TNt" firstAttribute="top" secondItem="uPo-GP-WtY" secondAttribute="top" constant="12" id="eLt-7E-zH4"/>
+                                <constraint firstItem="QY3-Lp-b97" firstAttribute="centerX" secondItem="uPo-GP-WtY" secondAttribute="centerX" constant="46" id="ec8-3y-TUJ"/>
+                                <constraint firstAttribute="trailing" secondItem="FUb-zI-XCf" secondAttribute="trailing" constant="22" id="f98-LY-NXh"/>
                                 <constraint firstItem="FUb-zI-XCf" firstAttribute="centerY" secondItem="1DD-Tr-TNt" secondAttribute="centerY" id="fyU-Tp-isv"/>
                                 <constraint firstItem="zAt-Qd-zbU" firstAttribute="centerY" secondItem="waa-oO-0Y0" secondAttribute="centerY" id="jPk-kY-cvW"/>
-                                <constraint firstItem="1DD-Tr-TNt" firstAttribute="centerX" secondItem="uPo-GP-WtY" secondAttribute="centerX" multiplier="0.15" id="q9h-18-8Zh"/>
                             </constraints>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
+                                    <integer key="value" value="16"/>
+                                </userDefinedRuntimeAttribute>
+                                <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
+                            </userDefinedRuntimeAttributes>
                         </view>
                         <view multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8ya-bf-jnR">
-                            <rect key="frame" x="26.666666666666657" y="414" width="360.66666666666674" height="85"/>
+                            <rect key="frame" x="22" y="406" width="361.33333333333331" height="85"/>
                             <subviews>
                                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_fan" translatesAutoresizingMaskIntoConstraints="NO" id="xJ6-9s-4Dp">
-                                    <rect key="frame" x="9.9999999999999964" y="27.333333333333371" width="30.000000000000004" height="30"/>
+                                    <rect key="frame" x="18" y="31.666666666666686" width="22" height="22"/>
                                     <constraints>
-                                        <constraint firstAttribute="width" constant="30" id="egO-gM-gaS"/>
-                                        <constraint firstAttribute="height" constant="30" id="kFy-1K-rQv"/>
+                                        <constraint firstAttribute="width" constant="22" id="egO-gM-gaS"/>
+                                        <constraint firstAttribute="height" constant="22" id="kFy-1K-rQv"/>
                                     </constraints>
                                 </imageView>
-                                <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.0" maxValue="5" translatesAutoresizingMaskIntoConstraints="NO" id="bsh-mP-EHO" customClass="RDSlider">
-                                    <rect key="frame" x="45" y="27.333333333333371" width="290.66666666666669" height="31"/>
+                                <slider opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.0" maxValue="5" translatesAutoresizingMaskIntoConstraints="NO" id="bsh-mP-EHO" customClass="RDSlider">
+                                    <rect key="frame" x="47" y="27.666666666666686" width="298.33333333333331" height="31"/>
                                     <connections>
                                         <action selector="onFanSliderValueChanged:" destination="-1" eventType="valueChanged" id="b5Z-LI-KwP"/>
                                         <action selector="onFanSliderValueDidChanged:" destination="-1" eventType="touchUpInside" id="mve-tQ-Mbn"/>
                                     </connections>
                                 </slider>
                             </subviews>
-                            <color key="backgroundColor" red="0.9137254901960784" green="0.94901960784313721" blue="0.94901960784313721" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
+                            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             <gestureRecognizers/>
                             <constraints>
-                                <constraint firstAttribute="trailing" secondItem="bsh-mP-EHO" secondAttribute="trailing" constant="27" id="CdX-Mz-ylb"/>
-                                <constraint firstItem="xJ6-9s-4Dp" firstAttribute="centerY" secondItem="8ya-bf-jnR" secondAttribute="centerY" id="QNN-vA-svS"/>
-                                <constraint firstItem="bsh-mP-EHO" firstAttribute="leading" secondItem="xJ6-9s-4Dp" secondAttribute="trailing" constant="7" id="QkK-cq-E4x"/>
-                                <constraint firstItem="bsh-mP-EHO" firstAttribute="centerY" secondItem="8ya-bf-jnR" secondAttribute="centerY" id="bda-a2-JwK"/>
-                                <constraint firstItem="xJ6-9s-4Dp" firstAttribute="leading" secondItem="8ya-bf-jnR" secondAttribute="leading" constant="10" id="cwh-f9-1sW"/>
+                                <constraint firstItem="bsh-mP-EHO" firstAttribute="leading" secondItem="xJ6-9s-4Dp" secondAttribute="trailing" constant="9" id="MRJ-mS-ERp"/>
+                                <constraint firstItem="xJ6-9s-4Dp" firstAttribute="centerY" secondItem="8ya-bf-jnR" secondAttribute="centerY" id="QRo-N3-bft"/>
+                                <constraint firstItem="xJ6-9s-4Dp" firstAttribute="leading" secondItem="8ya-bf-jnR" secondAttribute="leading" constant="18" id="Qno-pJ-qLk"/>
+                                <constraint firstAttribute="trailing" secondItem="bsh-mP-EHO" secondAttribute="trailing" constant="18" id="RHT-fW-csw"/>
                                 <constraint firstAttribute="width" secondItem="8ya-bf-jnR" secondAttribute="height" multiplier="34:8" id="rcN-wW-Qcw"/>
+                                <constraint firstItem="bsh-mP-EHO" firstAttribute="centerY" secondItem="8ya-bf-jnR" secondAttribute="centerY" id="xs3-4R-DGx"/>
                             </constraints>
                             <userDefinedRuntimeAttributes>
                                 <userDefinedRuntimeAttribute type="string" keyPath="layer.cornerRadius" value="16"/>
@@ -232,76 +246,90 @@
                     <constraints>
                         <constraint firstItem="Kbl-WG-ZWC" firstAttribute="centerX" secondItem="5d0-gu-6DK" secondAttribute="centerX" id="3uY-da-JT2"/>
                         <constraint firstItem="uPo-GP-WtY" firstAttribute="centerX" secondItem="5d0-gu-6DK" secondAttribute="centerX" id="7KS-fJ-0OX"/>
+                        <constraint firstItem="uPo-GP-WtY" firstAttribute="height" secondItem="8ya-bf-jnR" secondAttribute="height" multiplier="0.941176" id="8w0-xa-8Ec"/>
                         <constraint firstItem="8ya-bf-jnR" firstAttribute="centerX" secondItem="5d0-gu-6DK" secondAttribute="centerX" id="9WE-tn-gAl"/>
-                        <constraint firstItem="Kbl-WG-ZWC" firstAttribute="top" secondItem="5d0-gu-6DK" secondAttribute="top" constant="50" id="JH1-aL-vio"/>
-                        <constraint firstItem="uPo-GP-WtY" firstAttribute="top" secondItem="Kbl-WG-ZWC" secondAttribute="bottom" id="PHs-pv-H2j"/>
-                        <constraint firstItem="uPo-GP-WtY" firstAttribute="leading" secondItem="9uN-a5-kmu" secondAttribute="leading" id="SGa-fI-BW6"/>
+                        <constraint firstItem="uPo-GP-WtY" firstAttribute="trailing" secondItem="8ya-bf-jnR" secondAttribute="trailing" id="FIV-L0-K0s"/>
+                        <constraint firstItem="Kbl-WG-ZWC" firstAttribute="top" secondItem="5d0-gu-6DK" secondAttribute="top" constant="96" id="JH1-aL-vio"/>
+                        <constraint firstItem="8ya-bf-jnR" firstAttribute="top" secondItem="uPo-GP-WtY" secondAttribute="bottom" constant="20" id="PZu-Eg-Rt7"/>
+                        <constraint firstItem="uPo-GP-WtY" firstAttribute="leading" secondItem="8ya-bf-jnR" secondAttribute="leading" id="Qzd-nq-aVv"/>
                         <constraint firstAttribute="bottom" secondItem="8ya-bf-jnR" secondAttribute="bottom" id="mQv-H9-5Mv"/>
                     </constraints>
                 </view>
-                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4FE-si-qMp">
-                    <rect key="frame" x="152.33333333333334" y="572" width="109.33333333333334" height="92.666666666666629"/>
+                <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="dih-XE-4lS">
+                    <rect key="frame" x="23" y="551" width="359.33333333333331" height="70"/>
+                    <subviews>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VkB-sk-GuN">
+                            <rect key="frame" x="0.0" y="0.0" width="82.333333333333329" height="70"/>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" image="icon_newair"/>
+                            <state key="selected" image="icon_newair_sel"/>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="string" keyPath="layer.cornerRadius" value="16"/>
+                                <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
+                            </userDefinedRuntimeAttributes>
+                            <connections>
+                                <action selector="onNewAirPowerAction:" destination="-1" eventType="touchUpInside" id="vM8-xa-tNr"/>
+                            </connections>
+                        </button>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4FE-si-qMp">
+                            <rect key="frame" x="92.333333333333343" y="0.0" width="82.333333333333343" height="70"/>
+                            <constraints>
+                                <constraint firstAttribute="width" secondItem="4FE-si-qMp" secondAttribute="height" multiplier="100:85" id="uoc-6y-T8v"/>
+                            </constraints>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" image="icon_on_1"/>
+                            <state key="selected" image="icon_on_sel_1"/>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="string" keyPath="layer.cornerRadius" value="16"/>
+                                <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
+                            </userDefinedRuntimeAttributes>
+                            <connections>
+                                <action selector="onPowerAction:" destination="-1" eventType="touchUpInside" id="2bR-Ex-FNS"/>
+                            </connections>
+                        </button>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bXy-UU-gfP">
+                            <rect key="frame" x="184.66666666666666" y="0.0" width="82.333333333333343" height="70"/>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" image="icon_sleep"/>
+                            <state key="selected" image="icon_sleep_sel"/>
+                            <connections>
+                                <action selector="onSleepAction:" destination="-1" eventType="touchUpInside" id="SKg-0M-qhu"/>
+                            </connections>
+                        </button>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eIS-2H-B8e">
+                            <rect key="frame" x="277" y="0.0" width="82.333333333333314" height="70"/>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" title="" image="icon_time"/>
+                            <state key="selected" image="icon_time_sel"/>
+                            <userDefinedRuntimeAttributes>
+                                <userDefinedRuntimeAttribute type="string" keyPath="layer.cornerRadius" value="16"/>
+                                <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
+                            </userDefinedRuntimeAttributes>
+                            <connections>
+                                <action selector="onTimingAction:" destination="-1" eventType="touchUpInside" id="hsV-ad-8w6"/>
+                            </connections>
+                        </button>
+                    </subviews>
                     <constraints>
-                        <constraint firstAttribute="width" secondItem="4FE-si-qMp" secondAttribute="height" multiplier="100:85" id="uoc-6y-T8v"/>
+                        <constraint firstItem="eIS-2H-B8e" firstAttribute="width" secondItem="4FE-si-qMp" secondAttribute="width" id="Jnv-AO-smg"/>
+                        <constraint firstItem="4FE-si-qMp" firstAttribute="width" secondItem="VkB-sk-GuN" secondAttribute="width" id="b4E-NE-QDM"/>
+                        <constraint firstItem="4FE-si-qMp" firstAttribute="height" secondItem="VkB-sk-GuN" secondAttribute="height" id="sgn-um-Igj"/>
+                        <constraint firstItem="eIS-2H-B8e" firstAttribute="height" secondItem="4FE-si-qMp" secondAttribute="height" id="wNk-e2-3Cr"/>
                     </constraints>
-                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
-                    <state key="normal" image="icon_on_1"/>
-                    <state key="selected" image="icon_on_sel_1"/>
-                    <userDefinedRuntimeAttributes>
-                        <userDefinedRuntimeAttribute type="string" keyPath="layer.cornerRadius" value="16"/>
-                        <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
-                    </userDefinedRuntimeAttributes>
-                    <connections>
-                        <action selector="onPowerAction:" destination="-1" eventType="touchUpInside" id="2bR-Ex-FNS"/>
-                    </connections>
-                </button>
-                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VkB-sk-GuN">
-                    <rect key="frame" x="27.999999999999993" y="572" width="109.33333333333331" height="92.666666666666629"/>
-                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
-                    <state key="normal" image="icon_newair"/>
-                    <state key="selected" image="icon_air_sel"/>
-                    <userDefinedRuntimeAttributes>
-                        <userDefinedRuntimeAttribute type="string" keyPath="layer.cornerRadius" value="16"/>
-                        <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
-                    </userDefinedRuntimeAttributes>
-                    <connections>
-                        <action selector="onNewAirPowerAction:" destination="-1" eventType="touchUpInside" id="vM8-xa-tNr"/>
-                    </connections>
-                </button>
-                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eIS-2H-B8e">
-                    <rect key="frame" x="276.66666666666669" y="572" width="109.33333333333331" height="92.666666666666629"/>
-                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
-                    <state key="normal" title="" image="icon_time"/>
-                    <state key="selected" image="icon_time_sel"/>
-                    <userDefinedRuntimeAttributes>
-                        <userDefinedRuntimeAttribute type="string" keyPath="layer.cornerRadius" value="16"/>
-                        <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
-                    </userDefinedRuntimeAttributes>
-                    <connections>
-                        <action selector="onTimingAction:" destination="-1" eventType="touchUpInside" id="hsV-ad-8w6"/>
-                    </connections>
-                </button>
+                </stackView>
             </subviews>
             <viewLayoutGuide key="safeArea" id="Q5M-cg-NOt"/>
             <color key="backgroundColor" systemColor="systemBackgroundColor"/>
             <constraints>
-                <constraint firstItem="VkB-sk-GuN" firstAttribute="centerY" secondItem="4FE-si-qMp" secondAttribute="centerY" id="8pb-Wv-I3u"/>
                 <constraint firstItem="5d0-gu-6DK" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" id="C2j-e6-WO3"/>
                 <constraint firstItem="5d0-gu-6DK" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="EWh-G9-35V"/>
                 <constraint firstItem="Kbl-WG-ZWC" firstAttribute="width" secondItem="i5M-Pr-FkT" secondAttribute="width" multiplier="290:390" id="GUZ-Ao-18M"/>
-                <constraint firstItem="5d0-gu-6DK" firstAttribute="height" secondItem="Q5M-cg-NOt" secondAttribute="width" multiplier="470:390" id="Gej-wr-PEd"/>
-                <constraint firstItem="4FE-si-qMp" firstAttribute="leading" secondItem="VkB-sk-GuN" secondAttribute="trailing" constant="15" id="GjI-uF-Xy9"/>
-                <constraint firstItem="eIS-2H-B8e" firstAttribute="height" secondItem="4FE-si-qMp" secondAttribute="height" id="JZn-VW-ujV"/>
-                <constraint firstItem="4FE-si-qMp" firstAttribute="width" secondItem="VkB-sk-GuN" secondAttribute="width" id="S8u-Sx-zha"/>
-                <constraint firstItem="4FE-si-qMp" firstAttribute="top" secondItem="5d0-gu-6DK" secondAttribute="bottom" constant="20" id="Wyu-nz-wOO"/>
+                <constraint firstItem="dih-XE-4lS" firstAttribute="leading" secondItem="Q5M-cg-NOt" secondAttribute="leading" constant="23" id="SxW-2a-T3Q"/>
                 <constraint firstItem="8ya-bf-jnR" firstAttribute="width" secondItem="Q5M-cg-NOt" secondAttribute="width" multiplier="340:390" id="XBc-qX-5yd"/>
-                <constraint firstItem="4FE-si-qMp" firstAttribute="height" secondItem="VkB-sk-GuN" secondAttribute="height" id="XtH-AJ-EDU"/>
-                <constraint firstItem="eIS-2H-B8e" firstAttribute="leading" secondItem="4FE-si-qMp" secondAttribute="trailing" constant="15" id="YL4-ha-3Ji"/>
-                <constraint firstItem="eIS-2H-B8e" firstAttribute="width" secondItem="4FE-si-qMp" secondAttribute="width" id="ej6-GD-bSV"/>
-                <constraint firstItem="5d0-gu-6DK" firstAttribute="centerY" secondItem="i5M-Pr-FkT" secondAttribute="centerY" multiplier="0.9" id="fHM-bx-MKb"/>
-                <constraint firstItem="4FE-si-qMp" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="k8J-MQ-ZBc"/>
-                <constraint firstItem="eIS-2H-B8e" firstAttribute="centerY" secondItem="4FE-si-qMp" secondAttribute="centerY" id="qDs-gk-fIw"/>
-                <constraint firstItem="4FE-si-qMp" firstAttribute="width" secondItem="Q5M-cg-NOt" secondAttribute="width" multiplier="103:390" id="sYh-V1-Ice"/>
+                <constraint firstItem="Q5M-cg-NOt" firstAttribute="bottom" secondItem="dih-XE-4lS" secondAttribute="bottom" constant="51" id="hxc-Od-O5B"/>
+                <constraint firstItem="dih-XE-4lS" firstAttribute="top" secondItem="5d0-gu-6DK" secondAttribute="bottom" constant="60" id="j74-Kh-aju"/>
+                <constraint firstItem="5d0-gu-6DK" firstAttribute="top" secondItem="Q5M-cg-NOt" secondAttribute="top" id="leH-Yn-2Sh"/>
+                <constraint firstItem="Q5M-cg-NOt" firstAttribute="trailing" secondItem="dih-XE-4lS" secondAttribute="trailing" constant="23" id="mUt-ir-gUR"/>
             </constraints>
             <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" translucent="NO" prompted="NO"/>
             <point key="canvasLocation" x="130.40000000000001" y="18.440779610194905"/>
@@ -309,18 +337,20 @@
     </objects>
     <resources>
         <image name="icon_add_1" width="40" height="40"/>
-        <image name="icon_air_sel" width="27.666666030883789" height="30"/>
         <image name="icon_co2_g" width="28" height="28"/>
-        <image name="icon_fan" width="30" height="30"/>
+        <image name="icon_fan" width="22" height="22"/>
         <image name="icon_humidity_g" width="28" height="28"/>
-        <image name="icon_newair" width="40" height="40"/>
-        <image name="icon_on_1" width="46" height="46"/>
-        <image name="icon_on_sel_1" width="46" height="46"/>
+        <image name="icon_newair" width="75" height="70"/>
+        <image name="icon_newair_sel" width="75" height="70"/>
+        <image name="icon_on_1" width="75" height="70"/>
+        <image name="icon_on_sel_1" width="75" height="70"/>
         <image name="icon_pm2.5_g" width="28" height="28"/>
         <image name="icon_reduce" width="40" height="40"/>
+        <image name="icon_sleep" width="75" height="70"/>
+        <image name="icon_sleep_sel" width="75" height="70"/>
         <image name="icon_temperature_g" width="28" height="28"/>
-        <image name="icon_time" width="40" height="40"/>
-        <image name="icon_time_sel" width="23.666666030883789" height="25"/>
+        <image name="icon_time" width="75" height="70"/>
+        <image name="icon_time_sel" width="75" height="70"/>
         <systemColor name="systemBackgroundColor">
             <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
         </systemColor>

+ 3 - 0
Temperature/ControlModule/Home/Controller/RDSBindDeviceVC.h

@@ -6,6 +6,7 @@
 //
 
 #import "RDSBaseViewController.h"
+#import "RDSDeviceTypeModel.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -15,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, strong) NSString *deviceID;
 @property (nonatomic, strong) NSString *wifiName;
 @property (nonatomic, strong) NSString *pwd;
+@property (nonatomic, strong) RDSDeviceTypeModel *deviceTypeModel;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 2 - 0
Temperature/ControlModule/Home/Controller/RDSBindSubDeviceVC.h

@@ -6,6 +6,7 @@
 //
 
 #import "RDSBaseViewController.h"
+#import "RDSDeviceTypeModel.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -13,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSString *roomName;
 @property (nonatomic, strong) NSString *deviceID;
+@property (nonatomic, strong) RDSDeviceTypeModel *deviceTypeModel;
 
 @end
 

+ 1 - 1
Temperature/ControlModule/Home/Controller/RDSBindSubDeviceVC.m

@@ -31,7 +31,7 @@
     
     
     RDS_WEAKSELF(weakSelf)
-    [RDSDemoApiHelper rds_addRoomName:_roomName control_number:_deviceID success:^(id responseObject) {
+    [RDSDemoApiHelper rds_addRoomName:_roomName control_number:_deviceID device_type_id:self.deviceTypeModel.record_id success:^(id responseObject) {
         
         if ([responseObject[@"code"] intValue] != 0) {
             [RDSHudShower showBottomToast:responseObject[@"message"]];

+ 1 - 1
Temperature/ControlModule/Home/Controller/RDSHomeVC.m

@@ -305,7 +305,7 @@ static NSString * const RDSRoomCellID = @"RDSRoomCellID";
     [collectionView deselectItemAtIndexPath:indexPath animated:YES];
     
     RDSRoomModel *roomModel = TheDataManager.rooms[indexPath.row];
-    if(roomModel.is_master){
+    if(roomModel.isMasterController){
         RDSAirControlVC *vc = [[RDSAirControlVC alloc] init];
         vc.hidesBottomBarWhenPushed = YES;
         vc.roomModel = roomModel;

+ 2 - 0
Temperature/ControlModule/Home/Controller/RDSInputWiFiVC.h

@@ -6,6 +6,7 @@
 //
 
 #import "RDSBaseViewController.h"
+#import "RDSDeviceTypeModel.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -13,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, strong) NSString *roomName;
 @property (nonatomic, strong) NSString *deviceID;
+@property (nonatomic, strong) RDSDeviceTypeModel *deviceTypeModel;
 
 @end
 

+ 1 - 0
Temperature/ControlModule/Home/Controller/RDSInputWiFiVC.m

@@ -91,6 +91,7 @@
     vc.deviceID = _deviceID;
     vc.wifiName = self.wifiAccountTF.text;
     vc.pwd = self.wifiPwdTF.text;
+    vc.deviceTypeModel = self.deviceTypeModel;
     [self pushViewController:vc animated:YES];
     
 }

+ 3 - 0
Temperature/ControlModule/Home/Controller/RDSResetDeviceVC.h

@@ -6,11 +6,14 @@
 //
 
 #import "RDSBaseViewController.h"
+#import "RDSDeviceTypeModel.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
 @interface RDSResetDeviceVC : RDSBaseViewController
 
+@property (nonatomic, strong) RDSDeviceTypeModel *deviceTypeModel;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 4 - 2
Temperature/ControlModule/Home/Controller/RDSResetDeviceVC.m

@@ -23,13 +23,14 @@
     
     self.title = @"添加房间";
     
-    if(TheDataManager.rooms.count == 0){
+//    if(TheDataManager.rooms.count == 0){
+    if (self.deviceTypeModel.isMasterController) {
         // 添加主控
         _lab1.text = @"1、主控制器开机状态下,长按『菜单键』3s进入设置界面";
         _lab2.text = @"2、再次长按『菜单键』,直到显示配网二维码";
         _imgView1.image = [UIImage imageNamed:@"img_reset_1"];
         _imgView2.image = [UIImage imageNamed:@"img_reset_2"];
-    }else{
+    } else {
         // 添加分控
         _lab1.text = @"1、分控制器开机状态下,长按『菜单键』3s直到界面出现配网二维码";
         _lab2.text = @"2、使用APP扫码绑定";
@@ -42,6 +43,7 @@
 - (IBAction)onNextBtnClick {
     
     RDSAddRoomVC *vc = [[RDSAddRoomVC alloc] init];
+    vc.deviceTypeModel = self.deviceTypeModel;
     [self pushViewController:vc animated:YES];
     
 }

+ 12 - 0
Temperature/ControlModule/Home/Controller/RDSSelectDeviceSubVC.m

@@ -7,6 +7,7 @@
 
 #import "RDSSelectDeviceSubVC.h"
 #import "RDSDeviceTypeCell.h"
+#import "RDSResetDeviceVC.h"
 
 @interface RDSSelectDeviceSubVC () <UITableViewDelegate, UITableViewDataSource>
 
@@ -60,6 +61,17 @@
     return cell;
 }
 
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    RDSDeviceTypeModel *deviceTypeModel = self.dataSource[indexPath.section];
+    if ([deviceTypeModel.code isEqualToString:@"YXK-P/DN-JF-8"]) {
+        [TheAlertCtrl rds_alertWithTitle:@"提示" message:@"该功能正在开发中,敬请期待!"];
+        return;
+    }
+    RDSResetDeviceVC *resetDeviceVC = [[RDSResetDeviceVC alloc] init];
+    resetDeviceVC.deviceTypeModel = deviceTypeModel;
+    [self.parentViewController.navigationController pushViewController:resetDeviceVC animated:YES];
+}
+
 - (NSArray *)dataSource {
     if (!_dataSource) {
         _dataSource = [NSArray array];

+ 11 - 11
Temperature/ControlModule/Home/Controller/RDSSubControlVC.m

@@ -66,16 +66,16 @@
 - (void)p_initUI{
     
     
-    UIImage *greenImg = [UIImage rds_imageWithColor:RDSGreenColor];
-    UIImage *lightGreenImg = [UIImage rds_imageWithColor:RDSLightGreenColor];
-    
-    [_powerBtn setBackgroundImage:lightGreenImg forState:UIControlStateNormal];
-    [_powerBtn setBackgroundImage:greenImg forState:UIControlStateSelected];
+//    UIImage *greenImg = [UIImage rds_imageWithColor:RDSGreenColor];
+//    UIImage *lightGreenImg = [UIImage rds_imageWithColor:RDSLightGreenColor];
+//    
+//    [_powerBtn setBackgroundImage:lightGreenImg forState:UIControlStateNormal];
+//    [_powerBtn setBackgroundImage:greenImg forState:UIControlStateSelected];
     
 
     
-    CGFloat width = SCREEN_WIDTH-120;
-    _cirSlider = [[CYCircularSlider alloc]initWithFrame:CGRectMake(10, 0, width, width)];
+    CGFloat width = 220;
+    _cirSlider =[[CYCircularSlider alloc]initWithFrame:CGRectMake((246 - width) / 2, (246 - width) / 2, width, width)];
     _cirSlider.delegate = self;
     _cirSlider.backgroundColor = UIColor.clearColor;
     _cirSlider.filledColor = RDSGreenColor;
@@ -85,10 +85,10 @@
     _cirSlider.maximumValue = 30;
     _cirSlider.value = 28;
     
-    _cirSlider.userInteractionEnabled = NO;
-    _cirSlider.handleColor = UIColor.clearColor;
-    _cirSlider.handleColor2 = UIColor.clearColor;
-    _cirSlider.handleColor3 = RDSGreenColor;
+//    _cirSlider.userInteractionEnabled = NO;
+//    _cirSlider.handleColor = UIColor.clearColor;
+//    _cirSlider.handleColor2 = UIColor.clearColor;
+//    _cirSlider.handleColor3 = RDSGreenColor;
     
     [self.tempView addSubview:_cirSlider];
     

+ 27 - 19
Temperature/ControlModule/Home/Controller/RDSSubControlVC.xib

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -32,26 +32,36 @@
                             <rect key="frame" x="48" y="30" width="279" height="251"/>
                             <subviews>
                                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kGa-cc-CSP">
-                                    <rect key="frame" x="0.0" y="0.0" width="279" height="251"/>
-                                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                    <rect key="frame" x="16.5" y="0.0" width="246" height="246"/>
+                                    <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="246" id="36f-Yf-hnQ"/>
+                                        <constraint firstAttribute="width" constant="246" id="3LX-zs-txc"/>
+                                    </constraints>
+                                    <userDefinedRuntimeAttributes>
+                                        <userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
+                                            <integer key="value" value="123"/>
+                                        </userDefinedRuntimeAttribute>
+                                        <userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
+                                    </userDefinedRuntimeAttributes>
                                 </view>
                                 <view userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dfv-82-UbI">
                                     <rect key="frame" x="34" y="0.0" width="211" height="211"/>
                                     <subviews>
                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="28" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TUq-Bs-9C5">
-                                            <rect key="frame" x="62.5" y="55" width="86" height="101"/>
-                                            <fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="72"/>
+                                            <rect key="frame" x="77.5" y="72.5" width="56.5" height="66"/>
+                                            <fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="47"/>
                                             <color key="textColor" red="0.1529411765" green="0.18039215689999999" blue="0.23137254900000001" alpha="1" colorSpace="calibratedRGB"/>
                                             <nil key="highlightedColor"/>
                                         </label>
                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="℃" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dtl-C8-0cC">
-                                            <rect key="frame" x="148.5" y="68.5" width="24" height="35"/>
+                                            <rect key="frame" x="134" y="78.5" width="24" height="35"/>
                                             <fontDescription key="fontDescription" name="PingFangSC-Semibold" family="PingFang SC" pointSize="25"/>
                                             <color key="textColor" red="0.1529411765" green="0.18039215689999999" blue="0.23137254900000001" alpha="1" colorSpace="calibratedRGB"/>
                                             <nil key="highlightedColor"/>
                                         </label>
                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="主控设定" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Cdp-22-2A9">
-                                            <rect key="frame" x="73.5" y="161" width="64" height="22.5"/>
+                                            <rect key="frame" x="73.5" y="143.5" width="64" height="22.5"/>
                                             <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="16"/>
                                             <color key="textColor" red="0.1529411765" green="0.18039215689999999" blue="0.23137254900000001" alpha="1" colorSpace="calibratedRGB"/>
                                             <nil key="highlightedColor"/>
@@ -64,7 +74,7 @@
                                         <constraint firstItem="dtl-C8-0cC" firstAttribute="leading" secondItem="TUq-Bs-9C5" secondAttribute="trailing" id="QpW-EH-kFk"/>
                                         <constraint firstAttribute="width" secondItem="dfv-82-UbI" secondAttribute="height" id="S0h-Qs-RHR"/>
                                         <constraint firstItem="Cdp-22-2A9" firstAttribute="top" secondItem="TUq-Bs-9C5" secondAttribute="bottom" constant="5" id="kfW-sW-YTT"/>
-                                        <constraint firstItem="TUq-Bs-9C5" firstAttribute="top" secondItem="dtl-C8-0cC" secondAttribute="top" multiplier="0.8" id="ln7-pg-JO8"/>
+                                        <constraint firstItem="TUq-Bs-9C5" firstAttribute="top" secondItem="dtl-C8-0cC" secondAttribute="top" constant="-6" id="ln7-pg-JO8"/>
                                         <constraint firstItem="TUq-Bs-9C5" firstAttribute="centerX" secondItem="dfv-82-UbI" secondAttribute="centerX" id="swS-Tv-6ii"/>
                                     </constraints>
                                 </view>
@@ -106,11 +116,9 @@
                                 <constraint firstItem="sbe-1G-lug" firstAttribute="top" secondItem="dfv-82-UbI" secondAttribute="bottom" id="ZcX-QB-w1U"/>
                                 <constraint firstAttribute="bottom" secondItem="sbe-1G-lug" secondAttribute="bottom" id="ZgT-2w-9rs"/>
                                 <constraint firstAttribute="trailing" secondItem="BK4-fL-6xV" secondAttribute="trailing" id="de7-eF-DjK"/>
+                                <constraint firstItem="kGa-cc-CSP" firstAttribute="centerX" secondItem="Qyn-r8-ZqS" secondAttribute="centerX" id="fu9-EG-67x"/>
                                 <constraint firstItem="dfv-82-UbI" firstAttribute="top" secondItem="Qyn-r8-ZqS" secondAttribute="top" id="gji-WS-0fQ"/>
-                                <constraint firstItem="kGa-cc-CSP" firstAttribute="leading" secondItem="Qyn-r8-ZqS" secondAttribute="leading" id="rgM-IX-G5J"/>
-                                <constraint firstAttribute="bottom" secondItem="kGa-cc-CSP" secondAttribute="bottom" id="unU-OB-5lp"/>
                                 <constraint firstItem="dfv-82-UbI" firstAttribute="centerX" secondItem="Qyn-r8-ZqS" secondAttribute="centerX" id="vrX-zZ-AQD"/>
-                                <constraint firstAttribute="trailing" secondItem="kGa-cc-CSP" secondAttribute="trailing" id="zes-Jx-yVE"/>
                             </constraints>
                         </view>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aqY-gg-Q7A">
@@ -166,14 +174,14 @@
                             <rect key="frame" x="25" y="384" width="325" height="58"/>
                             <subviews>
                                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_fan" translatesAutoresizingMaskIntoConstraints="NO" id="ZWj-fd-eWp">
-                                    <rect key="frame" x="10" y="14" width="30" height="30"/>
+                                    <rect key="frame" x="10" y="14" width="23" height="30"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="30" id="K3m-Rp-ecB"/>
-                                        <constraint firstAttribute="width" constant="30" id="i2S-gt-02q"/>
+                                        <constraint firstAttribute="width" constant="23" id="i2S-gt-02q"/>
                                     </constraints>
                                 </imageView>
                                 <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1" minValue="0.0" maxValue="5" translatesAutoresizingMaskIntoConstraints="NO" id="NGB-dm-V3h" customClass="RDSlider">
-                                    <rect key="frame" x="45" y="14" width="255" height="31"/>
+                                    <rect key="frame" x="38" y="14" width="262" height="31"/>
                                     <connections>
                                         <action selector="fanValueChanged:" destination="-1" eventType="valueChanged" id="2r6-Lf-oNj"/>
                                         <action selector="fanValueDidChanged:" destination="-1" eventType="touchUpInside" id="NVf-Ds-aax"/>
@@ -181,7 +189,7 @@
                                     </connections>
                                 </slider>
                             </subviews>
-                            <color key="backgroundColor" red="0.91372549020000005" green="0.94901960780000005" blue="0.94901960780000005" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
+                            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             <gestureRecognizers/>
                             <constraints>
                                 <constraint firstItem="ZWj-fd-eWp" firstAttribute="leading" secondItem="rlX-Vv-HSU" secondAttribute="leading" constant="10" id="Kx0-Ll-dag"/>
@@ -242,10 +250,10 @@
     </objects>
     <resources>
         <image name="icon_add_1" width="40" height="40"/>
-        <image name="icon_fan" width="30" height="30"/>
+        <image name="icon_fan" width="22" height="22"/>
         <image name="icon_humidity_g" width="28" height="28"/>
-        <image name="icon_on_1" width="46" height="46"/>
-        <image name="icon_on_sel_1" width="46" height="46"/>
+        <image name="icon_on_1" width="75" height="70"/>
+        <image name="icon_on_sel_1" width="75" height="70"/>
         <image name="icon_reduce" width="40" height="40"/>
         <image name="icon_temperature" width="24" height="24"/>
         <systemColor name="systemBackgroundColor">

+ 2 - 0
Temperature/ControlModule/Home/Model/RDSDeviceTypeModel.h

@@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, copy) NSString *code;
 @property (nonatomic, copy) NSString *parent_id;
 @property (nonatomic, copy) NSString *icon;
+@property (nonatomic, assign, readonly) BOOL isMasterController;
+
 @property (nonatomic, strong) NSArray<RDSDeviceTypeModel *> *children;
 
 @property (nonatomic, strong, readonly) NSMutableArray<RDSDeviceTypeModel *> *deviceTypeList;

+ 9 - 0
Temperature/ControlModule/Home/Model/RDSDeviceTypeModel.m

@@ -9,6 +9,15 @@
 
 @implementation RDSDeviceTypeModel
 
+- (void)setCode:(NSString *)code {
+    _code = code;
+    if ([code isEqualToString:@"YXK-Z/86-FG-A"] || [code isEqualToString:@"YXK-Z/86-FC-B"]) {
+        _isMasterController = YES;
+    } else {
+        _isMasterController = NO;
+    }
+}
+
 - (NSString * _Nullable)getDeviceNameWithIndex:(NSInteger)index {
     if (index < self.deviceTypeList.count) {
         RDSDeviceTypeModel *deviceTypeModel = self.deviceTypeList[index];

+ 1 - 1
Temperature/ControlModule/Home/View/RDSCtrlModeView.m

@@ -9,7 +9,7 @@
 #import "RDSCtrlModeCell.h"
 
 static NSString * const RDSCtrlModeCellID = @"RDSCtrlModeCellID";
-const NSInteger ModeCellNumber = 4;
+const NSInteger ModeCellNumber = 5;
 
 @interface RDSCtrlModeView ()<UICollectionViewDelegate, UICollectionViewDataSource>
 @property (nonatomic, weak) UICollectionView *collectionView;

+ 74 - 2
Temperature/ControlModule/Home/View/RDSRoomCell.m

@@ -18,6 +18,9 @@
 @property (nonatomic, strong) UIView *pointView;
 @property (nonatomic, strong) UILabel *statusLabel;
 @property (nonatomic, strong) UISwitch *deviceSwitch;
+@property (nonatomic, strong) UIButton *deleteButton;
+
+@property (nonatomic, strong) NSDictionary *codeToNameDic;
 
 @end
 
@@ -35,8 +38,18 @@
 - (void)setModel:(RDSRoomModel *)model {
     _model = model;
     self.roomNameLabel.text = model.name;
-    self.iconView.image = [UIImage imageNamed:@"icon_fluorine_main_controller"];
-    self.deviceTypeLabel.text = @"主控制器";
+    if (isEmptyString(model.code)) {
+        self.iconView.image = [UIImage imageNamed:@"icon_fluorine_sub_controller"];
+    } else {
+        self.iconView.image = [UIImage imageNamed:self.codeToNameDic[model.code]];
+    }
+    
+    if (isEmptyString(model.device_type_name)) {
+        self.deviceTypeLabel.text = @"分控制器";
+    } else {
+        self.deviceTypeLabel.text = model.device_type_name;
+    }
+    
     self.deviceSwitch.on = model.power;
     if (model.power) {
         self.statusLabel.text = [NSString stringWithFormat:@"温度%@°C 湿度%@%%", @(model.temperature), @(model.humidity)];
@@ -49,6 +62,44 @@
     }
 }
 
+- (void)setIsEdit:(BOOL)isEdit {
+    _isEdit = isEdit;
+    
+    if (isEdit) {
+        [self.deviceSwitch removeFromSuperview];
+        [self.contentView addSubview:self.deleteButton];
+        [self.deleteButton mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.size.mas_equalTo(CGSizeMake(48, 48));
+            make.right.equalTo(self.containerView).offset(-16);
+            make.centerY.mas_equalTo(0);
+        }];
+        
+        [self.roomNameLabel mas_updateConstraints:^(MASConstraintMaker *make) {
+            make.right.equalTo(self.deleteButton.mas_left).offset(-12);
+        }];
+    } else {
+        [self.deleteButton removeFromSuperview];
+        [self.contentView addSubview:self.deviceSwitch];
+        [self.deviceSwitch mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.size.mas_equalTo(CGSizeMake(48, 24));
+            make.centerY.mas_equalTo(0);
+            make.right.equalTo(self.containerView).offset(-16);
+        }];
+        
+        [self.roomNameLabel mas_updateConstraints:^(MASConstraintMaker *make) {
+            make.right.equalTo(self.deviceSwitch.mas_left).offset(-12);
+        }];
+    }
+}
+
+
+- (void)onPowerChanged:(UISwitch *)powerSwitch {
+    BLOCK_SAFE_RUN(_onPowerClick, powerSwitch.isOn);
+}
+
+- (void)deleteButtonClicked {
+    BLOCK_SAFE_RUN(_onDelClick);
+}
 
 - (void)configSubviews {
     [self.contentView addSubview:self.containerView];
@@ -172,8 +223,29 @@
         _deviceSwitch = [[UISwitch alloc] init];
         _deviceSwitch.onTintColor = [UIColor colorWithHexString:@"#14C9C8"];
         _deviceSwitch.tintColor = [UIColor colorWithHexString:@"#D9D9D9"];
+        [_deviceSwitch addTarget:self action:@selector(onPowerChanged:) forControlEvents:UIControlEventValueChanged];
     }
     return _deviceSwitch;
 }
 
+- (UIButton *)deleteButton {
+    if (!_deleteButton) {
+        _deleteButton = [[UIButton alloc] init];
+        [_deleteButton setImage:[UIImage imageNamed:@"icon_delete"] forState:UIControlStateNormal];
+        [_deleteButton addTarget:self action:@selector(deleteButtonClicked) forControlEvents:UIControlEventTouchUpInside];
+    }
+    return _deleteButton;
+}
+
+- (NSDictionary *)codeToNameDic {
+    if (!_codeToNameDic) {
+        _codeToNameDic = @{@"YXK-Z/86-FG-A": @"icon_fluorine_main_controller",
+                           @"YXK-F/86-FG-A": @"icon_fluorine_sub_controller",
+                           @"YXK-Z/86-FC-B": @"icon_water_main_controller",
+                           @"YXK-F/86-FC-B": @"icon_water_sub_controller",
+                           @"YXK-P/DN-JF-8": @"icon_diverter_water_collector"};
+    }
+    return _codeToNameDic;
+}
+
 @end

+ 1 - 1
Temperature/ControlModule/Room/Controller/RDSRoomVC.m

@@ -213,7 +213,7 @@ static NSString * const RDSRoomCellID = @"RDSRoomCellID";
     if (_isEdit) return;
 
     RDSRoomModel *roomModel = TheDataManager.rooms[indexPath.row];
-    if(roomModel.is_master){
+    if(roomModel.isMasterController){
         RDSAirControlVC *vc = [[RDSAirControlVC alloc] init];
         vc.hidesBottomBarWhenPushed = YES;
         vc.roomModel = roomModel;

+ 5 - 0
Temperature/ControlModule/Room/Model/RDSRoomModel.h

@@ -34,12 +34,16 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, strong) NSString *type;           //
 @property (nonatomic, strong) NSString *record_id;      // 记录id
 @property (nonatomic, strong) NSString *control_number; // 分控编号
+@property (nonatomic, strong) NSString *code;           // 设备类型 code
+@property (nonatomic, strong) NSString *device_type_name;
+
 
 @property (nonatomic, strong) NSString *home_name;      // 家名称
 @property (nonatomic, strong) NSString *home_id;        // 家id
 @property (nonatomic, strong) NSString *user_id;        //
 
 // 设备状态
+@property (nonatomic, assign, readonly) BOOL isMasterController;
 @property (nonatomic, assign) BOOL is_master;           // 是否是主控
 @property (nonatomic, assign) int air_quality;          // 空气质量 pm2.5
 @property (nonatomic, assign) int temperature;          // 温度
@@ -50,6 +54,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic, assign) BOOL new_fan;             // 新风开关
 @property (nonatomic, assign) int mode;                 // 模式(1:制冷2:制热 3:除湿 4:送风 5:新风 6:加湿)
 @property (nonatomic, assign) int fan_speed;            // 风速(1,2,3,4,5)
+@property (nonatomic, assign) BOOL sleep_mode;          // 睡眠模式是否开启(true 和 false)
 @property (nonatomic, assign) int fan_value;            // 风阀档位
 @property (nonatomic, assign) BOOL timer_status;        // 定时状态
 @property (nonatomic, strong) NSNumber *duration;       // 定时时长

+ 8 - 0
Temperature/ControlModule/Room/Model/RDSRoomModel.m

@@ -9,6 +9,14 @@
 
 @implementation RDSRoomModel
 
+- (void)setCode:(NSString *)code {
+    _code = code;
+    if ([code isEqualToString:@"YXK-Z/86-FG-A"] || [code isEqualToString:@"YXK-Z/86-FC-B"]) {
+        _isMasterController = YES;
+    } else {
+        _isMasterController = NO;
+    }
+}
 
 + (void)rds_getRoomListFinished:(void (^)(NSError *))finished{
     

+ 0 - 6
Temperature/Info.plist

@@ -2,12 +2,6 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-	<key>NSBluetoothPeripheralUsageDescription</key>
-	<string>需要打开蓝牙,才能添加主控面板设备</string>
-	<key>NSLocationWhenInUseUsageDescription</key>
-	<string>开启后,才能获取定位信息,用于加载天气信息</string>
-	<key>NSLocationAlwaysUsageDescription</key>
-	<string>开启后,才能获取定位信息,用于绑定设备和加载天气信息</string>
 	<key>CFBundleAllowMixedLocalizations</key>
 	<true/>
 	<key>NSAppTransportSecurity</key>

+ 5 - 1
Temperature/NetWork/RDSDemoApiHelper.h

@@ -177,7 +177,7 @@ AS_SINGLETON(RDSDemoApiHelper)
 /// - Parameters:
 ///   - name: 房间名
 ///   - control_number: 分控编号
-+ (void)rds_addRoomName:(NSString *)name control_number:(NSString *)control_number success:(void (^)(id responseObject))success
++ (void)rds_addRoomName:(NSString *)name control_number:(NSString *)control_number device_type_id:(NSString *)device_type_id success:(void (^)(id responseObject))success
                    failure:(void (^)(NSError *error))failure;
 
 
@@ -223,6 +223,10 @@ AS_SINGLETON(RDSDemoApiHelper)
 + (void)rds_setNewFanPower:(int)power control_number:(NSString *)control_number success:(void (^)(id responseObject))success
                    failure:(void (^)(NSError *error))failure;
 
+// 睡眠开关
++ (void)rds_setSleepPower:(int)power control_number:(NSString *)control_number success:(void (^)(id responseObject))success
+                  failure:(void (^)(NSError *error))failure;
+
 /// 分控开关
 + (void)rds_setSubDevPower:(int)power control_number:(NSString *)control_number success:(void (^)(id responseObject))success
                    failure:(void (^)(NSError *error))failure;

+ 20 - 1
Temperature/NetWork/RDSDemoApiHelper.m

@@ -594,12 +594,13 @@ DEF_SINGLETON(RDSDemoApiHelper)
                               progress:nil];
 }
 
-+ (void)rds_addRoomName:(NSString *)name control_number:(NSString *)control_number success:(void (^)(id))success failure:(void (^)(NSError *))failure{
++ (void)rds_addRoomName:(NSString *)name control_number:(NSString *)control_number device_type_id:(NSString *)device_type_id success:(void (^)(id))success failure:(void (^)(NSError *))failure{
     
     NSDictionary *param = @{
         @"name" : name,
         @"control_number" : control_number,
         @"home_id" : TheDataManager.current_home_id,
+        @"device_type_id": device_type_id
         //@"is_master" : @2,
     };
     NSDictionary *hearder = @{
@@ -816,6 +817,24 @@ DEF_SINGLETON(RDSDemoApiHelper)
                                  progress:nil];
 }
 
++ (void)rds_setSleepPower:(int)power control_number:(NSString *)control_number success:(void (^)(id))success failure:(void (^)(NSError *))failure {
+    NSDictionary *param = @{
+        @"gateway" : TheDataManager.gateway,
+        @"control_number" : control_number,
+        @"power" : @(power),
+    };
+    NSDictionary *hearder = @{
+        @"Authorization" : TheDataManager.token,
+        @"X-YX-APP": TheApiHelper.appHeader
+    };
+    [RDSDemoApiHelper postWithUrlString:@"control/sleep"
+                              paraments:param
+                                headers:hearder
+                                success:success
+                                   fail:failure
+                               progress:nil];
+}
+
 + (void)rds_setSubDevPower:(int)power control_number:(NSString *)control_number success:(void (^)(id))success failure:(void (^)(NSError *))failure{
     
     NSDictionary *param = @{

+ 3 - 3
Temperature/ThirdPart/CYCircularSlider/CYCircularSlider.m

@@ -30,7 +30,7 @@
         _unfilledColor = [UIColor colorWithRed:250/255.0f green:60/255.0f blue:20/255.0f alpha:1.0f];
         _filledColor = [UIColor colorWithRed:175/255.0f green:195/255.0f blue:5/255.0f alpha:1.0f];
         _handleColor = UIColor.whiteColor;
-        _handleColor2 = UIColor.greenColor;
+        _handleColor2 = RDSGreenColor;
         _handleColor3 = UIColor.clearColor;
         radius = self.frame.size.height/2 - _lineWidth/2-10;// 半径 决定大小
         _angle = 140;
@@ -90,12 +90,12 @@
     // 大圆点
     CGPoint handleCenter =  [self pointFromAngle: _angle];
     [_handleColor set];
-    CGContextFillEllipseInRect(ctx, CGRectMake(handleCenter.x-5, handleCenter.y-5, _lineWidth+10, _lineWidth+10));
+    CGContextFillEllipseInRect(ctx, CGRectMake(handleCenter.x-8, handleCenter.y-8, _lineWidth+16, _lineWidth+16));
     CGContextRestoreGState(ctx);
     
     
     // 中间小圆点
-    CGFloat width = 10;
+    CGFloat width = 18;
     CGContextSaveGState(ctx);
     [_handleColor2 set];
     CGContextFillEllipseInRect(ctx, CGRectMake(handleCenter.x-(width-_lineWidth)/2, handleCenter.y-(width-_lineWidth)/2, width, width));

+ 5 - 3
Temperature/Tools/Slider/RDSlider.m

@@ -10,9 +10,11 @@
 @implementation RDSlider
 
 // 改变slider滑道的高的
-- (CGRect)trackRectForBounds:(CGRect)bounds{
-    
-    return CGRectMake(0, 0, CGRectGetWidth(self.frame), 12);
+- (CGRect)trackRectForBounds:(CGRect)bounds {
+    CGRect rect = bounds;
+    rect.size.height = 10;
+    rect.origin.y = (self.frame.size.height - rect.size.height) / 2;
+    return rect;
 }