30 Commits

Author SHA1 Message Date
OWL4C
eceec8285d
Adding experimental UV Index support for weather module (#3108)
This pr adds (config.js toggleable) showUV_Index to the hourly and
current weather modules, with right now only openmeteo configured to
supply the data. Other providers could have support too by adding
`uv_index` to current and hourly.

For example the current weather looks like
![image](https://github.com/MichMich/MagicMirror/assets/124401812/00fdf5db-c0d5-4797-9a31-1d72dd970d26)
positioned after sunset in the top row.



The following "hacks" are included and could be fixed to make it
cleaner, but the functionality is wanted and it works without problem.
- To hide entries where the UV Index is 0 i added an if statement to the
`hourly.njk` which is not how precipitation is handled.
The following are minor things that might not need fixing:
- The forecast option does not have UV support. This might not be
relevant since UV changes throughout the day but i tried to implement a
"max_UV" to openmeteo.js, but am not confident enough in JS to
accomplish that.
- The UV Icon is wi-hot and manually added to the `.njk`'s. This could
be made changeable by a config but does not seem relevant since wi-hot
is not used by anything else as far as i can tell.

---------

Co-authored-by: veeck <michael@veeck.de>
2023-05-22 10:57:48 +02:00
Kristjan ESPERANTO
b08a4737af
Update stylelint (#3042)
1. Update `stylelint` dependencies
- As of stylelint v15, we do not need `stylelint-config-prettier`
anymore:
https://github.com/prettier/stylelint-config-prettier/releases/tag/v9.0.5
2. Switch to `stylelint-config-standard`:
`stylelint-prettier/recommended` has not been updated for a long time
and still needs the old `stylelint-config-prettier`
3. Handle new `stylelint` issues
2023-02-19 21:36:50 +01:00
Magnus
bf279d9a57
Tidy up precipitation (#3023)
Fixes #2953

This is an attempt to fix the issue with precipitation amount and
percentage mixup. I have created a separate
`precipitationPercentage`-variable where the probability of rain can be
stored.

The config options now has the old `showPrecipitationAmount` in addition
to a new setting: `showPrecipitationProbability` (shows the likelihood
of rain).

<details>
  <summary>Examples</summary>
  
  ### Yr

I tested the Yr weather provider for a Norwegian city Bergen that has a
lot of rain. I have removed properties that are irrelevant for this demo
from the config-samples below.

Config:
  ```js
{
	module: "weather",
	config: {
			weatherProvider: "yr",
			type: "current",
			showPrecipitationAmount: true,
			showPrecipitationProbability: true
	}
},
{
	module: "weather",
	config: {
			weatherProvider: "yr",
			type: "hourly",
			showPrecipitationAmount: true,
			showPrecipitationProbability: true
	}
},
{
	module: "weather",
	config: {
			weatherProvider: "yr",
			type: "daily",
			showPrecipitationAmount: true,
			showPrecipitationProbability: true
	}
}
  ```

Result:<br/>
<img width="444" alt="screenshot"
src="https://user-images.githubusercontent.com/34011212/216775423-4e37345c-f915-47e5-8551-7c544ebd24b1.png">

</details>

---------

Co-authored-by: Magnus Marthinsen <magmar@online.no>
Co-authored-by: Veeck <github@veeck.de>
2023-02-04 19:02:55 +01:00
Magnus
67e4dbaacd
Point wind arrow in the direction the wind is flowing (#3022)
Fixes #3019

The previous implementation had the arrow pointing in to the wind. When
the wind blows from the north (0 degrees), the arrow should point
straight down. In other words, no rotation of the arrow-down symbol.
When the wind blows from the south (180 degrees), the arrow should point
straight up (I.e. the arrow down symbol rotated 180 degrees).

Co-authored-by: Magnus Marthinsen <magmar@online.no>
2023-01-22 11:41:19 +01:00
Magnus
2e2962d492
Fix yr weather direction (#3020)
Fixes so the Yr weather direction is not inverted. This error was
[reported in the
community](https://forum.magicmirror.builders/topic/17561/wind-direction-180-degrees-twisted-at-yr).

I misunderstood when developing the module because of the wind direction
arrow was pointing opposite to the arrow displayed on Yr.no. I renamed
the variable to help other developers in the future.

Co-authored-by: Magnus Marthinsen <magmar@online.no>
Co-authored-by: veeck <michael@veeck.de>
2023-01-21 22:40:08 +01:00
Veeck
2d3940a4ff
Use metric units internally in all weatherproviders (#2849)
So finally I think this refactorin is ready to be reviewed :-)

DONE:
- [x] Removed all conversion functions for wind and temperature from
specific weatherproviders
- [x] Use internally only metric units: celsius for temperature, meters
per seconds for wind
- [x] Convert temp and wind into the configured units when displaying
data on the UI
- [x] look how beaufort calculation uses metrics, added knots as new
windunit
- [x] add more e2e tests 

Checked providers:
- [x] Darksky
- [x] EnvCanada
- [x] OpenWeatherMap
- [x] SMHI provider 
- [x] UK Met Office
- [x] UK Met Office DataHub
- [x] WeatherBit
- [x] WeatherFlow
- [x] WeatherGov

TODO in different tickets:
- check weatherproviders for usage of weatherEndpoint (as seen in
https://github.com/MichMich/MagicMirror-Documentation/issues/131) -> see
#2926
- cleanup precipations -> #2953

Co-authored-by: veeck <michael@veeck.de>
2022-10-24 19:41:34 +02:00
Davide Cavalca
39c1b37726 Drop executable bit where not needed 2022-07-02 14:38:10 -07:00
Christopher Fenner
1619dd29e9
Apply suggestions from code review 2022-01-06 21:28:25 +01:00
Christopher Fenner
24bfaaca7e
use solid type for font awesome icons 2022-01-05 13:18:08 +01:00
Karsten Hassel
7ba76020d8 fix e2e tests after spectron update 2021-02-07 00:20:30 +01:00
buxxi
e2cfa24686 make weatherprovider have a method for hourly fetching instead of a generic weatherData 2021-01-23 10:45:55 +01:00
Dan Forsyth
33592b3c0e Removed |safe from translates in the default module templates 2021-01-20 14:06:00 -05:00
Ashish Tank
774b86c7dc Code cleanup for feels like translation 2021-01-10 17:37:10 +01:00
Ashish Tank
4a341b381e Added support for variables in nunjucks templates for translate filter 2020-12-31 18:58:21 +01:00
Aurélien Veillard
198525f2ce Weather config enhancement
Add new parameter 'useKmh' to display wind speed in km/h instead of m/s.
2020-11-07 09:54:13 +01:00
Bryan Zhu
b1a67d1fc5 integrated onecall usage into existing types 2020-08-01 02:59:08 -04:00
Kristof Rado
766140f483 Ability to hide sun details 2020-05-28 10:57:01 +02:00
Michael Teeuw
7a272ef0ab Merge conflict. 2019-06-14 13:19:29 +02:00
rejas
5c08bde0fa More == -> === and != -> !== fixes 2019-06-05 09:32:10 +02:00
Malcolm Oakes
c80e04fe8d Add new weather data provider UK Met Office (Datapoint) 2019-04-03 15:19:32 +01:00
vincep5
2e03868021 current.njk JS error and Loading string 2019-01-17 08:54:16 -06:00
fewieden
5759ed3728 implemented config option decimal symbol, align indoor elements vertical, add humidity support to nunjuck unit filter, do not display degree symbol for kelvin 2019-01-04 20:14:28 +01:00
fewieden
8dd7621f29 add original feels like temperature and fixed it for imperial units 2018-12-30 14:17:13 +01:00
fewieden
0fe79b5288 indoor data, new filter, small cleanup 2018-07-02 15:43:24 +02:00
fewieden
66ceafd010 show indoor data, add loading message 2018-06-16 10:53:17 +02:00
fewieden
91ddc00f7e fix moment, add unit filter 2018-05-21 10:56:46 +02:00
Michael Teeuw
07d35a8513 Remove todo item. 2017-10-19 16:52:57 +02:00
Michael Teeuw
16c887814e Show humidity. 2017-10-19 16:51:51 +02:00
Michael Teeuw
22a50b72fd Show unit. 2017-10-19 16:43:12 +02:00
Michael Teeuw
a79e1b6ca1 Rename templates to .njk files to allow syntax highlighting. 2017-10-18 13:52:11 +02:00