Beispiel #1
0
	def P_vol(self, request):
		if "set" not in request.args.keys() or request.args["set"][0] == "state":
			return getVolumeStatus()
		elif request.args["set"][0] == "up":
			return setVolumeUp()
		elif request.args["set"][0] == "down":
			return setVolumeDown()
		elif request.args["set"][0] == "mute":
			return setVolumeMute()
		elif request.args["set"][0][:3] == "set":
			try:
				return setVolume(int(request.args["set"][0][3:]))
			except Exception, e:
				res = getVolumeStatus()
				res["result"] = False
				res["message"] = _("Wrong parameter format 'set=%s'. Use set=set15 ") % request.args["set"][0]
				return rets
Beispiel #2
0
 def P_vol(self, request):
     if "set" not in request.args.keys(
     ) or request.args["set"][0] == "state":
         return getVolumeStatus()
     elif request.args["set"][0] == "up":
         return setVolumeUp()
     elif request.args["set"][0] == "down":
         return setVolumeDown()
     elif request.args["set"][0] == "mute":
         return setVolumeMute()
     elif request.args["set"][0][:3] == "set":
         try:
             return setVolume(int(request.args["set"][0][3:]))
         except Exception, e:
             res = getVolumeStatus()
             res["result"] = False
             res["message"] = _(
                 "Wrong parameter format 'set=%s'. Use set=set15 "
             ) % request.args["set"][0]
             return rets