private async Task <ZoneState> GetMainZoneState(DenonDevice denonDevice)
        {
            var state = await _commander.GetMainZoneState(denonDevice);

            return(state switch
            {
                "ZMOFF" => ZoneState.Off,
                "ZMON" => ZoneState.On,
                _ => ZoneState.Unknown
            });
        public async Task <DeviceInformation> GetDeviceInformation(DenonDevice denonDevice)
        {
            var deviceInformation = new DeviceInformation(
                await GetMuteState(denonDevice),
                await GetMasterVolume(denonDevice),
                await GetMainZoneState(denonDevice),
                await GetZone2State(denonDevice),
                await GetSubwooferLevel(denonDevice)
                );

            return(deviceInformation);
        }
Ejemplo n.º 3
0
 public async Task <string> GetSubwooferLevel(DenonDevice denonPlayer)
 {
     return(await IssueCommand(denonPlayer.Ip, "PSSWL ?"));
 }
Ejemplo n.º 4
0
 public async Task SetSubwooferLevel(DenonDevice denonPlayer, int value)
 {
     await IssueCommand(denonPlayer.Ip, $"PSSWL {value}");
 }
Ejemplo n.º 5
0
 public async Task <string> GetMasterVolume(DenonDevice denonPlayer)
 {
     return(await IssueCommand(denonPlayer.Ip, "MV?"));
 }
Ejemplo n.º 6
0
 public async Task SetMasterVolume(DenonDevice denonPlayer, int value)
 {
     value = Math.Min(Math.Max(value, 0), 98);
     await IssueCommand(denonPlayer.Ip, $"MV{value}");
 }
Ejemplo n.º 7
0
 public async Task <string> GetZone2State(DenonDevice denonPlayer)
 {
     return(await IssueCommand(denonPlayer.Ip, "Z2?"));
 }
Ejemplo n.º 8
0
 public async void Zone2Off(DenonDevice denonPlayer)
 {
     await IssueCommand(denonPlayer.Ip, "Z2OFF");
 }
Ejemplo n.º 9
0
 public async void MainZoneOff(DenonDevice denonPlayer)
 {
     await IssueCommand(denonPlayer.Ip, "ZMOFF");
 }
Ejemplo n.º 10
0
 public async void Unmute(DenonDevice denonPlayer)
 {
     await IssueCommand(denonPlayer.Ip, "MUOFF");
 }