From 0dde43a71f0494558a747159144ad5a5ad3dee00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=A4fliger?= Date: Wed, 5 Feb 2025 15:51:31 +0100 Subject: [PATCH] methoden mit zufriffsmodifizierer ausgestattet --- Boiler_2_Stufig_Landwirtschaft/module.php | 8 ++++---- library.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Boiler_2_Stufig_Landwirtschaft/module.php b/Boiler_2_Stufig_Landwirtschaft/module.php index 3e60b15..afbcd0e 100644 --- a/Boiler_2_Stufig_Landwirtschaft/module.php +++ b/Boiler_2_Stufig_Landwirtschaft/module.php @@ -81,7 +81,7 @@ class Boiler_2_Stufig_Landwirtschaft extends IPSModule } } - function getNextTimeAndTemperature($zeitplan) { + public function getNextTimeAndTemperature($zeitplan) { if (empty($zeitplan)) { return null; } @@ -95,7 +95,7 @@ class Boiler_2_Stufig_Landwirtschaft extends IPSModule return $zeitplan[0]; } - function calculateRemainingTime($nextTime) { + public function calculateRemainingTime($nextTime) { $currentTime = new DateTime(); $nextDateTime = DateTime::createFromFormat('H:i', $nextTime); if ($nextDateTime < $currentTime) { @@ -105,7 +105,7 @@ class Boiler_2_Stufig_Landwirtschaft extends IPSModule return $interval->h + ($interval->i / 60); } - function calculateRequiredHeat($boilervolumen, $tempDiff) { + public function calculateRequiredHeat($boilervolumen, $tempDiff) { // Annahme: spezifische Wärmekapazität von Wasser = 4.186 J/g°C // 1 Liter Wasser = 1000 Gramm $specificHeatCapacity = 4.186; // J/g°C @@ -113,7 +113,7 @@ class Boiler_2_Stufig_Landwirtschaft extends IPSModule return $specificHeatCapacity * $waterMass * $tempDiff; // Joules } - function canBoilerReachTemperature($boilervolumen, $boilerTemper, $nextTemp, $remainingTime, $vollleistung) { + public function canBoilerReachTemperature($boilervolumen, $boilerTemper, $nextTemp, $remainingTime, $vollleistung) { $tempDiff = $nextTemp - $boilerTemper; $requiredHeat = calculateRequiredHeat($boilervolumen, $tempDiff); $availableHeat = $vollleistung * $remainingTime * 3600; // Leistung in Watt * Zeit in Sekunden diff --git a/library.json b/library.json index dcd6064..d0ccf91 100644 --- a/library.json +++ b/library.json @@ -6,7 +6,7 @@ "compatibility": { "version": "7.1" }, - "version": "1.029", + "version": "1.030", "build": 0, "date": 0 } \ No newline at end of file