Beispiel #1
0
        public async Task GetSwitchTemperatures()
        {
            SessionInfo session = new SessionInfo(TestCredentials.USERNAME, TestCredentials.PASSWORD, TestCredentials.HOSTNAME);
            await session.AuthenticateAsync();

            string[] switches = await session.GetSwitchesAsync();

            foreach (string ain in switches)
            {
                string name = await session.GetSwitchNameAsync(ain);

                double power = await session.GetSwitchPowerAsync(ain);

                double energy = await session.GetSwitchEnergyAsync(ain);

                double temp = await session.GetSwitchTemperatureAsync(ain);

                string message = $"Switch {ain}" +
                                 $"\r\n name   = {name}" +
                                 $"\r\n P [mW] = {power}" +
                                 $"\r\n E [Wh] = {energy}" +
                                 $"\r\n T [°C] = {temp}";
                Debug.WriteLine(message);
            }
        }