no message

This commit is contained in:
mh
2026-01-21 07:36:23 +01:00
parent 3be124e81f
commit 63912b3606
2 changed files with 16 additions and 1 deletions
+1
View File
@@ -1,5 +1,6 @@
{
"elements": [
{ "type": "ValidationTextBox", "name": "kunde", "caption": "Kundenname" },
{ "type": "ValidationTextBox", "name": "URL", "caption": "Solcast URL" },
{ "type": "SelectVariable", "name": "ActualVariableID", "caption": "Ist-Produktion Variable (Leistung)" },
{ "type": "CheckBox", "name": "ActualIsWatt", "caption": "Istwerte sind in Watt (in kW umrechnen)" },
+15 -1
View File
@@ -11,6 +11,7 @@ class PV_Forecast_plotmemory extends IPSModule
// Core
$this->RegisterPropertyString("URL", "");
$this->RegisterPropertyString("kunde", "");
$this->RegisterPropertyInteger("ActualVariableID", 0);
$this->RegisterPropertyBoolean("ActualIsWatt", true);
@@ -553,9 +554,22 @@ class PV_Forecast_plotmemory extends IPSModule
echo "No snapshots found";
return;
}
$kunde = trim($this->ReadPropertyString("kunde"));
$kunde = trim($this->ReadPropertyString("kunde"));
if ($kunde === "") {
$kunde = "unbekannt";
}
// Sonderzeichen entfernen (für Dateinamen!)
$kundeSafe = preg_replace('/[^a-zA-Z0-9_-]/', '_', $kunde);
header("Content-Type: application/zip");
header('Content-Disposition: attachment; filename="pv_plots_' . $this->InstanceID . '_' . $days . 'days.zip"');
header(
'Content-Disposition: attachment; filename="pv_plots_' .
$kundeSafe . '_' .
$this->InstanceID . '_' .
$days . 'days.zip"'
);
header("Content-Length: " . filesize($zipPath));
readfile($zipPath);