def render(d): ltime = utime.localtime() years = ltime[0] months = ltime[1] days = ltime[2] hours = ltime[3] mins = ltime[4] secs = ltime[5] d.clear() if MODE == CHANGE_YEAR: renderNum(d, years // 100, 1) renderNum(d, years % 100, 13) elif MODE == CHANGE_MONTH: renderNum(d, months, 13) elif MODE == CHANGE_DAY: renderNum(d, days, 13) else: renderNum(d, hours, 1) renderNum(d, mins, 13) if MODE not in (CHANGE_YEAR, CHANGE_MONTH, CHANGE_DAY) and secs % 2 == 0: renderColon(d) renderText(d, NAME, None) renderBar(d, secs) d.update()
def modTime(yrs, mth, day, hrs, mns, sec): ltime = utime.localtime() new = utime.mktime(( ltime[0] + yrs, ltime[1] + mth, ltime[2] + day, ltime[3] + hrs, ltime[4] + mns, ltime[5] + sec, None, None, )) utime.set_time(new)
def render(d): ltime = utime.localtime() years = ltime[0] months = ltime[1] days = ltime[2] secs = ltime[5] d.clear(col=conf.bgcolor) theme.renderTime(d, ltime, MODE, conf.fgcolor) if SUBMODE == DATE and MODE == DISPLAY: renderText(d, '{}-{:02}-{:02}'.format(years, months, days), None) else: renderText(d, NAME, None) battery.render_battery(d) d.update()