// Parrot interaction private async Task <bool> GetNoiseControlEnabledAsync() { var noiseControl = await _parrotClient.SendMessageAsync(new ParrotMessage(ResourceType.NoiseControlEnabledGet)); var noiseControlValue = noiseControl.XPathSelectElement("/audio/noise_control").GetAttribute("enabled"); return(noiseControlValue.Equals("true")); }
// Parrot interaction private async Task <bool> GetConcertHallEnabledAsync() { var concertHall = await _parrotClient.SendMessageAsync(new ParrotMessage(ResourceType.ConcertHallEnabledGet)); var concertHallValue = concertHall.XPathSelectElement("/audio/sound_effect").GetAttribute("enabled"); return(concertHallValue.Equals("true")); }
// Parrot interaction private async Task <(bool charging, int batteryPercent)> GetBatteryAsync() { var battery = await _parrotClient.SendMessageAsync(new ParrotMessage(ResourceType.BatteryGet)); var batteryElement = battery.XPathSelectElement("/system/battery"); var batteryCharging = batteryElement.GetAttribute("state"); var batteryPercent = batteryElement.GetAttribute("percent"); var charging = batteryCharging.Equals("charging") || batteryCharging.Equals("charged"); return(charging, int.Parse(batteryPercent)); }