Skip to content

Instantly share code, notes, and snippets.

@blacklight
Created October 30, 2020 23:07
Show Gist options
  • Save blacklight/c369ebeee590a53be96ab80626946a55 to your computer and use it in GitHub Desktop.
Save blacklight/c369ebeee590a53be96ab80626946a55 to your computer and use it in GitHub Desktop.
Script that starts Pi Camera streaming on port 5001 when Platypush starts
from platypush.context import get_plugin
from platypush.event.hook import hook
from platypush.message.event.application import ApplicationStartedEvent
@hook(ApplicationStartedEvent)
def on_application_started(event, **_):
cam = get_plugin('camera.pi')
cam.start_streaming()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment