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");
 }