Last active
January 10, 2018 19:05
-
-
Save bazwilliams/ec10fea509b3182420237244ff0ea52a to your computer and use it in GitHub Desktop.
Pass This Parcel in a Docker! This plays music on a Linn device for a random period of time between 8 and 18 seconds. When running the Docker, set the environment variable `DEVICE_URI` to the URL of the device description of the player you want to control, e.g. http://192.168.1.122:55178/4c494e4e-0026-0f21-fd5a-01387403013f/Upnp/device.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3 | |
RUN pip3 install openhomedevice | |
COPY main.py /app/ | |
ENTRYPOINT python3 /app/main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openhomedevice.Device import Device | |
from random import randint | |
import time | |
import os | |
device = Device(os.environ['DEVICE_URI']) | |
device.Play() | |
time.sleep(randint(8,18)) | |
device.Pause() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment