From c3e1b733fc45bd9f0b88bfb560cfa87a270b079b Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 09 九月 2020 17:33:58 +0800
Subject: [PATCH] 20200909

---
 HDL_ON/DriverLayer/CommonPage.cs |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/HDL_ON/DriverLayer/CommonPage.cs b/HDL_ON/DriverLayer/CommonPage.cs
index 285baea..da2744c 100644
--- a/HDL_ON/DriverLayer/CommonPage.cs
+++ b/HDL_ON/DriverLayer/CommonPage.cs
@@ -12,8 +12,6 @@
 {
     public static class CommonPage
     {
-
-        public static bool IsRemote;
         public static Action RefreshAir;
         public static string FindGatewayChilrenIPAddress = new NetWiFi().BroadcastIpAddress.ToString();
         private static string ip = "0.0.0.0";
@@ -182,13 +180,13 @@
                     case Command.ReadLightAllLoopBrightnessACK:
                         for (int i = 0; i < receiveBytes[0]; i++)
                         {
-                            var light = DB_ResidenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.LoopID == i);
+                            var light = DB_ResidenceData.functionList.lights.Find((obj) => obj.bus_Data.SubnetID == subnetID && obj.bus_Data.DeviceID == deviceID && obj.bus_Data.LoopID == (i+1));
                             if (light != null)
                             {
                                 if (light.functionType != FunctionType.RGB)
                                 {
-                                    light.trait_on_off.value = receiveBytes[2] == 0 ? "off" : "on";
-                                    if (light.trait_on_off.value == "on")
+                                    light.trait_on_off.value = receiveBytes[light.bus_Data.LoopID] == 0 ? "off" : "on";
+                                    if (light.trait_on_off.value.ToString() == "on")
                                     {
                                         light.brightness = receiveBytes[2];
                                         light.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[2] + "%";
@@ -280,8 +278,8 @@
                                     {
                                         curtain.trait_on_off.value = "off";
                                     }
-                                    curtain.openLevel = receiveBytes[1];
-                                    curtain.lastState = Language.StringByID(StringId.Open) + curtain.openLevel + "%";
+                                    curtain.percent = receiveBytes[1];
+                                    curtain.lastState = Language.StringByID(StringId.Open) + curtain.percent + "%";
                                 }
                                 else
                                 {

--
Gitblit v1.8.0