wxr
2020-02-27 37c33341f75841dc39c535eb62a3603f596516a1
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);