Skip to content

Instantly share code, notes, and snippets.

@ColdGrub1384
Created October 21, 2020 13:09
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ColdGrub1384/3b1ebec7c42d538faec3bb57f4d7627b to your computer and use it in GitHub Desktop.
Save ColdGrub1384/3b1ebec7c42d538faec3bb57f4d7627b to your computer and use it in GitHub Desktop.
Pyto Apple Watch Complication
"""
A watchOS complication for Pyto showing the current minute of the hour.
The script must be selected in Settings -> Apple Watch Script.
After running the script,
the complication named 'Minutes' should appear in the Watch Face customizer.
"""
import widgets as wd
import watch as wt
import datetime as dt
class MinutesProvider(wt.ComplicationsProvider):
def name(self):
return "Minutes"
def timeline(self, after_date, limit):
dates = []
for i in range(limit):
delta = dt.timedelta(minutes=i*1)
date = after_date + delta
date = date.replace(second=0)
dates.append(date)
return dates
def complication(self, date):
min = date.time().minute
text = wd.Text(str(min), font=wd.Font.bold_system_font_of_size(20))
complication = wt.Complication()
complication.circular.add_row([text])
return complication
wt.add_complications_provider(MinutesProvider())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment