Example #1
0
        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"
        }
Example #2
0
        //[LSmartThings.LAction.Switch("{{a}},{{st},"SmartThings_MVC_LINKS")]
        public static string Switch(string DeviceState, string DeviceName, string AppName)
        {
            string retVal = "";

            //Debugger.Break();

            InitEndPoints(AppName);
            retVal = stDevices.ChangeDevState(DeviceName, DeviceState);


            return(retVal);
        }