Skip to content

Commit

Permalink
Merge pull request #83 from fewieden/develop
Browse files Browse the repository at this point in the history
v2.3.0
  • Loading branch information
fewieden committed Apr 23, 2022
2 parents 7263ddc + 82f2144 commit 398008c
Show file tree
Hide file tree
Showing 17 changed files with 2,459 additions and 1,397 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ engines:
- javascript
eslint:
enabled: true
channel: "eslint-6"
channel: "eslint-7"
checks:
import/no-unresolved:
enabled: false
Expand Down
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Thanks for contributing to this module!

Please create pull requests to the branch `develop`.
Please create pull requests towards the branch `develop`.

To hold one code style and standard there are several linters and tools in this project set. Make sure you fulfill the requirements.
Also, there will be automatically analysis performed once you created the pull request.
To hold one code style and standard there are several linters and tools in this project configured. Make sure you fulfill the requirements.
Also, there will be an automatic analysis performed once you create the pull request.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Platform (Hardware/OS):

Node version:

MagicMirror version:
MagicMirror² version:

Module version:

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Please create pull requests to the branch `develop`.
Please create pull requests towards the branch `develop`.

* Does the pull request solve an issue (add a reference)?
* What are the features of this pr?
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,18 @@ name: build

on:
push:
branches: [ master, develop ]
branches: [ master ]
pull_request:
branches: [ master, develop ]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 14.x ]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
node-version: 16.x
- run: npm ci
- run: npm run lint
6 changes: 5 additions & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"extends": "stylelint-config-standard",
"rules": {
"indentation": 4
"indentation": 4,
"selector-class-pattern": [
"^([a-z][a-z0-9]*|MMM-Fuel)(-[a-z0-9]+)*$",
{"message": "Expected class selector to be kebab-case"}
]
}
}
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# MMM-Fuel Changelog

## [2.3.0]

MagicMirror² version >= 2.15.0 required.

### Added

* Provider: `autoblog`
* Config option: `showBrand`
* Integrated MagicMirror logger on server side
* Dependency: `node-html-parser`
* Config option `excludeStationIds` to exclude gas stations from radius (Tankerkönig only)

### Changed

* Updated Github config files
* Updated dependencies

### Removed

* Dependency: `fs-extra`
* Dependency: `geolib`

## [2.2.1]

### Fixed
Expand Down
3 changes: 1 addition & 2 deletions MMM-Fuel.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
margin-right: 5px;
}

.MMM-Fuel .sortBy {
.MMM-Fuel .sort-by {
margin-left: 5px;
}

Expand All @@ -16,6 +16,5 @@
}

.no-color .MMM-Fuel-map {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
6 changes: 5 additions & 1 deletion MMM-Fuel.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Module.register('MMM-Fuel', {
* @property {boolean} showAddress - Flag to show the gas stations address.
* @property {boolean} showOpenOnly - Flag to show only open gas stations or all.
* @property {boolean} showDistance - Flag to show the distance to your specified position.
* @property {boolean} showBrand - Flag to show the brand instead of the name.
* @property {boolean} iconHeader - Flag to display the car icon in the header.
* @property {boolean} rotate - Flag to enable/disable rotation between sort by price and distance.
* @property {string[]} types - Fuel types to show.
Expand All @@ -74,14 +75,17 @@ Module.register('MMM-Fuel', {
showAddress: true,
showOpenOnly: false,
showDistance: true,
showBrand: false,
iconHeader: true,
rotate: true,
types: ['diesel'],
sortBy: 'diesel',
rotateInterval: 60 * 1000, // every minute
updateInterval: 15 * 60 * 1000, // every 15 minutes
provider: 'tankerkoenig',
toFixed: false
toFixed: false,
stationIds: [],
excludeStationIds: []
},

/**
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ Gas Station Price Module for MagicMirror<sup>2</sup>
* An installation of [MagicMirror<sup>2</sup>](https://github.com/MichMich/MagicMirror)
* OPTIONAL: [Voice Control](https://github.com/fewieden/MMM-voice) and [MMM-Modal](https://github.com/fewieden/MMM-Modal)
* npm
* [fs-extra](https://www.npmjs.com/package/fs-extra)
* [node-fetch](https://www.npmjs.com/package/node-fetch)
* [moment](https://www.npmjs.com/package/moment)
* [node-html-parser](https://www.npmjs.com/package/node-html-parser)

## Installation

Expand Down Expand Up @@ -58,6 +59,7 @@ Gas Station Price Module for MagicMirror<sup>2</sup>
| `showAddress` | `true` | Boolean to show the gas stations address. |
| `showOpenOnly` | `false` | Boolean to show only open gas stations or all. |
| `showDistance` | `true` | Boolean to show the distance to your specified position. |
| `showBrand` | `false` | Boolean to show the brand instead of the name. |
| `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. |
Expand All @@ -84,6 +86,7 @@ or your API access will be suspended.
| `types` | `["diesel"]` | Valid options are `diesel`, `e5` and `e10`. |
| `radius` | `5` | Valid range is 0-25. Set to 0 to disable. Not required if `stationIds` are provided. |
| `stationIds` | `[]` | Optional array of fuel station ids to fetch instead of the radius. You can only specify a maximum of 10 and you can find the ids [here](https://creativecommons.tankerkoenig.de/TankstellenFinder/index.html). Using radius and station ids in parallel will result in more API calls. If you run into issues increase the `updateInterval`. |
| `excludeStationIds` | `[]` | Optional array of fuel station ids to exclude from the radius. This is useful e.g. if you got a non public or truck exclusive station in the radius. You can find the ids [here](https://creativecommons.tankerkoenig.de/TankstellenFinder/index.html).|

### spritpreisrechner (Austria only)

Expand All @@ -95,6 +98,23 @@ No API key required.
| `types` | `["diesel"]` | Valid options are `diesel`, `e5` and `gas`. |
| `radius` | `5` | Valid range not tested yet. |
| `max` | `5` | The API provider returns maximum of 5 valid datasets. |
| `showBrand` | `false` | The API provider does not return brand information. |

### autoblog (USA only)

No API key required. The displayed distance is not based on your coordinates but on the zip code.

| **Option** | **Default** | **Description** |
| --- | --- | --- |
| `provider` | `"tankerkoenig"` | Make sure you set it to `"autoblog"`. |
| `zip` | REQUIRED | The zip code of your address, e.g. `"12345"` |
| `types` | `["diesel"]` | Valid options are `regular`, `mid-grade`, `premium` and `diesel`. |
| `radius` | `5` | Valid range not tested yet. |
| `lat` | `undefined` | Not supported |
| `lng` | `undefined` | Not supported |
| `open` | `false` | Not supported |
| `showOpenOnly` | `false` | Not supported |
| `showBrand` | `false` | Not supported |

### nsw (Australia NSW only)

Expand Down
Loading

0 comments on commit 398008c

Please sign in to comment.