static void Main(string[] args) { //Put("{\"on\":true}", ""); //System.Diagnostics.Debugger.Launch(); //System.Diagnostics.Debugger.Break(); //LSmartThings.EndPoints stDevices = new EndPoints(It.InitAuthWindowAsync("SmartThings_MVC_LINKS")); //stDevices.ChangeDevStat("Living Room Kitchen Light", "on"); //LSmartThings AppName="SmartThings_MVC_LINKS" DeviceName="Living Room Kitchen Light" DeviceStatus="on" //string appName = args[2]; //string deviceName = args[0]; //string deviceStatus = args[1]; var parsedArgs = args .Select(s => s.Split(new[] { '=' })) .ToDictionary(s => s[0], s => s[1]); EndPoints stDevices = new EndPoints(It.InitAuthWindowAsync(parsedArgs["AppName"])); Console.WriteLine(stDevices.ChangeDevState(parsedArgs["DeviceName"], parsedArgs["DeviceStatus"])); //"Living Room Kitchen Light" "on" "SmartThings_MVC_LINKS" }
private static void InitEndPoints(string AppName) { if (stDevices == null) { stDevices = new EndPoints(It.InitAuthWindowAsync(AppName)); _appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); } }