Display your photos from files stored in Google Drive
Inspired by MMM-GooglePhotos and MMM-GoogleBirthdaysProvider
cd modules
git clone https://github.com/clegallic/MMM-GoogleDriveSlideShow.git
cd MMM-GoogleDriveSlideShow
npm install
Auth
and FolderId
APIs & Services > Library
.
Don't forget to enable the Google API Services.Google Drive API
. Select the correct result and click Enable.APIs & Services > Credentials
.Create Credentials > OAuth client ID
.Other
and submit. (Before or After that, you might be asked for making consent screen. do that.)client_secret_xxxx...xxx.json
. rename it as credentials.json
and save it to your MMM-GoogleDriveSlideShow/secrets
directory.cd ~/MagicMirror/modules/MMM-GoogleDriveSlideShow
npm run token:generate
4/ABCD1234xxxx...
) will be appeared. copy it and return to your terminal. paste it for answer of prompt in console.config.js
(next chapter)To use this module, add it to the modules array in the config/config.js file:
var config = {
modules: [
{
module: "MMM-GoogleDriveSlideShow",
position: "bottom_bar",
config: {
rootFolderId: null,
maxFolders: 10,
maxResults: 100,
playMode: "AUTO",
nextOnNotification: null,
stopOnNotification: null,
startOnNotification: null,
refreshDriveDelayInSeconds: 24 * 3600,
refreshSlideShowIntervalInSeconds: 10,
maxWidth: "800",
maxHeight: "600",
theme: "whiteFrame",
opacity: 1,
debug: false
}
}
]
};
Option | Description |
---|---|
rootFolderId |
Google Drive root folder id, or null for root folderType: string Default value: null |
maxFolders |
Maximum number of sub-folders to scan if rootFolderId != root Type: integer Default value: 10 |
maxResults |
Maximum of images to load from Google Drive Type: integer Default value: 100 |
playMode |
Slideshow play mode : AUTO (automatic) or NOTIFICATION (only on the notification configured with nextOnNotification ) Type: string Default value: AUTO |
nextOnNotification |
Change image only when this notification is received. Automatic refresh otherwise if null Type: string Default value: null |
stopOnNotification |
Stop slideshow when this notification is received Type: string Default value: null |
startOnNotification |
Stop slideshow when this notification is received Type: string Default value: null |
refreshDriveDelayInSeconds |
How often Google Drive cache is refresh (fetch new photos, update existings) Type: integer (seconds)Default value: 24 * 3600 |
refreshSlideShowIntervalInSeconds |
How often the image on the slideshow is refreshed Type: integer (seconds) Default value: 10 |
maxWidth |
Maximum width of the image displayed Type: integer (pixels)Default value: 800 |
maxHeight |
Maximum height of the image displayed Type: integer (pixels) Default value: 600 |
theme |
Name of CSS class to use for theme : none , insetShadow or whiteFrame . See below for examples of these themesType: string Default value: whiteFrame |
opacity |
Resulting image opacity. Consider reducing this value if you are using this module as a background picture frame Type: float (below one)Default value: 1 |
mode |
"cover" or "contain" Type: string Default value: contain |
debug |
Display debug informations in Electron and NodeJS consoles / logs Type: boolean Default value: false |
suspend()
and resume()
functions