Skip to content

Commit

Permalink
Merge pull request #3 from hermanho/dev
Browse files Browse the repository at this point in the history
Update README.md and INSTALL.md
  • Loading branch information
hermanho authored Jan 28, 2024
2 parents a478d38 + 2dae31c commit 92c41f1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 32 deletions.
9 changes: 7 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
cd ~/MagicMirror/modules
git clone https://github.com/hermanho/MMM-OneDrive
cd MMM-OneDrive
npm install
npm run install-prod
```

If you are using Docker

```sh
cd ~/MagicMirror/modules
git clone https://github.com/hermanho/MMM-OneDrive
docker exec -it -w /opt/magic_mirror/module MMM-OneDrive magic_mirror npm install
docker exec -it -w /opt/magic_mirror/modules/MMM-OneDrive magic_mirror npm run install-prod
```

1. Add MMM-OneDrive module config in ~/MagicMirror/config/config.js
Expand All @@ -32,7 +32,9 @@

1. At first execution, It will open a browser and will ask you to login Microsoft account.
1. Authorize it and close the browser when done
<br />
<img src="images/authorize.png" width="300">
<br />
<img src="images/signed-in.png" width="300">

### Sperated machine (When the device does not have Desktop UI)
Expand All @@ -47,6 +49,9 @@

1. At first execution, It will open a browser and will ask you to login Microsoft account.
1. Authorize it and close the browser when done
<br />
<img src="images/authorize.png" width="300">
<br />
<img src="images/signed-in.png" width="300">

1. Copy the file `msal/token.json` to the folder `MMM-OneDrive` in the remote device
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ Display your photos from album of OneDrive on [MagicMirror²](https://github.com
module: "MMM-OneDrive",
position: "top_right",
config: {
albums: [], // Set your album name. like ["My wedding", "family share", "Travle to Paris"]
updateInterval: 1000 * 60, // minimum 10 seconds.
sort: "new", // "old", "random"
condition: {
fromDate: null, // Or "2018-03", RFC ... format available
toDate: null, // Or "2019-12-25",
minWidth: null, // Or 400
maxWidth: null, // Or 8000
minHeight: null, // Or 400
maxHeight: null, // Or 8000
minWHRatio: null,
maxWHRatio: null,
// WHRatio = Width/Height ratio ( ==1 : Squared Photo, < 1 : Portraited Photo, > 1 : Landscaped Photo)
},
showWidth: 1080, // These values will be used for quality of downloaded photos to show. real size to show in your MagicMirror region is recommended.
showHeight: 1920,
timeFormat: "YYYY/MM/DD HH:mm", // Or `relative` can be used.
albums: [], // Set your album name. like ["My wedding", "family share", "Travle to Paris"]
updateInterval: 1000 * 60, // minimum 10 seconds.
sort: "new", // "old", "random"
condition: {
fromDate: null, // Or "2018-03", RFC ... format available
toDate: null, // Or "2019-12-25",
minWidth: null, // Or 400
maxWidth: null, // Or 8000
minHeight: null, // Or 400
maxHeight: null, // Or 8000
minWHRatio: null,
maxWHRatio: null,
// WHRatio = Width/Height ratio ( ==1 : Squared Photo, < 1 : Portraited Photo, > 1 : Landscaped Photo)
},
showWidth: 1080, // These values will be used for quality of downloaded photos to show. real size to show in your MagicMirror region is recommended.
showHeight: 1920,
timeFormat: "YYYY/MM/DD HH:mm", // Or `relative` can be used.
}
},
```
Expand Down Expand Up @@ -74,9 +74,9 @@ albums: ["My wedding", "family share", "Travle to Paris", "from Tom"],

```js
condition: {
fromDate: "2018-01-01", // I don't want older photos than this.
minWidth: 600, // I don't want to display some icons or meme-pictures from my garbage collecting albums.
maxWHRatio: 1, // I want to display photos which are portrait.
fromDate: "2018-01-01", // I don't want older photos than this.
minWidth: 600, // I don't want to display some icons or meme-pictures from my garbage collecting albums.
maxWHRatio: 1, // I want to display photos which are portrait.
}
```

Expand All @@ -96,8 +96,8 @@ condition: {

- For preventing LCD burning, Photo info can be relocated by condition.
- `true` : automatically change position to each corner per 15 minutes.
- `false` : not using.
- callbackfunction (album, photo) : User can make his own position. It should return `[top, left, bottom, right]`
- `false` : not using.
- callbackfunction (album, photo) : User can make his own position. It should return `[top, left, bottom, right]`

```js
autoInfoPosition: true, // or false
Expand All @@ -115,7 +115,7 @@ autoInfoPosition: (album, photo)=> {

```css
#ONEDRIVE_PHOTO_INFO {
display:none;
display: none;
}
```

Expand All @@ -134,23 +134,23 @@ autoInfoPosition: (album, photo)=> {

```css
#ONEDRIVE_PHOTO_BACK {
display:none;
display: none;
}
```

- To cover whole region with image : Add this into your `css/custom.css`.

```css
#ONEDRIVE_PHOTO_CURRENT {
background-size:cover;
background-size: cover;
}
```

- To shrink image and be fully visible on smaller screens : Add this into your `css/custom.css`.

```css
#ONEDRIVE_PHOTO_CURRENT {
background-size:contain;
background-size: contain;
}
```

Expand All @@ -159,7 +159,7 @@ autoInfoPosition: (album, photo)=> {
```css
.clock {
padding: 10px;
background-color: rgba(0, 0, 0, 0.5);
background-color: rgba(0, 0, 0, 0.5);
}
```

Expand All @@ -184,5 +184,5 @@ autoInfoPosition: (album, photo)=> {

## Last Tested

- MagicMirror : v2.24.0
- node.js : required over v16.
- MagicMirror : v2.26.0
- node.js : required over v18.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"description": "MagicMirror² module to display your photos from OneDrive.",
"license": "MIT",
"author": "hermanho",
"contributors": [
"https://github.com/hermanho/MMM-OneDrive/graphs/contributors"
],
"scripts": {
"install-prod": "npm install --no-audit --no-fund --no-update-notifier --only=prod --omit=dev",
"lint:js": "eslint . --fix"
Expand Down Expand Up @@ -31,4 +34,4 @@
"engines": {
"node": ">=18"
}
}
}

0 comments on commit 92c41f1

Please sign in to comment.