Skip to main content

Mute snapcast client playing on raspi3

Project description

Dark Mute

Dark Mute is python script that mutes snapcast client volume when it senses lights are off in the room.

It's written in Python 3 and requires a photoresistor-capacitor circuit connected to a Raspberry Pi running Snapcast.

Setup/Usage

As the pi user in its home directory:

  • python3 -m venv darkmute-venv
  • . darkmute-venv/bin/activate
  • sudo python3 -m pip install DarkMute
  • Test it: darkmute

Brightness thresholds are hard-coded for now, to change them see Developer Setup section.

To run this as a service, create a systemd service definition:

/etc/systemd/system/darkmute.service

[Unit]
Description=Dark Mute
After=snapclient.service

[Service]
ExecStart=/home/pi/darkmute-venv/bin/darkmute
Restart=Always
User=pi

[Install]
WantedBy=multi-user.target

Developer Setup

  • Clone this from gitlab
  • Create and activate Python 3 virtual env
  • pip install -e . to install dependencies
  • Build the circuit, connected to GPIO Pin 7
  • add user to gpio group /dev/gpiomem

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

DarkMute-0.1.8.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

DarkMute-0.1.8-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file DarkMute-0.1.8.tar.gz.

File metadata

  • Download URL: DarkMute-0.1.8.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.5.3

File hashes

Hashes for DarkMute-0.1.8.tar.gz
Algorithm Hash digest
SHA256 8864067ba37a0a26f6c78c9c901051e5a9a7f46eaa1b5881c2eef857cdf0c948
MD5 ffb30392ec5cf019ccb071ec1bd2a6d0
BLAKE2b-256 493b0abe56e884c9b9142787e32eb5909030c35cf71ad47880207b3ed6732bd7

See more details on using hashes here.

File details

Details for the file DarkMute-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: DarkMute-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.5.3

File hashes

Hashes for DarkMute-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6d36624e09021e180788ab73ecd10bc94af2ab46296bbf31a7445173c1a45594
MD5 29a7d3a54de9851c61de45d43be8af18
BLAKE2b-256 0d7b503bafaef6aebfd25c0da4eb7d8127173c0b98bfef971151a1ce00bb97f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page