8 Commits

Author SHA1 Message Date
Veeck
432d900ecd
Add tests for some weather utils (#3103)
Co-authored-by: veeck <michael@veeck.de>
2023-05-15 21:04:50 +02:00
Karsten Hassel
a41aa48dd1
add .gitattributes and fix prettier/js warnings (#3094)
see title, as discussed in
https://github.com/MichMich/MagicMirror/pull/3093
2023-04-22 09:29:51 +02:00
Veeck
7e58b38ddf
Add no-param-reassign from eslint (#3089)
While waiting for the easterbunny I cleaned up some bad coding practice
:-)

Very open for comments especially regarding the places I commented
myself...

---------

Co-authored-by: veeck <michael@veeck.de>
2023-04-16 17:38:39 +02:00
Veeck
6d86ffade4
Fix rounding in precipitation percentage (#3045)
Percentage should be always rounded so that we dont get something like
"47.0000000001 %"

Some small typo and naming fixes also while I am here

---------

Co-authored-by: veeck <michael@veeck.de>
2023-02-20 20:04:40 +01:00
Veeck
fb22a76796
Fix precipitation styles (#3041)
They weren't applied to wrong classnames, this PR fixes that and also
expands the weather util tests

---------

Co-authored-by: veeck <michael@veeck.de>
2023-02-18 18:24:11 +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
Veeck
a8dc563a31
Update weather tests (#3008)
Added a few tests for sunset/sunrise and feelsLike 
Lets see if they run through first...

Co-authored-by: veeck <michael@veeck.de>
2023-01-26 19:43:34 +01:00
Veeck
c191ff0032
Refactor common weather methods into utils class (#2958)
Co-authored-by: veeck <michael@veeck.de>
2022-10-28 19:56:55 +02:00