From 08c6ed4457158cd55536ac22aeda72c8c2cb6008 Mon Sep 17 00:00:00 2001 From: Alessandro Date: Sat, 11 Jan 2025 01:57:18 +0100 Subject: [PATCH 1/2] update readme --- README.org | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.org b/README.org index d373cea..c438c11 100644 --- a/README.org +++ b/README.org @@ -14,7 +14,46 @@ This project uses the Spotify API to authenticate the user and pull live informa - Easy Config: all the parameters needed by the app running can be set in =config.yaml=, including the API polling rate interval, the display refresh interval, Spotify's app credential and the color scheme. The colors of all the UI components are exposed and controllable in this configuration file. ** Get Started: *** Hardware Requirements +This project is build for [[https://www.waveshare.com/wiki/2inch_LCD_Module][this]] specific screen, a 2" LCD SPi Display, compatible with different models of Raspberry Pi, this code is tested on a Pi 3b+ and a Pi 5. *** Software Requirements +This project uses python3.11 and assumes you have it already installed. +For development poetry is used to create a virtualenv and handle dependencies, ultimately the code must be run as =sudo= so the dependencies must be installed on the root python interpreter anyways, so the poetry virtualenv is for developement only. *** Install +To install, start by cloning this repo with +#+begin_src shell +git clone http://192.168.1.244:8080/barry/spotiplayer-pi.git +cd spotiplayer-pi +#+end_src +Then make sure you have poetry installed, to install on the Pi run: =curl -sSL https://install.python-poetry.org | python3 -= +#+begin_src shell +poetry env use python3.11 +poetry install +poetry shell +#+end_src +to activate the virtualenv every time use =poetry shell=. +Now we need to install all the dependencies on the root python interpreter to run the script as the display GPiO connection needs privileges to be established. +To do that we do: +#+begin_src shell +sudo pip3 install requirements.txt +#+end_src *** Run +To run the script there are two options, either from a CLI, with: +#+begin_src shell +sudo python -m spotiplayer_pi.main +#+end_src +or as a systemd service, which guarantees that the script will be restarted if it fails, to activate it do: +#+begin_src shell +# TODO +#+end_src +*** Develop +To contribute to the developement you will find some dev tools already implemented, to use them first install the extra dependencies with: +#+begin_src shell +poetry install --with dev +#+end_src +Now you have access to pre-commit with the following hooks: +- *ruff*: format and lint .py files +- *tests*: run all tests in =tests/= +- *requirements*: checks if the output of =poetry export= matches =requirements.txt= +Only if all checks pass it is possible to make a commit ** Code Philosophy / Style +# TODO From 3c2b79115cc8975699d910677201e1f4bea50099 Mon Sep 17 00:00:00 2001 From: Alessandro Date: Sat, 11 Jan 2025 02:00:12 +0100 Subject: [PATCH 2/2] update readme --- README.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.org b/README.org index c438c11..929522b 100644 --- a/README.org +++ b/README.org @@ -45,6 +45,8 @@ or as a systemd service, which guarantees that the script will be restarted if i #+begin_src shell # TODO #+end_src +*** Configure +To configure the app's settings go to =spotiplayer_pi/config.yaml=, it contains all user modifiable settings, there you can set the progress bar refresh rate, the API polling rate and the color scheme of the play screen. *** Develop To contribute to the developement you will find some dev tools already implemented, to use them first install the extra dependencies with: #+begin_src shell