Phase 1 Complete: Preparation & Cleanup

Directory structure:
- Created src/sensorpajen/ for new Python package
- Created config/ for configuration templates
- Created legacy/ for old scripts
- Created systemd/ and debian/ for future phases

Package setup:
- Added pyproject.toml with modern Python packaging
- Created package __init__.py
- Defined dependencies: bluepy, paho-mqtt

Configuration:
- Created config/sensors.json.example (converted from INI)
- Created config/sensorpajen.env.example for environment variables
- All 8 Xiaomi sensors migrated to JSON format

Cleanup:
- Removed temperatur_koksfonstret.py (DHT11 functionality)
- Moved all legacy scripts to legacy/ folder:
  - LYWSD03MMC.py
  - bluetooth_utils.py
  - sendToMQTT.sh
  - sensorer.sh
  - startup.sh
  - sensorer.ini

Updated ROADMAP.md to mark Phase 1 as complete.

Next: Phase 2 - Python Package Structure
This commit is contained in:
2025-12-27 13:13:51 +01:00
parent 8cc2c41acf
commit 426f1d3813
12 changed files with 138 additions and 73 deletions

10
legacy/startup.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
tmux start-server
tmux new-session -d -s sensorer -n sensorer -d 'cd /home/pi/sensorpajen; ./LYWSD03MMC.py -a -wdt 5 --devicelistfile sensorer.ini --callback yes --battery'
tmux split-window -t sensorer:0 'cd /home/pi/pirate_audio; ./loop.sh'
tmux split-window -t sensorer:0 'cd /home/pi/pirate_audio; ./buttons.py'
tmux select-layout -t sensorer:0 tiled