"""
HeatDebt - UNO Q Python app (MPU/Linux side, App Lab project)
Exposes the MCU's temperature reading over HTTP on port 7000, via the
WebUI brick, so the Pi 5 controller can poll it over the LAN.
"""

from arduino.app_utils import App, Bridge
from arduino.app_bricks.web_ui import WebUI


def get_temp():
    temp_c = Bridge.call("get_temp_c")  # no extra args - MCU function takes none
    return {"temp_c": temp_c}


ui = WebUI()
ui.expose_api("GET", "/temp", get_temp)

App.run()
