Skip to content

Forking this to add multi-user authentication for multiple modules from different google users.

Notifications You must be signed in to change notification settings

usncahill/MMM-GoogleTasks

 
 

Repository files navigation

MMM-GoogleTasks

Module for the MagicMirror² smart mirror. Displays tasks from Google Tasks.

Example

Example of MMM-GoogleTasks

Dependencies

  1. The Google Node.js client library: For authentication and Google Tasks API (v1). See Installation for instructions

Installation

To install the module, use your terminal to:

  1. Navigate to your MagicMirror's modules folder, e.g. MagicMirror/modules.
  2. Clone the module:
    git clone https://github.com/usncahill/MMM-GoogleTasks.git
  3. Install Google API:
    npm install googleapis

Authentication Setup

Google Tasks API an authenticated OAuth2 client:

  1. Go here, and click "Enable the Google Tasks API" button. Follow the steps.
  2. After the directions,
  • Browse to console.cloud.google.com/apis/credentials page of the project created in Step 1,
  • Click the download button on the Actions column of the OAuth 2.0 Client IDs table, and
  • Save the file as credentials.json in your MMM-GoogleTasks directory (MagicMirror/modules/MMM-GoogleTasks).
  1. Enable Google Tasks API. Select the same project as in Step 1.
  2. Run authenticate.js:
    node ./authenticate.js from your MMM-GoogleTasks directory.
  3. Follow the script instructions and it should print your lists. Copy the ListID of the list you want.
  4. Save the desired listID and a unique listName for this list in the config.js.
  5. Rename the generated token.json as follows: tokenLISTNAME.json, e.g. tokenJeff.json where listName='Jeff'.
  6. Repeat all steps for each user for multi-user support.

Using the module

MagicMirror² Configuration

To use this module, add the following configuration block to the modules array in the config/config.js file:

var config = {
    modules: [
        ...
        {
            module: 'MMM-GoogleTasks',
            header: "Google Tasks",
            position: "top_left",
            config: {
                listID: "MDbG9uZ2V4YW1wbGVzdHJpbmc",
                listName: "Foo"
                ...
                // See below for Configuration Options
            }
        },
        ...
    ]
}

Configuration Options

Option Details
listID Required - List ID printed from authenticate.js (see installation)
listName Required - Unique name used to differentiate token.json for multiple users' lists. The same token can be used for multiple single-user lists.
maxResults Optional - Max number of list items to retrieve.

Possible values: 0 - 100
Default value: 10
width Optional - sets the module width.
Default value: 320 px
showCompleted Optional - Show completed task items

Possible values: true false
Default value: false
dateFormat Optional - Format to use for due date

Possible values: See Moment.js formats
Default value: MMM Do (e.g. Jan 18th)
updateInterval Optional - Interval at which content updates (minutes)
Tasks API has default maximum of 50,000 calls per day.
Default value: 5 minutes
animationSpeed Speed of the update animation. (seconds)

Possible values: 0 - 5
Default value: 2 seconds
tableClass Name of the classes issued from main.css.

Possible values: xsmall small medium large xlarge
Default value: small
sortOrder Using SortBy element, determines which direction to sort.

Possible values: ascending descending
Default value: ascending
sortBy Which Google Task subelement to use for sorting

Possible values: due updated title
Default value: due
groupSubTasks Whether to group sub tasks under their parents or list them on their own.

Possible values: true false
Default value: true
taskIcon Icon to use as bullet point for each task, something from the iconify icon set.
Default value: bx:square-rounded

About

Forking this to add multi-user authentication for multiple modules from different google users.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.4%
  • CSS 3.6%