From d79980d513b01435b228527ca20646f248a16db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=A4fliger?= Date: Fri, 7 Mar 2025 14:15:26 +0100 Subject: [PATCH] min wert angepasst --- Manager/module.php | 6 ++++-- library.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Manager/module.php b/Manager/module.php index 1c036f5..a02027c 100644 --- a/Manager/module.php +++ b/Manager/module.php @@ -224,8 +224,10 @@ class Manager extends IPSModule IPS_LogMessage("Manager", print_r($samePriorityUsers)); $userEnergyProv = []; - $userEnergyProv = array_fill_keys(array_column($samePriorityUsers, "InstanceID"), 0); // Initialisierung für jeden Benutzer auf 0 setzen - IPS_LogMessage("Manager", print_r($userEnergyProv)); + $userEnergyProv = array_combine( + array_column($samePriorityUsers, "InstanceID"), + array_map(fn($user) => min($user['powersteps']), $samePriorityUsers) + ); IPS_LogMessage("Manager", print_r($userEnergyProv)); // Alle Schritte der Benutzer in einem Array sammeln $allSteps = []; diff --git a/library.json b/library.json index 3cc328a..f2a9cc5 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "compatibility": { "version": "7.1" }, - "version": "1.241", + "version": "1.242", "build": 0, "date": 0 } \ No newline at end of file