示例#1
0
        public async void Open()
        {
            var ewelink = new Ewelink(Email, Password, Region);
            await ewelink.GetCredentials();

            await ewelink.GetDevices();

            ewelink.OpenWebSocket();
            ewelink.CloseWebSocket();
        }
示例#2
0
        public async void Listen()
        {
            var ewelink = new Ewelink(Email, Password, Region);
            await ewelink.GetCredentials();

            await ewelink.GetDevices();

            var messages = "";

            ewelink.webSocket.OnMessage += (s, e) => messages += e.Message.AsJson();
            ewelink.OpenWebSocket();

            System.Threading.Thread.Sleep(2000);

            output.WriteLine(messages);
        }