no message

This commit is contained in:
mh
2026-01-20 09:29:17 +01:00
parent ce57b11224
commit bf79f30e76
+7 -5
View File
@@ -24,10 +24,13 @@ class PV_Forecast extends IPSModule
{ {
parent::ApplyChanges(); parent::ApplyChanges();
// HTML-SDK / Tile Visualization aktivieren
$this->SetVisualizationType(1);
$mins = max(1, (int)$this->ReadPropertyInteger("RefreshMinutes")); $mins = max(1, (int)$this->ReadPropertyInteger("RefreshMinutes"));
$this->SetTimerInterval("UpdateForecastTimer", $mins * 60 * 1000); $this->SetTimerInterval("UpdateForecastTimer", $mins * 60 * 1000);
// Hook registrieren (hier ist es zuverlässig) // Hook besser hier registrieren
$this->RegisterHook("/hook/solcastcompare"); $this->RegisterHook("/hook/solcastcompare");
} }
@@ -180,15 +183,14 @@ class PV_Forecast extends IPSModule
// -------- Visualisierung / Hook -------- // -------- Visualisierung / Hook --------
public function GetVisualization() public function GetVisualizationTile(): string
{ {
// Forecast ggf. initial laden, wenn noch nichts da // Forecast ggf. initial laden
if ($this->GetBuffer("ForecastRaw") === "") { if ($this->GetBuffer("ForecastRaw") === "") {
$this->UpdateForecast(); $this->UpdateForecast();
} }
$htmlPath = __DIR__ . "/module.html"; $html = file_get_contents(__DIR__ . "/module.html");
$html = file_get_contents($htmlPath);
// Platzhalter ersetzen // Platzhalter ersetzen
$html = str_replace("{{INSTANCE_ID}}", (string)$this->InstanceID, $html); $html = str_replace("{{INSTANCE_ID}}", (string)$this->InstanceID, $html);