import easywifi
import easyrtc
import deepsleep
import ugfx
import badge
import time

FONT = "Roboto_Black22"

def time_str(localtime):
    hours = localtime[3]
    minutes = localtime[4]
    formatstr = ' '
    return formatstr.format(hours + ":" + minutes)

easywifi.enable()
easyrtc.configure()
ugfx.clear(ugfx.WHITE)
ugfx.flush()

msg = time_str(time.localtime())
ugfx.string(10,50,msg,FONT,ugfx.BLACK)
ugfx.flush()

# wordclock
#badge.nvs_set_str('boot', 'splash', 'wordclock') # Admin note: yes, but no. Put in a way to return to the normal splashscreen as well please :-)

badge.eink_busy_wait()
deepsleep.start_sleeping(60000)