Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to obtain player power state #11

Open
TristanStanton opened this issue Sep 22, 2017 · 1 comment
Open

Unable to obtain player power state #11

TristanStanton opened this issue Sep 22, 2017 · 1 comment

Comments

@TristanStanton
Copy link

I was unable to identify a property for the player power state. Have managed to work around by adding the following into player.py:

@property
def power(self):
	"""
	Player power state.
	
	:getter: retrieve power state of player
	:rtype: bool
	:returns: True if on, False if off
	
	:setter: set power state of player on server(True = On)
	
	"""
	
	if self.parse_request("power ?", "_power") == "1":
		return True
	else:
		return False

@power.setter
def power(self, power):
	try:
		if power == True:
			self.request("power {}".format("1"))
		elif power == False:
			self.request("power {}".format("0"))
		self._power = power
	except:
		pass
@elParaguayo
Copy link
Owner

Thanks. You're welcome to fork the code and submit pull requests.

Unfortunately, I don't have much time at the moment to update the code myself but I'd happily merge pull requests.

elParaguayo added a commit that referenced this issue May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants