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