public async Task Execute(ITpLinkClient powerLine) { Debug.WriteLine("Reboting.."); await powerLine.RebootAsync(); Debug.WriteLine("done reboot"); }
public async Task Execute(ITpLinkClient powerLine) { System.Console.WriteLine("turning off 5ghz and 2.4ghz signal!"); await powerLine.ChangeWireless5GStatusAsync(false); await powerLine.ChangeWireless2GStatusAsync(false); }
public async Task DiscoverAsync() { string login = Environment.GetEnvironmentVariable("tplink_powerline_login", EnvironmentVariableTarget.User); string pwd = Environment.GetEnvironmentVariable("tplink_powerline_pwd", EnvironmentVariableTarget.User); string endpoint = await TpLinkClient.DiscoveryAsync(); powerLine = new TpLinkClient(login, pwd, $"http://{endpoint}"); }
public async Task Execute(ITpLinkClient powerLine) { System.Console.WriteLine(); System.Console.WriteLine("Execuding display command"); var result = await powerLine.GetClientsAsync(); if (result.Data.Count < 1) { return; } System.Console.WriteLine(); System.Console.WriteLine($"{"Name",-30}|{"IP",-30}|Mac"); // foreach (var client in result.Data.OrderBy(c => int.Parse(c.IP[^2..]))) foreach (var client in result.Data.OrderBy(c => int.Parse(c.IP.Split('.').Last()))) { System.Console.WriteLine($"{client.DeviceName,-30}|{client.IP,-30}|{client.Mac.Replace("-", ":")}"); } }
public Worker(ILogger <Worker> logger, ITpLinkClient tpLinkClient) { _logger = logger; _tpLinkClient = tpLinkClient; }
public async Task Execute(ITpLinkClient powerLine) { await powerLine.ChangeWireless5GStatusAsync(true); await powerLine.ChangeWireless2GStatusAsync(true); }