Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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));
        }