planning out api more

This commit is contained in:
2026-03-08 07:40:27 +11:00
parent 83c927d23a
commit 0a560dca17
4 changed files with 27 additions and 4 deletions

View File

@@ -0,0 +1,6 @@
from api.node import MeshNode
class Message:
def __init__(self, content: str, sender: MeshNode):
self.content = content
self.sender = sender

View File

@@ -1,12 +1,14 @@
from enum import Enum
from bleak import BLEDevice, BleakScanner, BleakClient
from bleak import BleakScanner, BleakClient
NODE_BLUETOOTH_SERVICE_UUID = "E1898FF7-5063-4441-a6eb-526073B00001"
NODE_BLUETOOTH_RX_UUID = "E1898FF7-5063-4441-a6eb-526073B00002"
NODE_BLUETOOTH_TX_UUID = "E1898FF7-5063-4441-a6eb-526073B00003"
class MeshNode:
def __init__(self, client: BleakClient):
self.client = client
self.client.pair()
async def discover():
"""Find a mesh node via Bluetooth

View File

@@ -1,5 +1,4 @@
from textual.app import App, ComposeResult
from textual.widgets import Header, Footer
from textual.app import App
from ui.screens.pair_screen import PairScreen
from api.node import MeshNode

View File

@@ -0,0 +1,16 @@
from textual.containers import Vertical, VerticalScroll, HorizontalGroup
from textual.widgets import Input, Button, Static
class Message(Static):
def __init__(self, message):
super().__init__()
class ChatWindow(Vertical):
def compose(self):
with VerticalScroll():
pass
with HorizontalGroup():
yield Input(placeholder="Send a message")
yield Button("", flat=True)