import sys from naoqi import qi from naoqi import ALProxy class system_info: ipadress = "146.50.60.59" #sam wireless port = "9559" def subscribeDevice(self, app): self.session = app.session self.system_proxy = self.session.service("ALSystem") robot_name = self.system_proxy.robotName() naoqi_version = self.system_proxy.systemVersion() print("The robot %s has version %s" % (robot_name, naoqi_version)) self.audio_proxy = self.session.service("ALAudioDevice") self.audio_proxy.setOutputVolume(70) def unsubscribeDevice(self): volume = self.audio_proxy.getOutputVolume() print('The sound is now on volume %d' % volume) if __name__ == '__main__': print("Note that could specify the ip-address with the argument '--qi-url=tcp://146.50.60.??'") application = qi.Application(sys.argv) try: application.start() except RunTimeError: print("Can't connect to Naoqi at " + sys.argv) sys.exit(1) element = system_info() element.subscribeDevice(application) element.unsubscribeDevice()