diff --git a/composants/byPanda/porterfid.py b/composants/byPanda/porterfid.py index 48362ab..e8b6c2a 100644 --- a/composants/byPanda/porterfid.py +++ b/composants/byPanda/porterfid.py @@ -54,15 +54,11 @@ class SystemePorteRFID: GPIO.output(self.pinLed, GPIO.LOW) def traiterBadge(self, badgeId): - """Envoie le numéro du badge à Flask pour vérification dans MariaDB.""" print(f"Badge détecté : {badgeId}") - try: - # Vérifie bien que l'URL correspond à ta route Flask (avec ou sans /api) + url = "https://127.0.0.1/rfid-scan" donnees = {"badge_id": str(badgeId)} - - # verify=False est nécessaire car le serveur local utilise un certificat auto-signé reponse = requests.post(url, json=donnees, timeout=2, verify=False) data = reponse.json() diff --git a/fastapi/main.py b/fastapi/main.py index 69bd891..2620f94 100644 --- a/fastapi/main.py +++ b/fastapi/main.py @@ -16,7 +16,7 @@ from thermostat import SystemeThermostat from etatsystemes import EtatSysteme from septsegments import afficher_temperature -app = FastAPI(title="Loustiques API - Pi 2") +app = FastAPI(title="L'API des loustiques") controleur_lumieres = SystemeLumieres() controleur_thermostat = SystemeThermostat() diff --git a/flask/main.sh b/flask/main.sh index 7d00783..e396ac4 100755 --- a/flask/main.sh +++ b/flask/main.sh @@ -102,7 +102,6 @@ VENV_LIST=() for dir in "${SEARCH_DIRS[@]}"; do if [ -d "$dir" ]; then - # Un venv valide contient bin/activate et bin/python while IFS= read -r -d '' activate_path; do venv_dir=$(dirname "$(dirname "$activate_path")") if [ -f "$venv_dir/bin/python" ]; then diff --git a/flask/run_flask.sh b/flask/run_flask.sh index 5711f1d..62b9290 100755 --- a/flask/run_flask.sh +++ b/flask/run_flask.sh @@ -50,7 +50,7 @@ bash web_secu/ssl.sh cat << 'EOF' ============================= -Vérification du daemin Avahi +Vérification du daemon Avahi ============================ EOF bash web_secu/avahi.sh diff --git a/flask/templates/admin.html b/flask/templates/admin.html index 2d061c6..2e9af04 100644 --- a/flask/templates/admin.html +++ b/flask/templates/admin.html @@ -236,7 +236,7 @@ diff --git a/flask/templates/dashboard.html b/flask/templates/dashboard.html index 483b9e5..4dccdc9 100644 --- a/flask/templates/dashboard.html +++ b/flask/templates/dashboard.html @@ -235,17 +235,32 @@ Heure locale --:-- -- + + + Température + -- + + + + Porte + -- - Raspberry Pi - Actif + Raspberry Pi 1 (actuelle) + Actif Flask 3.1 + + + Raspberry Pi 2 distant + Actif + FastAPi + Session - Authentifiée + Authentifiée Accès autorisé @@ -259,25 +274,13 @@ › - 💡 Alarme - Contrôler la alarme - › - - - 💡 Board1 - Contrôler la board1 - › - - - ⚙️ Paramètres - Configuration système - › - - - 📡 Réseau - État de la connexion - › - + Alarme + Armer l'alarme + › + + Alarme + Désarmer l'alarme + › Administration Administrer les loustiques diff --git a/flask/templates/index.html b/flask/templates/index.html index 5edc540..54a314b 100644 --- a/flask/templates/index.html +++ b/flask/templates/index.html @@ -129,7 +129,7 @@ Mot de passe - + Se connecter @@ -140,14 +140,14 @@