Magic Mirror Module to get Amazon Photos as background images
Background Picture by https://unsplash.com/@thesaboo
Amazon Photos does not offer any official API. To access your Amazon Photos with this module currently means you have to create a public link to them (details on how to do that follow later). It doesn't mean that everybody will be able to see the pictures of your last vacation now, as the link contains a hard-to-guess ID. Nonetheless, with enough time and resources, somebody may be lucky and guess the ID to your images.
Run these commands at the root of your MagicMirror²
cd modules
git clone https://github.com/sthuber90/mmm-amazon-photos
To use this module, add the following configuration block to the modules array in the config/config.js file:
var config = {
modules: [
{
module: 'mmm-amazon-photos',
// position is important
position: 'fullscreen_below',
config: {
// see below for configurable options
},
},
],
}
On Amazon Photos select the album you want to use. Click the share button and generate a shared link. In case, the link does not follow the format specified under configuration adjust it. On Amazon Drive you can find all your shared links and remove them here if you want to stop sharing a certain album. It's also possible to share only certain pictures from an album or from Amazon Drive.
-
imageUrls
(Array<string>
) required- Array of URLs to publicly available Amazon Photos
- the URL follows the structure of https://amazon.com/clouddrive/share/your-unique-share-id. The URL will be split inside the module into:
baseUrl
, e.g. https://amazon.comshareId
, e.g. your-unique-share-id
-
backgroundSize
(string
)- refers to CSS background-size. Valid values cover, contain
- cover [default]: 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
- contain: Resize the background image to make sure the image is fully visible
- refers to CSS background-size. Valid values cover, contain
-
backgroundPosition
(string
)- refers to CSS background-position. Most useful options: top or center [default] or bottom.
-
slideshowSpeed
(number
)- the speed at which to switch between images, in milliseconds. Defaults to 1 hour.
-
focus
(boolean
)- Default is true. If set to true adds a click handler to the gradient to toggle other module visibility. Works only together with the gradient.
-
gradientDirection
(string
)- defines the gradient direction for better contrast to other modules. Valid values vertical [default], horizontal, both, where both will result in a vignette like effect
-
gradient
(Array<string>
)-
value set as linear gradient in CSS
-
Defaults to
['rgba(0, 0, 0, 0.75) 0%', 'rgba(0, 0, 0, 0) 40%', 'rgba(0, 0, 0, 0) 80%', 'rgba(0, 0, 0, 0.75) 100%', ]
-
Automated tests are planned but currently hard to implement. However, if you have Docker installed locally, you can run npm run start
. This will run karsten13/magicmirror and make MagicMirror² with the Amazon Photos module accessible on http://localhost:8080.
Tests setup inspired by https://github.com/fewieden/MMM-soccer
Contributions are welcome. For feature requests and to track bugs please open an issue.