## Server Thing Configuration
-| Config | Type | description |
-|----------|----------|------------------------------|
-| hostname | text | Hostname or IP address of the server (required) |
-| port | integer | Port of the server (required) |
-| ssl | boolean | Connect through https (required) |
-| refreshSeconds | integer | Interval to pull devices state from the server |
+| Config | Type | description |
+|---------------------------|---------|----------------------------------------------------------------------------------------------|
+| hostname | text | Hostname or IP address of the server (required) |
+| port | integer | Port of the server (required) |
+| ssl | boolean | Connect through https (required) |
+| path | text | Base path of the server |
+| refreshSeconds | integer | Interval to pull devices state from the server |
| clientActiveWithInSeconds | integer | Amount off seconds allowed since the last client activity to assert it's online (0 disabled) |
-| userId | text | The user id |
-| token | text | The user access token |
+| userId | text | The user id |
+| token | text | The user access token |
## Channels
-| channel | type | description |
-|----------|--------|------------------------------|
-| send-notification | String | Display message in client |
-| media-control | Player | Control media playback |
-| playing-item-id | String | Id of the item currently playing (readonly) |
-| playing-item-name | String | Name of the item currently playing (readonly) |
-| playing-item-series-name | String | Name of the item's series currently playing, only have value when item is an episode (readonly) |
-| playing-item-season-name | String | Name of the item's season currently playing, only have value when item is an episode (readonly) |
-| playing-item-season | Number | Number of the item's season currently playing, only have value when item is an episode (readonly) |
-| playing-item-episode | Number | Number of the episode item currently playing, only have value when item is an episode (readonly) |
-| playing-item-genders | String | Coma separate list genders of the item currently playing (readonly) |
-| playing-item-type | String | Type of the item currently playing (readonly) |
-| playing-item-percentage | Dimmer | Played percentage for the item currently playing, allow seek |
-| playing-item-second | Number | Current second for the item currently playing, allow seek |
-| playing-item-total-seconds | Number | Total seconds for the item currently playing (readonly) |
-| play-by-terms | String | Play media by terms, works for series, episodes and movies; terms search is explained bellow |
-| play-next-by-terms | String | Add to playback queue as next by terms, works for series, episodes and movies; terms search is explained bellow |
-| play-last-by-terms | String | Add to playback queue as last by terms, works for series, episodes and movies; terms search is explained bellow |
-| browse-by-terms | String | Browse media by terms, works for series, episodes and movies; terms search is explained bellow |
-| play-by-id | String | Play media by id, works for series, episodes and movies; id search is explained bellow |
-| play-next-by-id | String | Add to playback queue as next by id, works for series, episodes and movies |
-| play-last-by-id | String | Add to playback queue as last by id, works for series, episodes and movies |
-| browse-by-id | String | Browse media by id, works for series, episodes and movies |
+| channel | type | description |
+|----------------------------|--------|-----------------------------------------------------------------------------------------------------------------|
+| send-notification | String | Display message in client |
+| media-control | Player | Control media playback |
+| playing-item-id | String | Id of the item currently playing (readonly) |
+| playing-item-name | String | Name of the item currently playing (readonly) |
+| playing-item-series-name | String | Name of the item's series currently playing, only have value when item is an episode (readonly) |
+| playing-item-season-name | String | Name of the item's season currently playing, only have value when item is an episode (readonly) |
+| playing-item-season | Number | Number of the item's season currently playing, only have value when item is an episode (readonly) |
+| playing-item-episode | Number | Number of the episode item currently playing, only have value when item is an episode (readonly) |
+| playing-item-genders | String | Coma separate list genders of the item currently playing (readonly) |
+| playing-item-type | String | Type of the item currently playing (readonly) |
+| playing-item-percentage | Dimmer | Played percentage for the item currently playing, allow seek |
+| playing-item-second | Number | Current second for the item currently playing, allow seek |
+| playing-item-total-seconds | Number | Total seconds for the item currently playing (readonly) |
+| play-by-terms | String | Play media by terms, works for series, episodes and movies; terms search is explained bellow |
+| play-next-by-terms | String | Add to playback queue as next by terms, works for series, episodes and movies; terms search is explained bellow |
+| play-last-by-terms | String | Add to playback queue as last by terms, works for series, episodes and movies; terms search is explained bellow |
+| browse-by-terms | String | Browse media by terms, works for series, episodes and movies; terms search is explained bellow |
+| play-by-id | String | Play media by id, works for series, episodes and movies; id search is explained bellow |
+| play-next-by-id | String | Add to playback queue as next by id, works for series, episodes and movies |
+| play-last-by-id | String | Add to playback queue as last by id, works for series, episodes and movies |
+| browse-by-id | String | Browse media by id, works for series, episodes and movies |
### Terms search:
The terms search has a default behavior that can be modified sending some predefined prefixes.
new SystemApi(jellyClient).getPublicSystemInfo(asyncResponse);
try {
var publicSystemInfo = asyncResponse.awaitContent();
- discoverServer(uri.getHost(), uri.getPort(), uri.getScheme().equalsIgnoreCase("https"), publicSystemInfo);
+ discoverServer(uri.getHost(), uri.getPort(), uri.getScheme().equalsIgnoreCase("https"), uri.getPath(),
+ publicSystemInfo);
} catch (SyncCallback.SyncCallbackError | ApiClientException e) {
logger.warn("Discovery error: {}", e.getMessage());
}
}
- private void discoverServer(String hostname, int port, boolean ssl, PublicSystemInfo publicSystemInfo) {
+ private void discoverServer(String hostname, int port, boolean ssl, String path,
+ PublicSystemInfo publicSystemInfo) {
logger.debug("Server discovered: [{}:{}] {}", hostname, port, publicSystemInfo.getServerName());
var id = Objects.requireNonNull(publicSystemInfo.getId());
Map<String, Object> properties = new HashMap<>();
properties.put("hostname", hostname);
properties.put("port", port);
properties.put("ssl", ssl);
+ properties.put("path", path);
properties.put(Thing.PROPERTY_SERIAL_NUMBER, id);
var productName = publicSystemInfo.getProductName();
if (productName != null) {