Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[weather] unit of config is not respected on broadcasted notifications #3419

Closed
eouia opened this issue Apr 2, 2024 · 3 comments
Closed

Comments

@eouia
Copy link
Contributor

eouia commented Apr 2, 2024

Platform: All (Mainly tested on MacOS, RPI 4)

Node Version: 20.8.0

MagicMirror² Version: 2.27

Description: When the default weather module broadcasts its notification as WEATHER_UPDATED, the imperial units of current / forecasting temperatures (and speed of wind) is not respected. it is delivered as metric value.

Steps to Reproduce:

/* config/config.js*/
units: "imperial",

modules: [
             {
			module: "weather",
			position: "top_right",
			config: {
				weatherProvider: "openweathermap",
				type: "current",
				location: "New York",
				locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
				apiKey: "..."
			}
		},
  ...

Expected Results:
image

Actual Results:

image

Additional Notes: I knew about this issue since very early MM, but nobody has reported this issue still yet. So I do.

@skpanagiotis
Copy link
Contributor

Hello, I would like to contribute with a solution.

@sdetweil
Copy link
Collaborator

@skpanagiotis ok, code it up and submit a pull request to be considered.

@skpanagiotis
Copy link
Contributor

I have add this PR #3519 for the issue.

rejas added a commit that referenced this issue Aug 18, 2024
This PR resolve Issue number #3419 .

I have added the method `convertWeatherObjectToImperial()` which
converts the units of the `notificationPayload` to imperial if needed,
in order to pass the object in `sendNotification()`.

---------

Co-authored-by: veeck <[email protected]>
@khassel khassel closed this as completed Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants