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 smhi wind gust speed and thunder probability #50328
Add smhi wind gust speed and thunder probability #50328
Conversation
Added the extra attributes wind_gust_speed and thunder_probability that were already implemented in the underlaying library (joysoftware / pypi_smhi). Also for the existing extra attribute cloudiness, it is added if "is not None" instead of just "if self.cloudiness" which would make it False (and therefore not available) if cloudiness = 0.
Removed white spaces and changed order of list as suggested by the tests.
Removed some more white spaces...
Changed dictionary handling as suggested by MartinHjelmare.
Please add an assertion of the new attributes here:
|
Updated test_weather.py to include the new attributes wind_gust_speed and thunder_probability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Added the missing imports ATTR_SMHI_THUNDER_PROBABILITY, ATTR_SMHI_WIND_GUST_SPEED,
… valuesfor Renamed the new internal attribute thunder to thunder_probability, same as the exposed attribute for improved consistency. Corrected test values according to smhi.json.
@MartinHjelmare Thank you for the patience and for showing me where to find the test data. I really learned a lot, and hope it will go much smoother next time! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Added the extra attributes:
wind_gust_speed and
thunder_probability
that were already implemented in the underlaying library (joysoftware/pypi_smhi).
Also for the existing extra attribute "cloudiness", it is now added if "is not None" instead of just "if self.cloudiness" which would make it False (and therefore not available) if cloudiness = 0, which I think was a bug. Therefore i don't consider it to be a breaking change?
I found this because thunder probability is often 0... and I first wrote the attribute code exactly as the old one.
Proposed change
Adds wind gust speed and thunder probability as extra attributes. These were already implemented in the underlaying library.
I am sorry, but I am not sure how to run the required tests according to the lists below.
I just made the changes in notepad++, uploaded to custom_components folder and it seems to work without any error logs.
Variables/attributes are added, but as I think they are self explaining, and the existing ones are not documented either, I have not proposed any changes to home-assistant.io.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: