Skip to content

Latest commit

 

History

History
91 lines (70 loc) · 4.02 KB

README.md

File metadata and controls

91 lines (70 loc) · 4.02 KB

Amazon Photos - Magic Mirror Module

Magic Mirror Module to get Amazon Photos as background images

Example image of module in use. Background Picture by https://unsplash.com/@thesaboo

⚠️ A Word of Caution

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.

Installation

Run these commands at the root of your MagicMirror²

cd modules
git clone https://github.com/sthuber90/mmm-amazon-photos

Usage

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. select album on Amazon Photos Click the share button and generate a shared link. shre the album In case, the link does not follow the format specified under configuration adjust it. copy and adjust the link if needed On Amazon Drive you can find all your shared links and remove them here if you want to stop sharing a certain album. find shared links on Amazon Drive It's also possible to share only certain pictures from an album or from Amazon Drive. stop sharing link

Configuration

  • imageUrls (Array<string>) required

  • 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
  • backgroundPosition (string)

  • 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%', ]
      
      

Testing

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

Contribution

Contributions are welcome. For feature requests and to track bugs please open an issue.