Metadata-Version: 2.4
Name: qbee-gpio
Version: 4.3.1
Summary: Control a display and amplifier relay for use in an AirPlay and/or Spotify Connect Raspberry Pi server.
Author: Gabriel Pajot
Author-email: Gabriel Pajot <gab@lescactus.eu>
License-Expression: MIT
License-File: LICENSE
Requires-Dist: aiomqtt==2.5.1 ; python_full_version < '4'
Requires-Dist: asyncinotify==4.4.4
Requires-Dist: concurrent-tasks==1.18.0
Requires-Dist: gpiozero==2.0.1.post3
Requires-Dist: pydantic-settings[yaml]==2.16.1
Requires-Python: >=3.11, <3.15
Project-URL: repository, https://github.com/gpajot/qbee-gpio
Description-Content-Type: text/markdown

# qbee-gpio

[![tests](https://github.com/gpajot/qbee-gpio/actions/workflows/test.yml/badge.svg?branch=main&event=push)](https://github.com/gpajot/qbee-gpio/actions/workflows/test.yml?query=branch%3Amain+event%3Apush)
[![PyPI Version](https://img.shields.io/pypi/v/qbee_gpio)](https://pypi.org/project/qbee_gpio/)
[![Docker Image Version (tag)](https://img.shields.io/docker/v/gpajot/qbee-gpio/latest?label=DockerHub)](https://hub.docker.com/r/gpajot/qbee-gpio)

A docker image to control an LCD and amplifier relay for use in an AirPlay and/or Spotify Connect Raspberry Pi server.

* Detect sound output and turn on the amplifier power supply.
* Get the track information and display it on an LCD.
* Auto turn off amplifier power supply after set period of inactivity.

Additional documentation:

* [Setting up shairport-sync](./docs/shairport-sync.md)
* [Setting up librespot](./docs/librespot.md)
* [My hardware](./docs/hardware.md)

## Running

```shell
docker run -d \
  --name qbee \
  --restart always \
  --network host \
  -e LG_WD=/tmp \
  --device=/dev/gpiochip0 \
  -v ~/qbee:/app/config:ro \
  --user $(stat -c '%u:%g' ~) \
  --group-add $(stat -c '%g' /dev/gpiochip0) \
  gpajot/qbee-gpio:latest
```

This expects a config file located at `~/qbee/conf.yaml`. See [all config options](./qbee_gpio/config.py)

A typical config would look like:

```yaml
power:
  pin_on: 27
  pin_standby: 22
display:
  lcd:
    pins:
      data_4: 9
      data_5: 25
      data_6: 17
      data_7: 10
      enable: 24
      register_select: 23
```

### Metadata display

To enable reception of metadata:

```yaml
udp:
  host: "0.0.0.0"
```

to enable UDB metadata (librespot and/or shairport)

```yaml
mqtt:
  hostname: ...
```

to enable MQTT metadata (shairport)
