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