Skip to content

Instantly share code, notes, and snippets.

@dlashua
Created November 14, 2019 11:39
Show Gist options
  • Save dlashua/0a893c73baa5997e62669a4b86c0e069 to your computer and use it in GitHub Desktop.
Save dlashua/0a893c73baa5997e62669a4b86c0e069 to your computer and use it in GitHub Desktop.
Example App Service
# Using Events
class OtherApp:
def initialize(self):
self.fire_event('spotify.start', volume=100)
# Using get_app()
class OtherApp:
def initialize(self):
self.get_app('start_spotify').start(volume=100)
# Using Events
class StartSpotify:
def initialize(self):
self.listen_event(self.start, event="spotify.start")
def start(self, event, event_data, kwargs):
volume = event_data.get('volume', 0)
self.spotify_thing(volume=volume)
# Using get_app()
class StartSpotify:
def initialize(self):
pass
def start(self, volume=0):
self.spotify_thing(volume=volume)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment