Skip to content

Commit

Permalink
config trigger for display refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
nkoexe committed Oct 7, 2024
1 parent 8cc94bc commit 29ebe79
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sostituzioni/control/configurazione.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,9 @@ def esegui_trigger(self):

if "display" in self.trigger:
# aggiorna il display fisico
from flask_socketio import emit

emit("reload", broadcast=True, namespace="/display")
self.trigger.remove("display")

if "seasonalthemes" in self.trigger:
Expand Down
1 change: 1 addition & 0 deletions sostituzioni/database/configurazione.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"titolo": "Tema",
"descrizione": "Scegli il tema di colori per l'interfaccia utente.",
"sezione": "sistema",
"trigger": "display",
"disabilitato": false,
"nascosto": false,
"tipo": "selezione",
Expand Down
4 changes: 4 additions & 0 deletions sostituzioni/view/static/scripts/display/displaysocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ socket.on("aggiornamento notizie", () => {

// ----------------

socket.on("reload", () => {
location.reload()
})

// vedi view/__init__.py
// socket.on('shutdown', () => {
// console.log('Shutting down')
Expand Down

0 comments on commit 29ebe79

Please sign in to comment.