Files

53 lines
1.2 KiB
Python

from app import PicoDashboardApp
from state.app_state import AppState
from comms.uart_client import UartClient
from comms.communication_service import CommunicationService
from hardware.display import Display
from hardware.buzzer import Buzzer
from ui.screen_manager import ScreenManager
from ui.touch_router import TouchRouter
from ui.renderers import DashboardRenderer
class NullUart:
def write(self, data):
pass
def any(self):
return False
def read(self):
return b""
def build_app():
state = AppState()
uart_client = UartClient(NullUart())
comms = CommunicationService(uart_client, state)
screens = ScreenManager()
display = Display()
buzzer = Buzzer()
touch_router = TouchRouter(screens)
dashboard_renderer = DashboardRenderer(display)
return PicoDashboardApp(
app_state=state,
communication_service=comms,
screen_manager=screens,
touch_router=touch_router,
display=display,
dashboard_renderer=dashboard_renderer,
buzzer=buzzer,
)
def main():
app = build_app()
app.tick()
return app
if __name__ == "__main__":
main()