Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add smhi wind gust speed and thunder probability (#50328)
* Added some extra attributes 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. * Trying to solve the style issues Removed white spaces and changed order of list as suggested by the tests. * New try to solve the style issues Removed some more white spaces... * Changed dictionary handling as suggested Changed dictionary handling as suggested by MartinHjelmare. * Updated test Updated test_weather.py to include the new attributes wind_gust_speed and thunder_probability. * Added missing imports Added the missing imports ATTR_SMHI_THUNDER_PROBABILITY, ATTR_SMHI_WIND_GUST_SPEED, * Renaming self.thunder to self.thunder_probability and correcting test 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. * Forgot to change to self.thunder_probability in one place. sorry.
- Loading branch information
Showing
3 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters