sw: Add shutdown screen

This commit is contained in:
Markus Koch 2020-08-08 19:33:03 +02:00
parent 66031c1389
commit 859c898d8a

View File

@ -200,7 +200,7 @@ class radioserv:
self.io_event.set() self.io_event.set()
async def mpd_main(self): async def mpd_main(self):
last_title = "" last_title = "Loading..."
last_state = "" last_state = ""
last_info = "" last_info = ""
play_icon_map = {"play" : "▶️", "pause" : "ll", "stop" : ""} play_icon_map = {"play" : "▶️", "pause" : "ll", "stop" : ""}
@ -220,7 +220,7 @@ class radioserv:
try: try:
title = currentsong['file']; title = currentsong['file'];
except: except:
title = "" title = " "
if (title != last_title): if (title != last_title):
self.disp_playback.update_text(title) self.disp_playback.update_text(title)
last_title = title last_title = title
@ -280,6 +280,12 @@ class radioserv:
await self.kill_event.wait() await self.kill_event.wait()
self.kill_event.clear() self.kill_event.clear()
# Show shutdown screen
self.disp_info.update_text("Shutting down", True);
self.disp_info.update_info(" ")
self.disp_mgr.set_display(self.disp_info)
await asyncio.sleep(0.1)
io_timer_task.cancel() io_timer_task.cancel()
io_task.cancel() io_task.cancel()
mpd_task.cancel() mpd_task.cancel()