Repository navigation
0.1.0
Power Toggle Service
A simple service to toggle power state of a device.
Usage
Service is shipped as APT package, see release page to download latest package. How to configure and use service see manual.
Build
Here are all necessarey information for developers, to build and run service.
Prerequisites
Things you need to build package.
- Python
- Poetry
- build-essentials
Build APT package
Makefile has target to build an APT package. Virtual environment is created by exporting Poetry dependencies into a requirements.txt file. APT is build like so:
poetry self add poetry-plugin-export
make build-debAPT package can then be found in folder target. You can test installation using Docker, however SystemD (probably) won't work.
docker run -it --rm -v ./target:/app jrei/systemd-ubuntu:latest bash
apt update && apt install -y /app/power-toggle-switch_0.0.7_all.debYou can however test, if everything is installed to the right place. If you want to test service use the following command to trigger power off:
echo -n '{"state": "shutdown"}' | nc -4u -q1 vm.ip.address 5151