Skip to content

Commit

Permalink
Merge pull request #42 from fewieden/develop
Browse files Browse the repository at this point in the history
2.0.2
  • Loading branch information
fewieden authored Apr 30, 2020
2 parents 186726c + 0a92075 commit 396152f
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 31 deletions.
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
# MMM-Fuel Changelog

## [2.0.2]

### Added

* French Translations
* Clarification for config option `updateInterval` in readme

### Changed

* Dependency Update

### Removed

* Github pages

## [2.0.1]

### Fixed

* Rendering of ellipsis with config `shortenText` active https://github.com/fewieden/MMM-Fuel/issues/36
* [Rendering of ellipsis with config `shortenText` active]( https://github.com/fewieden/MMM-Fuel/issues/36)

## [2.0.0]

Expand Down
3 changes: 2 additions & 1 deletion MMM-Fuel.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ Module.register('MMM-Fuel', {
getTranslations() {
return {
en: 'translations/en.json',
de: 'translations/de.json'
de: 'translations/de.json',
fr: 'translations/fr.json'
};
},

Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ Gas Station Price Module for MagicMirror<sup>2</sup>

## Installation

1. Clone this repo into `~/MagicMirror/modules` directory.
1. Configure your `~/MagicMirror/config/config.js`:

```
{
module: "MMM-Fuel",
position: "top_right",
config: {
api_key: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
lat: 52.518611,
lng: 13.408333,
types: ["diesel"],
...
}
* Clone this repo into `~/MagicMirror/modules` directory.
* Configure your `~/MagicMirror/config/config.js`:

```js
{
module: "MMM-Fuel",
position: "top_right",
config: {
api_key: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
lat: 52.518611,
lng: 13.408333,
types: ["diesel"],
...
}
```
}
```

1. Run command `npm i --production` in `~/MagicMirror/modules/MMM-Fuel` directory.
* Run command `npm i --production` in `~/MagicMirror/modules/MMM-Fuel` directory.

## Config Options

Expand All @@ -60,7 +60,7 @@ Gas Station Price Module for MagicMirror<sup>2</sup>
| `iconHeader` | `true` | Boolean to display the car icon in the header. |
| `rotate` | `true` | Boolean to enable/disable rotation between sort by price and distance. |
| `rotateInterval` | `60000` (1 min) | How fast the sorting should be switched between byPrice and byDistance. |
| `updateInterval` | `900000` (15 mins) | How often should the data be fetched. |
| `updateInterval` | `900000` (15 mins) | How often should the data be fetched. **If your value is to small, you risk to get banned from the API provider. I suggest a minimum of 15mins** |

### tankerkoenig (Germany only)

Expand Down
9 changes: 7 additions & 2 deletions apis/nsw.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ let token;
* @description Helper function to refresh the API token.
* @async
*
* @returns {Promise}
* @param {object} config - Config object with authentication details.
*
* @returns {Promise} This async function just returns a promise but no value.
*
* @see apis/README.md
*/
Expand Down Expand Up @@ -160,7 +162,10 @@ async function requestFuelType(type) {
})
});

return { type, data: await response.json() };
return {
type,
data: await response.json()
};
}

/**
Expand Down
5 changes: 4 additions & 1 deletion apis/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ function sortByDistance(a, b) {
* @module apis/utils
* @description Utility functions for API integrations.
*/
module.exports = { filterStations, sortByDistance };
module.exports = {
filterStations,
sortByDistance
};
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "mmm-fuel",
"version": "2.0.1",
"version": "2.0.2",
"description": "Gas Station price Module for MagicMirror2",
"scripts": {
"lint": "./node_modules/.bin/eslint . && ./node_modules/.bin/stylelint .",
"lint": "./node_modules/.bin/eslint . && ./node_modules/.bin/stylelint **/*.css",
"docs": "./node_modules/.bin/jsdoc -c jsdoc.json ."
},
"repository": {
Expand All @@ -22,15 +22,15 @@
},
"homepage": "https://github.com/fewieden/MMM-Fuel#readme",
"devDependencies": {
"eslint": "^5.11.0",
"eslint": "^6.8.0",
"eslint-config-recommended": "^4.0.0",
"jsdoc": "^3.4.3",
"stylelint": "^7.8.0",
"stylelint-config-standard": "^16.0.0"
"jsdoc": "^3.6.4",
"stylelint": "^13.3.3",
"stylelint-config-standard": "^20.0.0"
},
"dependencies": {
"fs-extra": "^7.0.1",
"moment": "^2.23.0",
"node-fetch": "^2.3.0"
"fs-extra": "^9.0.0",
"moment": "^2.24.0",
"node-fetch": "^2.6.0"
}
}
11 changes: 11 additions & 0 deletions translations/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"LOADING": "Chargement...",
"FUEL_PRICES": "Prix du carburant",
"CHEAPEST_STATIONS": "Stations d'essence les moins chères",
"CLOSEST_STATIONS": "Stations-service les plus proches",
"COMMAND_LIST": "Liste de toutes les commandes vocales",
"MODE": "Mode",
"VOICE_COMMANDS": "Commandes Vocales",
"API_KEY_NEEDED": "Vous devez ajouter une clé API afin de visualiser les stations-service sur une carte.",
"MAP_API_NOT_READY": "L'API de carte n'est pas encore disponible. Réessayez plus tard."
}

0 comments on commit 396152f

Please sign in to comment.