This page lists all the annotations that are supported on Thingpedia classes and that affect the loading and execution of Thingpedia APIs. For the list of annotations affecting natural language and the dialogue agent, see the Genie Annotation Reference
These annotations are processed by the Thingpedia SDK, not by Genie. For annotatons that support placeholders, the placeholder syntax is that of the string-interp library.
The name of the device to use in the user's configured device list.
Syntax: #_[name=$string]
Scope: class
Type: string
Placeholders: can use placeholders from the state of the device
Example:
class @com.spotify
#_[name="Spotify Account ${user_id}"]
A description of the device to use in the user's configured device list.
Syntax: #_[description=$string]
Scope: class
Type: string
Placeholders: can use placeholders from the state of the device
Example:
class @com.spotify
#_[description="This is your Spotify Account"]
The name of the device to use in the Thingpedia catalog. This is only required if the name
annotation is not suitable to use in the catalog (e.g. due to placeholders).
Syntax: #_[thingpedia_name=$string]
Scope: class
Type: string
Placeholders: no
Example:
class @com.spotify
#_[thingpedia_name="Spotify"]
A description of the device to use in the user's configured device list.
Syntax: #_[thingpedia_description=$string]
Scope: class
Type: string
Placeholders: no
Example:
class @com.spotify
#_[thingpedia_description="Play music on Spotify"]
The copyright license of this device, as an SPDX identifier.
Syntax: #[license=$string]
Scope: class
Type: string
Placeholders: no
Example:
class @com.spotify
#[license="BSD-3-Clause"]
Whether the license is GPL-compatible or not.
Syntax: #[license_gplcompatible=$value]
Scope: class
Type: boolean
Example:
class @com.spotify
#[license_gplcompatible=true]
The category this device belongs to, in Thingpedia.
Syntax: #[subcategory=$value]
Scope: class
Type: enum: service
, media
, social-network
, communication
, home
, health
, data-management
Example:
class @com.spotify
#[subcategory=enum(media)]
If set and true, this device will be considered a system device, and will be hidden from the configured device list.
Syntax: #[system=true]
Scope: class
Type: boolean
Example:
class @org.thingpedia.builtin.test
#[system=true]
A website associated with this device, which will be linked from the Thingpedia page.
Syntax: #[website=$value]
Scope: class
Type: string
Placeholders: no
Example:
class @com.spotify
#[website="https://spotify.com"]
The URL to a git repository where the device is developed.
Syntax: #[repository=$value]
Scope: class
Type: string
Placeholders: no
Example:
class @com.spotify
#[repository="https://github.com/stanford-oval/thingpedia-common-devices"]
A URL to use to report problems with this device.
Syntax: #[issue_tracker=$value]
Scope: class
Type: string
Placeholders: no
Example:
class @com.spotify
#[issue_tracker="https://github.com/stanford-oval/thingpedia-common-devices/issues"]
The following annotations are independent of any loader.
The version of this device. This is a monotonically increasing integer. The annotation is added automatically by Thingpedia when publishing.
Syntax: #[version=$value]
Scope: class
Type: number
A short documentation string to use in the Thingpedia page.
In the future, we expect Markdown to be allowed in this string.
Syntax: #[doc=$string]
Scope: function
Type: string
Placeholders: no
Example:
play_song(...)
#[doc="play the given song on Spotify"]
The interval at which polling occurs for a monitorable query. Must be a non-negative duration. If 0, the device must implement the subscribe
interface for push notifications.
Syntax: #[poll_interval=$string]
Scope: function
Type: duration (Measure(ms)
)
Example:
class @com.foxnews {
monitorable query get_article(...)
#[poll_interval=1h]
The version of the JS code associated with device. This is a monotonically increasing integer. It can be different from #[version]
if one uploads a new version of the manifest but does not upload a new JS package. This annotation is added automatically by Thingpedia when publishing.
Syntax: #[package_version=$value]
Scope: class
Type: number
The list of classes that might be configured as part of a collection device (like an IoT gateway).
Syntax: #[child_types=$value]
Scope: class
Type: array of Thingpedia device IDs
Example:
class @io.home-assistant
#_[child_types=[
"org.thingpedia.iot.tv",
"org.thingpedia.iot.speaker",
"org.thingpedia.iot.vacuum",
...
]]
The URL endpoint to use for the API call
Syntax: #[url=$value]
Scope: function
Type: string
Placeholders: yes, both from device state and from input parameters to the function
HTTP method to use for the API request.
Syntax: #[method=$value]
Scope: function
Type: string
If unspecified: defaults to "GET"
for queries and "POST"
for actions
The URL of the RSS feed
Syntax: #[url=$value]
Scope: function
Type: string
Placeholders: yes, both from device state and from input parameters to the function