Skip to content

Commit

Permalink
Merge pull request #31 from fewieden/develop
Browse files Browse the repository at this point in the history
2.2.1
  • Loading branch information
fewieden authored Feb 8, 2022
2 parents 0495cad + 5ac3645 commit 86c1467
Show file tree
Hide file tree
Showing 18 changed files with 631 additions and 1,005 deletions.
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sourceType": "module"
},
"settings": {
"import/core-modules": [ "node_helper" ]
"import/core-modules": ["logger", "node_helper"]
},
"env": {
"browser": true,
Expand All @@ -28,7 +28,6 @@
"curly": ["error", "all"],
"array-bracket-spacing": 0,
"space-before-function-paren": 0,
"object-curly-spacing": ["error", "never"],
"object-property-newline": ["error", { "allowAllPropertiesOnSameLine": true }]
}
}
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.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
github: fewieden
custom: ['https://paypal.me/fewieden']
Binary file added .github/example_nhl_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/example_nhl_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 14.x ]
node-version: [ 16.x ]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
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-NHL)(-[a-z0-9]+)*$",
{"message": "Expected class selector to be kebab-case"}
]
}
}
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# MMM-NHL Changelog

## [2.2.0]

MagicMirror² version >= 2.15.0 required.

### Added

* Added new config option `showPlayoffSeries` to display playoff series information

### Changed

* Node helper logs are now done through MagicMirror logger
* Updated project config files
* Updated Github config files

### Fixed

* Changed Logo Urls to support all teams (specifically all-star teams)
* Added support for teams with no short name when showNames is true

## [2.1.0]

### Fixed
Expand Down
1 change: 0 additions & 1 deletion MMM-NHL.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
}

.MMM-NHL .no-color {
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}

Expand Down
18 changes: 16 additions & 2 deletions MMM-NHL.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ Module.register('MMM-NHL', {
'3rd': '3RD_PERIOD',
OT: 'OVER_TIME',
SO: 'SHOOTOUT',
SHOOTOUT: 'SHOOTOUT',
FINAL: 'FINAL',
'FINAL OT': 'FINAL_OVERTIME',
'FINAL SO': 'FINAL_SHOOTOUT'
'FINAL SO': 'FINAL_SHOOTOUT',
PPD: 'PPD'
},

/**
Expand All @@ -58,6 +60,12 @@ Module.register('MMM-NHL', {
* @member {Game[]} games - List of all games matching focus and timespan config options.
*/
games: [],

/**
* @member {Series[]} playoffSeries - List of all current playoff series.
*/
playoffSeries: [],

/**
* @member {SeasonDetails} season - Current season details e.g. year and mode.
*/
Expand All @@ -83,6 +91,7 @@ Module.register('MMM-NHL', {
* @property {number} daysAhead - Amount of days a match should be displayed before it starts.
* @property {boolean} showNames - Flag to show team names.
* @property {boolean} showLogos - Flag to show club logos.
* @property {boolean} showPlayoffSeries - Flag to show playoff series status during playoffs.
* @property {boolean} rollOverGames - Flag to show today's games and previous/next day based on game status.
*/
defaults: {
Expand All @@ -96,6 +105,7 @@ Module.register('MMM-NHL', {
daysAhead: 7,
showNames: true,
showLogos: true,
showPlayoffSeries: true,
rollOver: false
},

Expand Down Expand Up @@ -149,6 +159,7 @@ Module.register('MMM-NHL', {
modes: this.modes,
season: this.season,
games: this.games,
playoffSeries: this.playoffSeries,
rotateIndex: this.rotateIndex,
maxGames: Math.min(this.games.length, this.rotateIndex + this.config.matches),
config: this.config
Expand All @@ -171,7 +182,7 @@ Module.register('MMM-NHL', {
this.config.daysAhead = 1;
}

this.sendSocketNotification('CONFIG', {config: this.config});
this.sendSocketNotification('CONFIG', { config: this.config });
},

/**
Expand All @@ -188,6 +199,9 @@ Module.register('MMM-NHL', {
this.games = payload.games;
this.season = payload.season;
this.setRotateInterval();
} else if (notification === 'PLAYOFFS') {
this.playoffSeries = payload;
this.updateDom(300);
}
},

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ National Hockey League Module for MagicMirror<sup>2</sup>

## Examples

![](.github/example_nhl.png) ![](.github/example_nhl_2.png) ![](.github/example_nhl_3.png)
![](.github/example_nhl.png) ![](.github/example_nhl_2.png) ![](.github/example_nhl_3.png) ![](.github/example_nhl_4.png) ![](.github/example_nhl_5.png)

## Dependencies

Expand Down Expand Up @@ -43,6 +43,7 @@ National Hockey League Module for MagicMirror<sup>2</sup>
| `liveReloadInterval` | `60000 (1 min)` | How often should the data be fetched during a live game. |
| `showNames` | `true` | Should team names be displayed? |
| `showLogos` | `true` | Should team logos be displayed? |
| `showPlayoffSeries` | `true` | Should playoff series be displayed (if in playoffs)? |
| `rollOver` | `false` | Displays today's games and based on game status also yesterdays games or tomorrows games. Automatically overrides `daysInPast` and `daysAhead` to 1. |

## Global config
Expand Down
Loading

0 comments on commit 86c1467

Please sign in to comment.