Skip to content

Created a function to verify if we are connected to an EOS console#1

Draft
jasonappah wants to merge 3 commits intolightbord:masterfrom
jasonappah:master
Draft

Created a function to verify if we are connected to an EOS console#1
jasonappah wants to merge 3 commits intolightbord:masterfrom
jasonappah:master

Conversation

@jasonappah
Copy link

I created a function so it would be easier for the future addition of commands.

I added

def verifyConnection(self):
		if client_connected:
			pass
		else:
			raise ValueError("Not connected")

Now, instead of

	def go(self):
		if client_connected == True:
			client.send( OSCMessage("/eos/key/go") )
			return 1
		else:
			raise ValueError("Not connected")
			return 0

We can do

	def go(self):
		self.verifyConnection()
		client.send(OSCMessage("/eos/key/go"))
		return 1

I also reformatted the code. I made this a draft PR as I haven't been able to test with an actual console, although I have tested with Nomad. I will test with an ETC Ion after the winter break, and update the PR after I do that.

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

Successfully merging this pull request may close these issues.

1 participant