Skip to content

Commit 2d788bb

Browse files
committed
add more logs for automation
1 parent 14bea00 commit 2d788bb

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

‎app/build.gradle.kts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
applicationId = "com.mg4.control"
1212
minSdk = 28
1313
targetSdk = 34
14-
versionCode = 16
15-
versionName = "2.6.4"
14+
versionCode = 17
15+
versionName = "2.6.5"
1616
}
1717

1818
// Signature avec la clé plateforme de la ROM (requise par sharedUserId=android.uid.system).

‎app/src/main/java/com/mg4/control/service/MG4ControlService.kt‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,14 +513,21 @@ class MG4ControlService : Service() {
513513
private fun tryTemperatureAutomation(onFallback: () -> Unit) {
514514
val ctx = applicationContext
515515
val cfg = AutomationSettings.read(ctx)
516-
if (!cfg.enabled) { onFallback(); return }
516+
// Sortie silencieuse = impossible de diagnostiquer à distance : on trace TOUJOURS
517+
// la config, y compris quand la feature est simplement désactivée.
518+
if (!cfg.enabled) {
519+
AppLogger.i(TAG, "Auto temp: DÉSACTIVÉE dans Réglages → fallback BT/défaut")
520+
onFallback(); return
521+
}
517522
val profile = cfg.profileId.takeIf { it.isNotEmpty() }?.let { ProfileManager(ctx).getById(it) }
518523

519524
MG4Hardware.whenKatman1Ready {
520525
val temp = MG4Hardware.getOutsideTempCelsius()
521526
val outcome = AutomationDecision.evaluate(cfg.enabled, temp, cfg.threshold, cfg.direction, profile != null)
527+
AppLogger.i(TAG, "Auto temp: config → dir=${cfg.direction} seuil=${cfg.threshold}°C " +
528+
"profil='${profile?.name ?: "AUCUN"}' auto=${cfg.autoExecute} | temp lue=${temp ?: "illisible"} → $outcome")
522529
if (outcome != AutomationDecision.Outcome.APPLY || profile == null || temp == null) {
523-
AppLogger.i(TAG, "Auto temp: non applicable (temp=$temp seuil=${cfg.threshold} profil=${profile?.name}) → fallback")
530+
AppLogger.i(TAG, "Auto temp: non applicable → fallback BT/défaut")
524531
onFallback(); return@whenKatman1Ready
525532
}
526533
if (cfg.autoExecute) {

0 commit comments

Comments
 (0)