示例#1
0
        public async Task <int> VolumeDown()
        {
            var volume = await GetVolume();

            var newVolume = volume - 5;

            var xmlResponse = await YamahaHelper.DoRequest($"<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><Main_Zone><Volume><Lvl><Val>{newVolume}</Val><Exp>1</Exp><Unit>dB</Unit></Lvl></Volume></Main_Zone></YAMAHA_AV>");

            return(newVolume);
        }
示例#2
0
        public async Task <string> SetVolume(int volume)
        {
            var xmlResponse = await YamahaHelper.DoRequest($"<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><Main_Zone><Volume><Lvl><Val>{volume}</Val><Exp>1</Exp><Unit>dB</Unit></Lvl></Volume></Main_Zone></YAMAHA_AV>");

            return(xmlResponse);
        }
示例#3
0
        public async Task <string> TurnOff()
        {
            var xmlResponse = await YamahaHelper.DoRequest("<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><Main_Zone><Power_Control><Power>Standby</Power></Power_Control></Main_Zone></YAMAHA_AV>");

            return(xmlResponse);
        }
示例#4
0
        public async Task <string> SetInput(string input)
        {
            var xmlResponse = await YamahaHelper.DoRequest($"<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"PUT\"><Main_Zone><Input><Input_Sel>{input}</Input_Sel></Input></Main_Zone></YAMAHA_AV>");

            return(xmlResponse);
        }
示例#5
0
        public async Task <YamahaBasicStatus> GetInfo()
        {
            var xmlResponse = await YamahaHelper.DoRequest("<?xml version=\"1.0\" encoding=\"utf-8\"?><YAMAHA_AV cmd=\"GET\"><Main_Zone><Basic_Status>GetParam</Basic_Status></Main_Zone></YAMAHA_AV>");

            return(YamahaHelper.SerializeXmlString <YamahaBasicStatus>(xmlResponse));
        }