refactor app registration with whisplay daemon
This commit is contained in:
@@ -117,17 +117,12 @@ class ChannelClient:
|
|||||||
|
|
||||||
def _init_whisplay(self):
|
def _init_whisplay(self):
|
||||||
self.whisplay_interface = WhisplayInterface()
|
self.whisplay_interface = WhisplayInterface()
|
||||||
self.whisplay_interface.create_board(
|
self.whisplay_interface.create_board()
|
||||||
app_id="lxst-client",
|
|
||||||
display_name="LXST Client",
|
|
||||||
icon="LC",
|
|
||||||
use_daemon_default_log=True,
|
|
||||||
)
|
|
||||||
self.whisplay_interface.board.set_backlight(70)
|
self.whisplay_interface.board.set_backlight(70)
|
||||||
if hasattr(self.whisplay_interface.board, "on_exit_request"):
|
if hasattr(self.whisplay_interface.board, "on_exit_request"):
|
||||||
self.board.on_exit_request(self._on_exit_request)
|
self.whisplay_interface.board.on_exit_request(self._on_exit_request)
|
||||||
if hasattr(self.whisplay_interface.board, "on_focus_revoked"):
|
if hasattr(self.whisplay_interface.board, "on_focus_revoked"):
|
||||||
self.board.on_focus_revoked(self._on_focus_revoked)
|
self.whisplay_interface.board.on_focus_revoked(self._on_focus_revoked)
|
||||||
self._load_fonts()
|
self._load_fonts()
|
||||||
self._setup_whisplay_audio()
|
self._setup_whisplay_audio()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
|
import os
|
||||||
import runtime.whisplay_client
|
import runtime.whisplay_client
|
||||||
|
|
||||||
|
|
||||||
@@ -56,12 +57,14 @@ class WhisplayInterface:
|
|||||||
|
|
||||||
# -- Attachment --
|
# -- Attachment --
|
||||||
|
|
||||||
def create_board(self,
|
def create_board(self):
|
||||||
app_id,
|
self.board = runtime.whisplay_client.create_whisplay_hardware(
|
||||||
display_name,
|
app_id=os.getenv("WHISPLAY_APP_ID", "whisplay-lxst-client"),
|
||||||
icon,
|
display_name="LXST Client",
|
||||||
use_daemon_default_log=True):
|
icon="L",
|
||||||
self.board = runtime.whisplay_client.create_whisplay_hardware(app_id=app_id, display_name=display_name, icon=icon, use_daemon_default_log=use_daemon_default_log)
|
exit_gesture="quad_press",
|
||||||
|
use_daemon_default_log=False,
|
||||||
|
)
|
||||||
self.board.on_button_press(self._on_button_press)
|
self.board.on_button_press(self._on_button_press)
|
||||||
self.board.on_button_release(self._on_button_release)
|
self.board.on_button_release(self._on_button_release)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user