Skip to main content

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

Metadata

Release files for DarkMute 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DarkMute 0.1.8
File Size Uploaded
DarkMute-0.1.8.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for DarkMute 0.1.8
File Interpreter ABI Platform
DarkMute-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 kB

Release files / DarkMute-0.1.8.tar.gz

Download URL DarkMute-0.1.8.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8864067ba37a0a26f6c78c9c901051e5a9a7f46eaa1b5881c2eef857cdf0c948
BLAKE2b-256 checksum
How to use checksums
493b0abe56e884c9b9142787e32eb5909030c35cf71ad47880207b3ed6732bd7
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / DarkMute-0.1.8-py3-none-any.whl

Download URL DarkMute-0.1.8-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d36624e09021e180788ab73ecd10bc94af2ab46296bbf31a7445173c1a45594
BLAKE2b-256 checksum
How to use checksums
0d7b503bafaef6aebfd25c0da4eb7d8127173c0b98bfef971151a1ce00bb97f0
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page