From 37c33341f75841dc39c535eb62a3603f596516a1 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 27 二月 2020 17:11:53 +0800
Subject: [PATCH] 20200227

---
 HDL_ON/DAL/Net/CommonPage.cs |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/HDL_ON/DAL/Net/CommonPage.cs b/HDL_ON/DAL/Net/CommonPage.cs
index efd3d4a..582cbf2 100644
--- a/HDL_ON/DAL/Net/CommonPage.cs
+++ b/HDL_ON/DAL/Net/CommonPage.cs
@@ -97,12 +97,13 @@
             {
                 switch (command)
                 {
+                    case Command.ReadLightSingleLoopBrightnessACK:
                     case Command.SetSingleLightACK:
-                        foreach (var function in DB_ResidenceData.residenceData.functions)
+                        foreach (var function in DB_ResidenceData.residenceData.functions.lights)
                         {
                             if (function.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0])
                             {
-                                if (function.funcType == FunctionType.Light)
+                                if (function.functionCategory == FunctionType.Light)
                                 {
                                     var light = function as Light;
                                     if (receiveBytes[2] == 0 && light.state == 0)
@@ -113,17 +114,19 @@
                                     {
                                         break;
                                     }
-                                    if (function.bus_DeviceType == "Relay")
+                                    if (function.functionType == "Relay")
                                     {
                                         var relay = function as Light;
                                         relay.state = receiveBytes[2] == 0 ? 0 : 1;
                                         HomePage.UpdataLightView(relay);
+                                        //RoomPage.
                                     }
-                                    else if (function.bus_DeviceType == "Dimmer")
+                                    else if (function.functionType == "brightness")
                                     {
-                                        var dimmer = function as Dimmer;
+                                        var dimmer = function as Light;
                                         dimmer.state = receiveBytes[2] == 0 ? 0 : 1;
-                                        dimmer.brightness = receiveBytes[1];
+                                        dimmer.dicPropert["brightness"] = receiveBytes[1];
+                                        //dimmer.brightness = receiveBytes[1];
                                         if (receiveBytes[2] > 0)
                                             dimmer.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[2] + "%";
                                         HomePage.UpdataLightView(dimmer);

--
Gitblit v1.8.0