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:
14
config/sensorpajen.env.example
Normal file
14
config/sensorpajen.env.example
Normal file
@@ -0,0 +1,14 @@
|
||||
# MQTT Configuration
|
||||
MQTT_HOST=192.168.0.114
|
||||
MQTT_PORT=1883
|
||||
MQTT_USER=hasse
|
||||
MQTT_PASSWORD=casablanca
|
||||
MQTT_CLIENT_ID=mibridge
|
||||
|
||||
# Sensor Configuration (relative to project root)
|
||||
SENSOR_CONFIG_FILE=config/sensors.json
|
||||
|
||||
# Application Settings
|
||||
WATCHDOG_TIMEOUT=5
|
||||
ENABLE_BATTERY=true
|
||||
LOG_LEVEL=INFO
|
||||
37
config/sensors.json.example
Normal file
37
config/sensors.json.example
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"sensors": [
|
||||
{
|
||||
"mac": "A4:C1:38:98:7B:B6",
|
||||
"name": "mi_temp_1",
|
||||
"comment": "Example sensor - replace with your sensors"
|
||||
},
|
||||
{
|
||||
"mac": "A4:C1:38:29:03:0D",
|
||||
"name": "mi_temp_2"
|
||||
},
|
||||
{
|
||||
"mac": "A4:C1:38:62:CA:83",
|
||||
"name": "mi_temp_3"
|
||||
},
|
||||
{
|
||||
"mac": "A4:C1:38:D5:EA:63",
|
||||
"name": "mi_temp_4"
|
||||
},
|
||||
{
|
||||
"mac": "A4:C1:38:7C:9C:63",
|
||||
"name": "mi_temp_5"
|
||||
},
|
||||
{
|
||||
"mac": "A4:C1:38:68:2C:DA",
|
||||
"name": "mi_temp_6"
|
||||
},
|
||||
{
|
||||
"mac": "A4:C1:38:AD:74:2B",
|
||||
"name": "mi_temp_7"
|
||||
},
|
||||
{
|
||||
"mac": "A4:C1:38:46:9F:D1",
|
||||
"name": "mi_temp_8"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user