new RoonApi(desc)
Roon API.
Parameters:
Name |
Type |
Description |
desc |
object
|
Information about your extension. Used by Roon to display to the end user what is trying to access Roon.
Properties
Name |
Type |
Attributes |
Description |
extension_id |
string
|
|
A unique ID for this extension. Something like @com.your_company_or_name.name_of_extension@. |
display_name |
string
|
|
The name of your extension. |
display_version |
string
|
|
A version string that is displayed to the user for this extension. Can be anything you want. |
publisher |
string
|
|
The name of the developer of the extension. |
website |
string
|
|
Website for more information about the extension. |
log_level |
string
|
|
How much logging information to print. "all" for all messages, "none" for no messages, anything else for all messages not tagged as "quiet" by the Roon core. |
core_paired |
RoonApi~core_paired
|
<optional>
|
Called when Roon pairs you. |
core_unpaired |
RoonApi~core_unpaired
|
<optional>
|
Called when Roon unpairs you. |
core_found |
RoonApi~core_found
|
<optional>
|
Called when a Roon Core is found. Usually, you want to implement pairing instead of using this. |
core_lost |
RoonApi~core_lost
|
<optional>
|
Called when Roon Core is lost. Usually, you want to implement pairing instead of using this. |
|
- Source:
Methods
init_services(services)
Initializes the services you require and that you provide.
This:
Parameters:
Name |
Type |
Description |
services |
object
|
Information about your extension. Used by Roon to display to the end user what is trying to access Roon.
Properties
Name |
Type |
Attributes |
Description |
required_services |
Array.<object>
|
<optional>
|
A list of services which the Roon Core must provide. |
optional_services |
Array.<object>
|
<optional>
|
A list of services which the Roon Core may provide. |
provided_services |
Array.<object>
|
<optional>
|
A list of services which this extension provides to the Roon Core. |
|
- Source:
load_config(key) → {object}
Load a key value pair in the configuration data store.
Parameters:
Name |
Type |
Description |
key |
string
|
|
- Source:
Returns:
value
-
Type
-
object
save_config(key, value)
Save a key value pair in the configuration data store.
Parameters:
Name |
Type |
Description |
key |
string
|
|
value |
object
|
|
- Source:
start_discovery()
Begin the discovery process to find/connect to a Roon Core.
- Source:
ws_connect(options)
If not using Roon discovery, call this to connect to the Core via a websocket.
This:
Parameters:
Name |
Type |
Description |
options |
object
|
Properties
Name |
Type |
Attributes |
Description |
host |
string
|
|
hostname or ip to connect to |
port |
number
|
|
port to connect to |
onclose |
RoonApi~onclose
|
<optional>
|
Called once when connect to host is lost |
|
- Source:
Type Definitions
core_found(core)
Parameters:
Name |
Type |
Description |
core |
Core
|
|
- Source:
core_lost(core)
Parameters:
Name |
Type |
Description |
core |
Core
|
|
- Source:
core_paired(core)
Parameters:
Name |
Type |
Description |
core |
Core
|
|
- Source:
core_unpaired(core)
Parameters:
Name |
Type |
Description |
core |
Core
|
|
- Source:
onclose()
- Source: