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

Add support for Weatherbit in the Weather Module #2187

Merged
merged 8 commits into from
Dec 8, 2020

Conversation

AndyPoms
Copy link
Contributor

@AndyPoms AndyPoms commented Nov 8, 2020

This is my first ever pull request, please let me know if I messed anything up.

Adds support for Weatherbit.io
Based on existing classes for Dark Sky and Weather.gov

API Key required

Config Options:

Option Description
apiBase The Weather base URL. Possible value: https://api.weatherbit.io/v2.0 This value is REQUIRED
weatherEndpoint The Weatherbit API endPoint. Possible values: /current, /forecast/daily This value is REQUIRED
apiKey The Weatherbit API key which can be obtained by creating an WeatherBit account at https://www.weatherbit.io This value is REQUIRED
lat The geo coordinate latitude. This value is REQUIRED
lon The geo coordinate longitude. This value is REQUIRED

Adds support for Weatherbit.io

API Key needed, based on existing classes for Dark Sky and Weather.gov
@AndyPoms AndyPoms changed the title Add files via upload Add support for Weatherbit in the Weather Module Nov 8, 2020
@AndyPoms AndyPoms marked this pull request as ready for review November 8, 2020 01:39
@MagicMirrorBot
Copy link

Warnings
⚠️

Please include an updated CHANGELOG.md file.
This way we can keep track of all the contributions.

Generated by 🚫 dangerJS

// Implement WeatherDay generator.
generateWeatherDayFromCurrentWeather(currentWeatherData) {
//Calculate TZ Offset and invert to convert Sunrise/Sunset times to Local
var d = new Date();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be a const ?

generateWeatherDayFromCurrentWeather(currentWeatherData) {
//Calculate TZ Offset and invert to convert Sunrise/Sunset times to Local
var d = new Date();
var tzOffset = d.getTimezoneOffset();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be a let

@rejas
Copy link
Collaborator

rejas commented Nov 8, 2020

As the bot says: Please include an entry for your PR in the Changelog.
Otherwise I found only two small nitbits looking at the code, dont have the time unfortanetly to run it and see if it works :-)

@rejas
Copy link
Collaborator

rejas commented Nov 8, 2020

Also, you should run "npm run lint:prettier" to make sure your code adheres to the styleguides (and passes the travis tests)

@AndyPoms
Copy link
Contributor Author

AndyPoms commented Nov 8, 2020

Like I said this is my first ever pull request... How do I include a CHANGELOG.md file? What should it include?

Do I just take the one from my fork, add a line that says "Add support for Weatherbit" & attach? Do I create a new file named CHANGELOG.md with only a line that say "Adds support for Weatherbit"?

How do I run npm run lint:prettier? Is it on the website, the Desktop app, or GitBash, GitCMD, or GitGUI? Or is it on the machine I'm hosting my MM with?

@rejas I'll review your const/let comments when I get a chance (likely towards the end of the week).

@rejas
Copy link
Collaborator

rejas commented Nov 9, 2020

Like I said this is my first ever pull request... How do I include a CHANGELOG.md file? What should it include?

Do I just take the one from my fork, add a line that says "Add support for Weatherbit" & attach? Do I create a new file named CHANGELOG.md with only a line that say "Adds support for Weatherbit"?

You should just add a new line to the already existing CHANGELOG.md file under the "Added" headline.

How do I run npm run lint:prettier? Is it on the website, the Desktop app, or GitBash, GitCMD, or GitGUI? Or is it on the machine I'm hosting my MM with?
You run that command on the command line on the machine you are developing and submitting your PR. Just go into the main directory of the MagicMirror repository.

@rejas I'll review your const/let comments when I get a chance (likely towards the end of the week).
👍

@sdetweil
Copy link
Collaborator

sdetweil commented Nov 9, 2020

How do I run npm run lint:prettier

it's a commandline
all git and npm commands are from the MagicMirror folder

@AndyPoms
Copy link
Contributor Author

AndyPoms commented Nov 14, 2020

  • Updated to const & let per rejas suggestions.
  • Added CHANGELOG.md (I think I may have screwed this one up based on the Conflict listed below- advice?)
  • Ran npm run lint:prettier

Let me know if there is anything else

@rejas
Copy link
Collaborator

rejas commented Nov 15, 2020

Just fix that one merge-conflict and the PR seems good to go!

@AndyPoms
Copy link
Contributor Author

Just fix that one merge-conflict and the PR seems good to go!

I think I did it correctly & kept all changes (just removed the 3 conflict markers so that all info remained.

@rejas
Copy link
Collaborator

rejas commented Nov 18, 2020

Please run "npm run lint:prettier" to fix the style issues in the CHANGELOG. After those changes are pushed, this PR should be fine.

@AndyPoms
Copy link
Contributor Author

AndyPoms commented Nov 20, 2020

Please run "npm run lint:prettier" to fix the style issues in the CHANGELOG. After those changes are pushed, this PR should be fine.

Done.... Weird because my original CHANGELOG was OK, it was only after I resolved a conflict (by keeping both sets of changes - and using the GitHub website to do so) that this came up....

@MichMich MichMich merged commit e7dd2b4 into MagicMirrorOrg:develop Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants