| | |
| | | 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 }; |