diff --git a/README.md b/README.md index 4ca9615ecc0ef17974339286b1f3e0b13cfb5ab4..c080d3746b6609eb10af19b72e9f337f3d3424d2 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,11 @@ connected to a Raspberry Pi running Snapcast. # Setup/Usage -* `sudo pip install DarkMute` -* `darkmute.py` +As the `pi` user in its home directory: + +* `python3 -m venv darkmute-venv` +* `. darkmute-venv/bin/activate` +* `sudo python3 -m pip install DarkMute` To run this as a service, create a systemd service definition. Instructions pending. diff --git a/darkmute/__init__.py b/darkmute/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b17cb34e5032866bf9cd8219c05ee74e8232fce2 --- /dev/null +++ b/darkmute/__init__.py @@ -0,0 +1 @@ +from .dark_mute import dark_mute diff --git a/darkmute/__main__.py b/darkmute/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..e2050df0e40519a2892f761a65112eb088ba6e6d --- /dev/null +++ b/darkmute/__main__.py @@ -0,0 +1,4 @@ +from .dark_mute import dark_mute + +if __name__ == "__main__": + dark_mute() diff --git a/darkmute.py b/darkmute/dark_mute.py similarity index 97% rename from darkmute.py rename to darkmute/dark_mute.py index dbd9c3dbc0b3b065dd344e32e5f297849022b833..d51369ad6151d0698a30fb7533f6f96bc6b96e47 100644 --- a/darkmute.py +++ b/darkmute/dark_mute.py @@ -2,7 +2,7 @@ import asyncio import logging import time import RPi.GPIO as GPIO -from snap import get_snapcast_client +from .snap import get_snapcast_client SENSOR_PIN = 7 diff --git a/snap.py b/darkmute/snap.py similarity index 100% rename from snap.py rename to darkmute/snap.py diff --git a/setup.py b/setup.py index 356567885163b03a6dc95f32f6182752c1e9554a..8cdcc990f150584c82100b6a2397b0bd99250518 100644 --- a/setup.py +++ b/setup.py @@ -5,17 +5,20 @@ with open("README.md", "r") as fh: setup( name="DarkMute", - version="0.1", + version="0.1.7", author="Jessica Ward", description="Mute snapcast client playing on raspi3", long_description=long_description, long_description_content_type="text/markdown", url="https://git.xhost.io/jess/Dark-Mute", packages=find_packages(), - scripts=['darkmute.py'], + entry_points={ + 'console_scripts': ['darkmute = darkmute:dark_mute'], + }, install_requires=[ "RPi.GPIO==0.6.3", - "snapcast==2.0.8" + "snapcast==2.0.8", + "zeroconf==0.20.0" ], classifiers=[ "License :: OSI Approved :: MIT License",