def handle_message(self, message):
        """Process UDP messages"""
        if self._yamaha:
            if 'power' in message:
                _LOGGER.debug("Power: %s", message.get('power'))
                self._yamaha.power = (
                    STATE_ON if message.get('power') == "on" else STATE_OFF)
            if 'input' in message:
                _LOGGER.debug("Input: %s", message.get('input'))
                self._yamaha._source = message.get('input')
            if 'volume' in message:
                volume = message.get('volume')

                if 'max_volume' in message:
                    volume_max = message.get('max_volume')
                else:
                    volume_max = self._yamaha.volume_max

                _LOGGER.debug("Volume: %d / Max: %d", volume, volume_max)

                self._yamaha.volume = volume / volume_max
                self._yamaha.volume_max = volume_max
            if 'mute' in message:
                _LOGGER.debug("Mute: %s", message.get('mute'))
                self._yamaha.mute = message.get('mute', False)
        else:
            _LOGGER.debug("No yamaha-obj found")
def handle_message ( self , message ) : if self . _yamaha : if 'power' in message : _LOGGER . debug ( "Power: %s" , message . get ( 'power' ) ) self . _yamaha . power = ( STATE_ON if message . get ( 'power' ) == "on" else STATE_OFF ) if 'input' in message : _LOGGER . debug ( "Input: %s" , message . get ( 'input' ) ) self . _yamaha . _source = message . get ( 'input' ) if 'volume' in message : volume = message . get ( 'volume' ) if 'max_volume' in message : volume_max = message . get ( 'max_volume' ) else : volume_max = self . _yamaha . volume_max _LOGGER . debug ( "Volume: %d / Max: %d" , volume , volume_max ) self . _yamaha . volume = volume / volume_max self . _yamaha . volume_max = volume_max if 'mute' in message : _LOGGER . debug ( "Mute: %s" , message . get ( 'mute' ) ) self . _yamaha . mute = message . get ( 'mute' , False ) else : _LOGGER . debug ( "No yamaha-obj found" )
Process UDP messages