Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MMM-PlexSlideshow.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Module.register('MMM-PlexSlideshow', {
port: 32400,
username:"",
password:"",
apiToken:""
},
// the speed at which to switch between images, in milliseconds
slideshowSpeed: 10 * 1000,
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ The following properties can be configured:
|plex | The connection details for your PLEX server. This is a require value. This is a array of values. See below. |
|plex.hostname | The IP address or hostname of your PLEX server. This is a required value|
|plex.port | This is the port number that your PLEX server runs on. This is required and it's value is normally 32400|
|plex.username | The username of an account that can access the PLEX server. This is a required value|
|plex.password | The password for the username of an account that can access the PLEX server. This is a required value|
|plex.username | The username of an account that can access the PLEX server. This is a required value unless you are using a token|
|plex.password | The password for the username of an account that can access the PLEX server. This is a required value unless you are using a token|
|plex.apiToken | The token for an account that can access the PLEX server. This is an optional value if you are using a username and password|
|slideshowSpeed|Integer value, the length of time to show one image before switching to the next, in milliseconds. <br> Default value: 10000 (Which is 10 seconds). <br>This value is __OPTIONAL__|
|transitionSpeed|Transition speed from one image to the other, transitionImages must be true. Must be a valid css transition duration.<br> Example: '2s'. <br>This value is __OPTIONAL__|
|backgroundSize|The sizing of the background image. Values can be: <ul><li>cover: Resize the background image to cover the entire container, even if it has to stretch the image or cut a little bit off one of the edges. </il><li>contain: Resize the background image to make sure the image is fully visible.</il></ul> Default value:'cover'. This value is __OPTIONAL___|
Expand Down
10 changes: 8 additions & 2 deletions node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@ module.exports = NodeHelper.create({
var options = {
hostname: config.plex.hostname !==null ? config.plex.hostname : "localhost",
port: config.plex.port ? config.plex.port : 32400,
username: config.plex.username,
password: config.plex.password
};

if (typeof config.plex.apiToken !== 'undefined' && config.plex.apiToken !== null){
options.token = config.plex.apiToken;
}
else{
options.username = config.plex.username;
options.password = config.plex.password;
}

console.log("Create PLEX Client : ", options);
api = new PlexAPI(options);
console.log("PLEX Client created");
Expand Down