wxr
2020-03-13 171bf03f3664226eeff2b20ee9bd2e914b63a17d
HDL_ON/DriverLayer/Control.cs
@@ -81,7 +81,13 @@
                        switch ((FunctionType)Enum.ToObject(typeof(FunctionType), Convert.ToInt32(functionType)))
                        {
                            case FunctionType.Light:
                                if (jobj.ContainsKey("switch"))//继电器
                                if (jobj.ContainsKey("brightness"))
                                {
                                    var state = Convert.ToByte(jobj.GetValue("brightness"));
                                    var bytes = new byte[] { Convert.ToByte(loopId), state, 0, 0 };
                                    return ControlBytesSendHasReturn(Command.SetSingleLight, subnetId, deviceId, bytes);
                                }
                                else if (jobj.ContainsKey("switch"))//继电器
                                {
                                    var state = jobj.GetValue("switch").ToString() == "0" ? (byte)0 : (byte)100;
                                    var bytes = new byte[] { Convert.ToByte(loopId), state, 0, 0 };