Skip to content

Commit 3e5dfe9

Browse files
committed
Update v4.0.20260309
1 parent 10486a8 commit 3e5dfe9

5 files changed

Lines changed: 57 additions & 43 deletions

File tree

Pollination/locale.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"October": "Oktober",
6868
"November": "November",
6969
"December": "Dezember",
70-
"No Pollen": "Kein Pollen",
70+
"No Pollen": "Keine Pollen",
7171
"Very Low": "Sehr niedrig",
7272
"Low": "Niedrig",
7373
"Moderate": "Mäßig",

Pollination/module.html

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@
111111
text-transform: uppercase;
112112
gap: 4px;
113113
background: color-mix(in srgb, var(--accent-color) 10%, transparent);
114-
padding: 10px;
115-
border-radius: 8px;
114+
padding: 4px;
115+
border-radius: 5px;
116116
transition: all 0.3s ease;
117117
margin: 4px;
118118
}
@@ -143,9 +143,9 @@
143143
text-align: center;
144144
color: var(--accent-color);
145145
text-transform: uppercase;
146-
gap: 10px;
146+
gap: 4px;
147147
background: color-mix(in srgb, var(--accent-color) 10%, transparent);
148-
padding: 10px;
148+
padding: 4px;
149149
border-radius: 8px;
150150
transition: all 0.3s ease;
151151
margin: 4px;
@@ -156,11 +156,11 @@
156156
flex-direction: column;
157157
align-items: center;
158158
justify-content: center;
159-
gap: 10px;
159+
gap: 4px;
160160
transition: all 0.3s ease;
161161
background: color-mix(in srgb, var(--content-color) 3%, transparent);
162-
padding: 8px;
163-
border-radius: 8px;
162+
padding: 4px;
163+
border-radius: 5px;
164164
transition: all 0.3s ease;
165165
margin: 4px;
166166
}
@@ -198,17 +198,17 @@
198198
text-align: center;
199199
color: var(--accent-color);
200200
text-transform: uppercase;
201-
gap: 10px;
201+
gap: 4px;
202202
background: color-mix(in srgb, var(--accent-color) 10%, transparent);
203-
padding: 10px;
204-
border-radius: 8px;
203+
padding: 4px;
204+
border-radius: 5px;
205205
transition: all 0.3s ease;
206206
margin: 4px;
207207
}
208208

209209
.forecast-grid.horizontal .pollen-label-header .pollen-icon {
210-
width: 48px;
211-
height: 48px;
210+
width: 42px;
211+
height: 42px;
212212
}
213213

214214
.forecast-grid.horizontal .day-row {
@@ -242,8 +242,8 @@
242242
color: var(--accent-color);
243243
background: color-mix(in srgb, var(--accent-color) 10%, transparent);
244244
text-transform: uppercase;
245-
padding: 10px;
246-
border-radius: 8px;
245+
padding: 4%;
246+
border-radius: 5px;
247247
transition: all 0.3s ease;
248248
margin: 4px;
249249
}
@@ -258,10 +258,10 @@
258258
flex-direction: column;
259259
align-items: center;
260260
justify-content: center;
261-
gap: 10px;
261+
gap: 4px;
262262
background: color-mix(in srgb, var(--content-color) 3%, transparent);
263-
padding: 10px;
264-
border-radius: 8px;
263+
padding: 4px;
264+
border-radius: 5px;
265265
transition: all 0.3s ease;
266266
margin: 4px;
267267
}
@@ -273,8 +273,8 @@
273273
}
274274

275275
.pollen-icon {
276-
width: 48px;
277-
height: 48px;
276+
width: 42px;
277+
height: 42px;
278278
}
279279

280280
.pollen-indicator {
@@ -440,23 +440,22 @@
440440
date.setDate(date.getDate() + index);
441441

442442
const today = new Date();
443-
today.setHours(0, 0, 0, 0); // heutige Mitternacht
443+
today.setHours(0, 0, 0, 0);
444+
444445
const targetDate = new Date(date);
445-
targetDate.setHours(0, 0, 0, 0); // Mitternacht des Zieltags
446+
targetDate.setHours(0, 0, 0, 0);
446447

447-
// Prüfen, ob es heute ist
448-
const isToday = today.getTime() === targetDate.getTime();
448+
const diffDays = Math.round((targetDate - today) / 86400000);
449449

450-
// Label bestimmen
451450
let label;
452-
if (isToday) {
451+
452+
if (diffDays === 0) {
453453
label = translate('Today');
454-
} else if (index === 1) {
454+
} else if (diffDays === 1) {
455455
label = translate('Tomorrow');
456-
} else if (index === 2) {
456+
} else if (diffDays === 2) {
457457
label = translate('In 2 days');
458458
} else {
459-
// Andernfalls Wochentag
460459
label = translate(date.toLocaleDateString('en-US', { weekday: 'long' }));
461460
}
462461

@@ -557,7 +556,7 @@
557556
const mapping = pollenNameMapping[pollenKey];
558557
const icon = mapping ? pollenIcons[mapping.icon] : '';
559558
const displayName = mapping ? mapping.displayName : pollenKey;
560-
console.log('Pollen Icon:', pollenKey, '->', displayName);
559+
//console.log('Pollen Icon:', pollenKey, '->', displayName);
561560

562561
const label = document.createElement('div');
563562
label.className = 'pollen-label';

Pollination/module.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ class PollenCount extends IPSModuleStrict
5757
'ShowRye' => 'Roggen',
5858
];
5959

60+
/**
61+
* @var array<int,string> Scale (Belastungsskala)
62+
*/
63+
private const SCALE = [
64+
0 => 'keine', 1 => 'keine bis gering', 2 => 'gering', 3 => 'gering bis mittel', 4 => 'mittel', 5 => 'mittel bis hoch', 6 => 'hoch'
65+
];
66+
6067
/**
6168
* @var array<string|int,int> Level (Scale to Level)
6269
*/
@@ -450,6 +457,8 @@ public function IndexInfo(): string
450457
} else {
451458
$this->LogMessage($this->Translate('Error reading the next update!'), KL_WARNING);
452459
}
460+
// Legende
461+
$index['legend'] = self::SCALE;
453462
// Collect index data
454463
$state = $this->GetValue('State');
455464
$region = $this->GetValue('Region');
@@ -521,7 +530,7 @@ private function GetFullUpdateMessage(): string
521530
} else {
522531
$this->LogDebug(__FUNCTION__, 'No index data available');
523532
}
524-
533+
$this->LogDebug(__FUNCTION__, $result);
525534
return json_encode($result);
526535
}
527536

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Version](https://img.shields.io/badge/Symcon-PHP--Modul-red.svg?style=flat-square)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/)
44
[![Product](https://img.shields.io/badge/Symcon%20Version-6.4-blue.svg?style=flat-square)](https://www.symcon.de/produkt/)
5-
[![Version](https://img.shields.io/badge/Modul%20Version-4.0.20260208-orange.svg?style=flat-square)](https://github.com/Wilkware/Pollination)
5+
[![Version](https://img.shields.io/badge/Modul%20Version-4.0.20260309-orange.svg?style=flat-square)](https://github.com/Wilkware/Pollination)
66
[![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg?style=flat-square)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
77
[![Actions](https://img.shields.io/github/actions/workflow/status/wilkware/Pollination/ci.yml?branch=main&label=CI&style=flat-square)](https://github.com/Wilkware/Pollination/actions)
88

@@ -29,7 +29,7 @@ Dieses Modul ruft den Pollenflug-Gefahrenindex von DWD ab und stellt ihn textuel
2929
* Auswahl der darzustellenden Tage (max. 3 Tage)
3030
* Auswahl der darzustellenden Gefahren/Pollenarten
3131
* Meldungen an Visualisierung und/oder Meldungsdashboard ab einen bestimmten Gefahrenlevel
32-
* Möglichleit der Medieneinbindung von Pollenflugkalender(n) (www.pollenstuftung.de)
32+
* Möglichleit der Medieneinbindung von Pollenflugkalender(n) (www.pollenstiftung.de)
3333
* Tägliche Aktualisierung der Daten (siehe Einrichten der Instanz)
3434

3535
Der Pollen-Gefahrenindex kann auch über die Methode [POLLEN_IndexInfo](#7-php-befehlsreferenz) als JSON abgerufen werden.
@@ -139,21 +139,27 @@ __Beispiel__: `POLLEN_IndexInfo(12345);`
139139
> {
140140
> "index": { "Roggen": [1,1,0], "Graeser": [1,1,0], "Beifuss": [1,1,0], "Ambrosia": [1,1,0], "Hasel": [6,7,0], "Esche": [1,1,0], "Erle": [7,7,0],"Birke": [1,1,0]},
141141
> "legend": {
142-
> "#7": "hoch",
143-
> "#6": "mittel bis hoch",
144-
> "#5": "mittel",
145-
> "#4": "gering bis mittel",
146-
> "#3": "gering",
147-
> "#2": "keine bis gering",
148-
> "#1": "keine",
149-
> "#0": "nicht bekannt"
142+
> 6: "hoch",
143+
> 5": "mittel bis hoch",
144+
> 4: "mittel",
145+
> 3: "gering bis mittel",
146+
> 2: "gering",
147+
> 1: "keine bis gering",
148+
> 0: "keine",
150149
> },
151150
> "next": 1614506400,
152151
> "last": 1614420000
153152
> }
154153
155154
### 8. Versionshistorie
156155

156+
v4.0.20260309
157+
158+
* _FIX_: HTML optimiert (weniger Platzbedarf)
159+
* _FIX_: Fehler in Tageslabel gefixt
160+
* _FIX_: Legende wird wieder mit ausgeliefert (neues Format)
161+
* _FIX_: Rechtschreibfehler korriegiert
162+
157163
v4.0.20260208
158164

159165
* _NEU_: Umstellung auf IPSModuleStrict

library.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"version": "8.1"
88
},
99
"version": "4.0",
10-
"build": 20260208,
11-
"date": 1770552000
10+
"build": 20260309,
11+
"date": 1773057600
1212
}

0 commit comments

Comments
 (0)