class watch.Complication

The configuration of a Watch Complication, which is a set of different layouts.

Use the widgets APIs to build a complication UI.

circular = <widgets.WidgetLayout object>

A WidgetLayout object which UI’s will be used for circular complications.

circular_extra_large = <widgets.WidgetLayout object>

A WidgetLayout object which UI’s will be used for extra large circular complications.

rectangular = <widgets.WidgetLayout object>

A WidgetLayout object which UI’s will be used for rectangular complications.

class watch.ComplicationsProvider

An abstract class for implementing Apple Watch complications.

complication(date: datetime.datetime) → watch.Complication

Return a complication to be displayed in the Watch Face at the given moment.

Parameters:date – The timestamp at which the returned complication will be displayed.
Return type:Complication
name() → str

Return the name of the complication. This name is used in the Watch Face setup.

Return type:str
timeline(after_date: datetime.datetime, limit: int) → List[datetime.datetime]

Return a list of timestamps. The Apple Watch will display a complication on each of the returned dates. The Apple Watch will call this function to request data for the future.

You should fetch your data from this function and return the datetime objects for which you have data. Then the complication() method will be called for each timestamp to configure the content.

  • after_date – The moment when the timeline begins.
  • limit – A limit of dates that can be returned (usually 100).
Return type:


watch.add_complications_provider(provider: watch.ComplicationsProvider)

Adds a complication to the Apple Watch. After adding the ComplicationsProvider object, you will be able to add the complication to your Watch Face. This function must be called from the script configured for the Apple Watch so the passed object can provide the data to the Watch Face.

Parameters:provider – The object that will provide data to the complication.

Reloads complications currently displayed on the paired Apple Watch.

User Interface

class watch.Progress(value: int = 0, circular: bool = False, label: widgets.WidgetComponent = None, color: widgets.Color = None, background_color: widgets.Color = None, corner_radius: float = 0, padding: Union[PADDING, widgets.Padding] = None, link: str = None)

A view indicating a progress.

circular = False

If set to False (default value), the progress view will be linear. If set to True, the progress view will be a circular ring.

color = None

The tint color of the progress.

label = None

A widget component describing the progress. Can be a symbol or a text for example.

value = 0

The value of the progress (between 0 and 1).

watch.make_interface() → widgets.WidgetLayout

Creates and returns a WidgetLayout instance. When the script finishes running, the content of the returned object will be passed and displayed in the Apple Watch. This function must be called from the script configured in the Apple Watch.

Return type:wd.WidgetLayout

Deletes the previous user interface sent to the Watch.