Skip to content

Commit decc763

Browse files
authored
Merge pull request #58 from TimUx/copilot/remove-diagnostics-and-text-warnings
Remove additional diagnostic procedures and relocate hint texts
2 parents c27023c + 3869190 commit decc763

File tree

3 files changed

+23
-105
lines changed

3 files changed

+23
-105
lines changed

app.py

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ def send_notification(title: str, message: str, action_type: str = "info", extra
150150
if not NOTIFY_ENABLED:
151151
return
152152

153-
# Debug logging
154-
logger.info(f"send_notification called: title='{title}', action_type='{action_type}'")
155-
logger.info(f" NOTIFY_NTFY_ENABLED={NOTIFY_NTFY_ENABLED}, NOTIFY_NTFY_TOPIC='{NOTIFY_NTFY_TOPIC}'")
156-
157153
timestamp = dt_datetime.now().isoformat()
158154
payload = {
159155
"title": title,
@@ -196,9 +192,6 @@ def send_notification(title: str, message: str, action_type: str = "info", extra
196192
if NOTIFY_NTFY_TOKEN:
197193
headers["Authorization"] = f"Bearer {NOTIFY_NTFY_TOKEN}"
198194

199-
# Debug logging
200-
logger.info(f"Sending to ntfy.sh: URL={url}, topic='{NOTIFY_NTFY_TOPIC}', title='{title}'")
201-
202195
# Send as JSON with proper UTF-8 encoding
203196
response = requests.post(
204197
url,
@@ -207,10 +200,7 @@ def send_notification(title: str, message: str, action_type: str = "info", extra
207200
timeout=5
208201
)
209202

210-
# Log response for debugging
211-
if response.status_code == 200:
212-
logger.info(f"ntfy.sh notification sent successfully to {url}")
213-
else:
203+
if response.status_code != 200:
214204
logger.error(f"ntfy.sh notification failed: HTTP {response.status_code} - {response.text}")
215205
except requests.exceptions.Timeout:
216206
logger.error(f"Failed to send ntfy notification: Timeout after 5 seconds")
@@ -1014,7 +1004,6 @@ def api_requests():
10141004
state["current_request"] = entry
10151005
except requests.RequestException as exc:
10161006
return jsonify({"ok": False, "message": str(exc)}), 502
1017-
mark_note(f"Wunsch '{title}' wurde hinzugefügt. Position {position}.")
10181007

10191008
return jsonify({"ok": True, "position": position, "message": f"Wunsch '{title}' wurde hinzugefügt."})
10201009

@@ -1025,19 +1014,6 @@ def health():
10251014

10261015

10271016
def boot_threads():
1028-
# Log notification configuration on worker startup
1029-
logger.info("=" * 60)
1030-
logger.info("FPP Web Control - Notification Configuration")
1031-
logger.info("=" * 60)
1032-
logger.info(f"NOTIFY_ENABLED: {NOTIFY_ENABLED}")
1033-
logger.info(f"NOTIFY_NTFY_ENABLED: {NOTIFY_NTFY_ENABLED}")
1034-
logger.info(f"NOTIFY_NTFY_TOPIC: {NOTIFY_NTFY_TOPIC}")
1035-
logger.info(f"NOTIFY_NTFY_URL: {NOTIFY_NTFY_URL}")
1036-
logger.info(f"NOTIFY_MQTT_ENABLED: {NOTIFY_MQTT_ENABLED}")
1037-
logger.info(f"NOTIFY_HOMEASSISTANT_ENABLED: {NOTIFY_HOMEASSISTANT_ENABLED}")
1038-
logger.info(f"NOTIFY_WEBHOOK_ENABLED: {NOTIFY_WEBHOOK_ENABLED}")
1039-
logger.info("=" * 60)
1040-
10411017
threading.Thread(target=status_worker, daemon=True).start()
10421018
threading.Thread(target=scheduler_worker, daemon=True).start()
10431019

diagnose-ntfy.sh

Lines changed: 0 additions & 75 deletions
This file was deleted.

index.html

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ <h1 id="headline"></h1>
3232
</div>
3333

3434
<div id="main-content" class="hidden">
35+
<p class="quiet-banner hidden" id="preview-banner"></p>
36+
<p class="quiet-banner hidden" id="show-running-banner"></p>
3537
<p class="quiet-banner hidden" id="quiet-banner"></p>
3638
<p class="quiet-banner hidden" id="outside-window-banner"></p>
3739
<div class="buttons">
@@ -74,6 +76,8 @@ <h3 class="social-footer-title">Unsere Kanäle:</h3>
7476
const btnKids = document.getElementById('btn-kids');
7577
const btnRequest = document.getElementById('btn-request');
7678
const btnDonate = document.getElementById('btn-donate');
79+
const previewBanner = document.getElementById('preview-banner');
80+
const showRunningBanner = document.getElementById('show-running-banner');
7781
const quietBanner = document.getElementById('quiet-banner');
7882
const outsideWindowBanner = document.getElementById('outside-window-banner');
7983
const statusBox = document.getElementById('status');
@@ -246,7 +250,8 @@ <h3 class="social-footer-title">Unsere Kanäle:</h3>
246250
markStatus('', 'Bereit (Vorschau).');
247251
setStatusDetails('player', 'Show 1', 'Jingle Bells');
248252
updateCountdown({ time: next.toISOString(), label: 'Show' });
249-
note.textContent = 'Dies ist eine Vorschau ohne Verbindung zum FPP.';
253+
previewBanner.textContent = 'Dies ist eine Vorschau ohne Verbindung zum FPP.';
254+
previewBanner.classList.remove('hidden');
250255
applyLocks({ disableAllButtons: false, disableShowButtons: false });
251256
renderQueue(queue[0], queue);
252257
}
@@ -271,14 +276,16 @@ <h3 class="social-footer-title">Unsere Kanäle:</h3>
271276

272277
markStatus(isRunning ? 'running' : '', isRunning ? 'Show läuft gerade.' : 'Bereit.');
273278
setStatusDetails(modeName, playlistLabel, currentSequence);
274-
note.textContent = data.note || '';
275279
updateCountdown(data.nextShow, data.scheduledShowsEnabled !== false);
276280

277281
const lockReason = applyLocks(data.locks);
278282
const isQuiet = Boolean(data.locks && data.locks.quiet);
279283
const isOutsideWindow = Boolean(data.locks && data.locks.outsideShowWindow);
280284
const showPeriod = data.locks && data.locks.showPeriod;
281285

286+
// Hide preview banner in normal mode
287+
previewBanner.classList.add('hidden');
288+
282289
if (isOutsideWindow && showPeriod) {
283290
const dateRange = showPeriod.startDate && showPeriod.endDate
284291
? `${showPeriod.startDate} - ${showPeriod.endDate}` : '';
@@ -300,19 +307,29 @@ <h3 class="social-footer-title">Unsere Kanäle:</h3>
300307
outsideWindowBanner.appendChild(line3);
301308
outsideWindowBanner.classList.remove('hidden');
302309
quietBanner.classList.add('hidden');
310+
showRunningBanner.classList.add('hidden');
311+
note.textContent = data.note || '';
303312
} else if (isQuiet && showPeriod) {
304313
quietBanner.textContent = `Ruhezeit ${showPeriod.endTime}${showPeriod.startTime} – keine Wiedergabe möglich.`;
305314
quietBanner.classList.remove('hidden');
306315
outsideWindowBanner.classList.add('hidden');
316+
showRunningBanner.classList.add('hidden');
317+
note.textContent = data.note || '';
318+
} else if (lockReason && !isQuiet && !isOutsideWindow) {
319+
// Show the lock reason in the banner instead of the note section
320+
showRunningBanner.textContent = lockReason;
321+
showRunningBanner.classList.remove('hidden');
322+
quietBanner.classList.add('hidden');
323+
outsideWindowBanner.classList.add('hidden');
324+
note.textContent = data.note || '';
307325
} else {
308326
quietBanner.classList.add('hidden');
309327
outsideWindowBanner.classList.add('hidden');
328+
showRunningBanner.classList.add('hidden');
329+
note.textContent = data.note || '';
310330
}
311331

312332
renderQueue(data.currentRequest, data.queue || []);
313-
if (!note.textContent && lockReason && !isQuiet && !isOutsideWindow) {
314-
note.textContent = lockReason;
315-
}
316333
} catch (err) {
317334
console.error('Statusfehler', err);
318335
markStatus('error', 'Status konnte nicht geladen werden.');

0 commit comments

Comments
 (0)