import badge, ugfx

def setup():
    pass

def loop(c):
	return 0
  
def draw(y):
	return [9999999999, 0]
  
def draw_going_to_sleep(y):
	enabled = badge.nvs_get_u8("frubar","enable", 0)
	if enabled:
		name = badge.nvs_get_str("frubar", "name", "Frubar")
        
		ugfx.clear(ugfx.BLACK)
		ugfx.flush()
		ugfx.clear(ugfx.WHITE)
		ugfx.flush()
        
		badge.eink_png(10,10,'/lib/frubar/frubar.png')
        
		ugfx.string_box(20,17,296,38, name, "PermanentMarker36", ugfx.BLACK, ugfx.justifyCenter)
		ugfx.string_box(20,74,296,26, "Frubar", "Roboto_BlackItalic24", ugfx.BLACK, ugfx.justifyCenter)
		ugfx.flush(ugfx.LUT_FULL)
		ugfx.flush(ugfx.LUT_FULL)
		badge.eink_busy_wait()
	return [9999999999, 0]