Commit c7494640 authored by Danilo's avatar Danilo Committed by schneider
Browse files

ble.py: Show MAC suffix

parent ec611574
......@@ -4,6 +4,7 @@ import utime
import buttons
CONFIG_NAME = "ble.txt"
MAC_NAME = "mac.txt"
ACTIVE_STRING = "active=true"
INACTIVE_STRING = "active=false"
......@@ -14,6 +15,12 @@ def init():
f.write(INACTIVE_STRING)
def load_mac():
if MAC_NAME in os.listdir("."):
with open(MAC_NAME) as f:
return f.read().strip()
def triangle(disp, x, y, left):
yf = 1 if left else -1
scale = 6
......@@ -48,6 +55,9 @@ def headline():
disp.print("BLE", posy=0, fg=[0, 255, 255])
if is_active():
disp.print("active", posy=20, fg=[0, 255, 255])
mac = load_mac()
if mac is not None:
disp.print(mac[9:], posy=60, fg=[0, 0, 255])
else:
disp.print("inactive", posy=20, fg=[0, 255, 255])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment