public async void Open() { var ewelink = new Ewelink(Email, Password, Region); await ewelink.GetCredentials(); await ewelink.GetDevices(); ewelink.OpenWebSocket(); ewelink.CloseWebSocket(); }
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); }