car_ui/build_info.py
2026-01-09 00:50:52 +03:00

18 lines
482 B
Python

APP_NAME = "Car UI"
VERSION = "0.1.0-dev"
BUILD_DATE = "dev"
GIT_HASH = "dev"
DEVICE_MODEL = "Raspberry Pi"
def get_device_model() -> str:
for path in ("/proc/device-tree/model", "/sys/firmware/devicetree/base/model"):
try:
with open(path, "rb") as f:
raw = f.read().strip(b"\x00").strip()
if raw:
return raw.decode("utf-8", errors="replace")
except OSError:
continue
return DEVICE_MODEL