Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MMM-DynamicWeather.js
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
The format is based on [Keep a Changelog](https://keepachangelog.com/)
and this project adheres to [Semantic Versioning](https://semver.org/).

## [3.0.0] - 2024-11-03

- Remove `locationID` which no longer works
- [core] Add `.gitignore` to not commit the directory `node_modules`
- [core] Add `.prettierignore` to not prettify autogenerated `MMM-DynamicWeather.js`
- [core] Optimise format of `README.md`
- [core] Update devDependencies

## [2.14.1] - 2021-04-10

Expand Down
5 changes: 2 additions & 3 deletions ConfigurationOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ The following properties can be configured:
|`hideMoon`|If true, will never display the "moon" effect. <br><br>**Type:** `boolean`<br>**Default value:** `false`|
|`lightning1Count`|Sets how many times the lightning1.png image will be displayed during the effect duration if current weather is thunderstorm.<br><br>**Type:** `number`<br>**Default value:** `2`|
|`lightning2Count`|Sets how many times the lightning2.png image will be displayed during the effect duration if current weather is thunderstorm.<br><br>**Type:** `number`<br>**Default value:** `3`|
|`locationID`|**Required (or use lat/lon)** The locationID from OpenWeatherMap for your city to get current weather. [Follow steps here to find city ID](https://www.dmopress.com/openweathermap-howto/) <br><br>**Type:** `integer`<br>**Default value:** `0`|
|`lat`|**Required with lon (or use locationID)** This is the latitude of the location you want to get the weather for.<br><br>**Type:** `number`<br>**Default value:** `0.0`|
|`lon`|**Required with lat (or use locationID)** This is the longitude of the location you want to get the weather for.<br><br>**Type:** `number`<br>**Default value:** `0.0`|
|`lat`|**Required** This is the latitude of the location you want to get the weather for.<br><br>**Type:** `number`<br>**Default value:** `0.0`|
|`lon`|**Required** This is the longitude of the location you want to get the weather for.<br><br>**Type:** `number`<br>**Default value:** `0.0`|
|`particleCount`|The number of particles to show for each effect. Higher counts may cause performance issues. This can be overriden in each effect. <br><br>**Type:** `integer`<br>**Default value:** `100`|
|`realisticClouds`|If true, shows more realistic cloud effect. Uses the cloud pictures with varying size and amount based on current weather cloud density.<br><br>**Type:** `boolean`<br>**Default value:** `false`|
|`sequential`|If set, will not display weather and a custom effect at the same time. It will run for effectDuration, wait for effectDelay, and then show the next. Repeats until either the weather changes and/or the effect date/holiday is no longer today. If not set, both weather and effect can be seen together. <br><br>`weather` to see weather first <br> `effect` to see effect first <br> `effect-one` to see effect first but only 1 effect at a time, going in order of the array. <br><br><br>**Options:**`weather`,`effect`,`effect-one`<br>**Type:** `string`<br>**Default value:** `null`|
Expand Down
26 changes: 14 additions & 12 deletions ExampleConfigurations.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Example Configurations
Below are helpful configurations for you to get started. See [Configuration Options](ConfigurationOptions.md) for details of each option.

Below are helpful configurations for you to get started. See [Configuration Options](ConfigurationOptions.md) for details of each option.

Feel free to contribute to this list.

## Show hearts on Valentine's day + default real-time weather effects

````javascript
```javascript
{
module: "MMM-DynamicWeather",
position: "fullscreen_above",
config: { // See https://github.com/scottcl88/MMM-DynamicWeather for more information.
api_key: "your_key",
locationID: "4140963",
lat: 38.895110,
lon: -77.036370,
effects: [
{
month: "2",
Expand All @@ -22,34 +24,34 @@ Feel free to contribute to this list.
],
}
},
````
```

## Never show the clouds + default real-time weather effects

````javascript
```javascript
{
module: "MMM-DynamicWeather",
position: "fullscreen_above",
config: { // See https://github.com/scottcl88/MMM-DynamicWeather for more information.
api_key: "your_key",
locationID: "4140963",
lat: 38.895110,
lon: -77.036370,
hideClouds: true
],
}
},
````
```

## Always show the sun + default real-time weather effects

````javascript
```javascript
{
module: "MMM-DynamicWeather",
position: "fullscreen_above",
config: { // See https://github.com/scottcl88/MMM-DynamicWeather for more information.
api_key: "your_key",
locationID: "4140963",
lat: 38.895110,
lon: -77.036370,
alwaysDisplay: "sun"
],
}
},
````
```
4 changes: 0 additions & 4 deletions MMM-DynamicWeather.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ Module.register("MMM-DynamicWeather", {
defaults: {
particleCount: 100,
api_key: "",
locationID: 0,
lat: 0,
lon: 0,
weatherInterval: 600000,
Expand Down Expand Up @@ -109,9 +108,6 @@ Module.register("MMM-DynamicWeather", {
if (this.config.lat && this.config.lon) {
this.url += "&lat=" + this.config.lat + "&lon=" + this.config.lon;
}
if (this.config.locationID) {
this.url += "&id=" + this.config.locationID;
}
this.snowEffect = new Effect();
this.snowEffect.images = ["snow1.png", "snow2.png", "snow3.png"];
this.snowEffect.size = 1;
Expand Down
5 changes: 0 additions & 5 deletions MMM-DynamicWeather.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ Module.register("MMM-DynamicWeather", {
defaults: {
particleCount: 100,
api_key: "",
locationID: 0,
lat: 0,
lon: 0,
weatherInterval: 600000, // Every 10 minutes,
Expand Down Expand Up @@ -133,10 +132,6 @@ Module.register("MMM-DynamicWeather", {
this.url += "&lat=" + this.config.lat + "&lon=" + this.config.lon;
}

if (this.config.locationID) {
this.url += "&id=" + this.config.locationID;
}

this.snowEffect = new Effect();
this.snowEffect.images = ["snow1.png", "snow2.png", "snow3.png"];
this.snowEffect.size = 1;
Expand Down
55 changes: 24 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Module: MMM-DynamicWeather
# MMM-DynamicWeather

<p align="center">
<a href="https://github.com/scottcl88/MMM-DynamicWeather"><img src="https://img.shields.io/maintenance/yes/2024?style=flat-square" alt="Maintained"/></a>
Expand All @@ -7,9 +7,10 @@
<a href="https://www.npmjs.com/package/mmm-dynamicweather"><img src="https://img.shields.io/npm/v/mmm-dynamicweather" alt="npm package mmm-dynamicweather"/></a>
</p>

A heavily configurable MagicMirror Module to display different animations based on current weather and show customized event effects.
A heavily configurable module for [MagicMirror²](https://github.com/MagicMirrorOrg/MagicMirror) to display different animations based on current weather and show customized event effects.

## Features

- Display clouds, rain, sun, fog, lightening, and more based on real-time weather in your city
- Display custom images on specific days, such as hearts on Valentine's day
- Plenty of customization options to weather and events
Expand All @@ -18,17 +19,17 @@ See [Sample Screenshots](ExampleScreenshots.md)

## Installation

In your terminal, go to your MagicMirror's Module folder:
In your terminal, go to your MagicMirror's module directory:

````
```bash
cd ~/MagicMirror/modules
````
```

Clone this repository:

````
git clone https://github.com/scottcl88/MMM-DynamicWeather.git
````
```bash
git clone https://github.com/scottcl88/MMM-DynamicWeather
```

**Note:** After starting the Mirror, it may take a few seconds to startup.

Expand All @@ -39,57 +40,49 @@ To use this module, add it to the modules array in the `config/config.js` file.
This module comes with many features that are heavily configurable. At it's core, it uses [OpenWeatherMap](https://openweathermap.org/)'s API to get your current weather data to display effects on the screen.

You will need 2 things to get started:
1. A free API key from OpenWeatherMap - [Sign up here](https://home.openweathermap.org/users/sign_up)
- You only need access to the [Current Weather Api](https://openweathermap.org/current)
3. The LocationID (City ID) - [follow these instructions ](https://www.dmopress.com/openweathermap-howto/)
- Optionally you can use `lat` (latitude) and `lon` (longitude) of the location you want

1. An API key from OpenWeatherMap - [Sign up here](https://home.openweathermap.org/users/sign_up)
- You only need access to the [Current Weather Api](https://openweathermap.org/current)
2. The `lat` (latitude) and `lon` (longitude) of the location you want. You can find these on [www.latlong.net](https://www.latlong.net/), for example.

This is the basic starting template, using Washington, D.C.'s location. For more examples, see [Example Configurations](ExampleConfigurations.md).

````javascript
{
module: "MMM-DynamicWeather",
position: "fullscreen_above",
config: { // See https://github.com/scottcl88/MMM-DynamicWeather for more information.
api_key: "your_key",
locationID: "4140963"
}
},
````
OR with `lat` and `lon`
````javascript
```javascript
{
module: "MMM-DynamicWeather",
position: "fullscreen_above",
config: { // See https://github.com/scottcl88/MMM-DynamicWeather for more information.
api_key: "your_key",
lat: "38.89511000",
lon: "-77.03637000"
lat: 38.895110,
lon: -77.036370
}
},
````
```

## Updating

Go to the DynamicWeather module

````
```bash
cd ~/MagicMirror/modules/MMM-DynamicWeather
````
```

Pull latest

````
```bash
git pull origin master --allow-unrelated-histories
````
```

## Configuration

See [Configuration Options](ConfigurationOptions.md)

## Troubleshooting

See [Troubleshooting Wiki](https://github.com/scottcl88/MMM-DynamicWeather/wiki/Troubleshooting)

## Contributing

See [Contribute Wiki](https://github.com/scottcl88/MMM-DynamicWeather/wiki/Contribute)

## License
Expand Down
16 changes: 0 additions & 16 deletions node_modules/.bin/tsc

This file was deleted.

17 changes: 0 additions & 17 deletions node_modules/.bin/tsc.cmd

This file was deleted.

28 changes: 0 additions & 28 deletions node_modules/.bin/tsc.ps1

This file was deleted.

16 changes: 0 additions & 16 deletions node_modules/.bin/tsserver

This file was deleted.

17 changes: 0 additions & 17 deletions node_modules/.bin/tsserver.cmd

This file was deleted.

28 changes: 0 additions & 28 deletions node_modules/.bin/tsserver.ps1

This file was deleted.

Loading