8000 Fix crash when station_name not present by cgtobi · Pull Request #117 · jabesq/netatmo-api-python · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Dec 4, 2020. It is now read-only.

Fix crash when station_name not present #117

Merged
jabesq merged 2 commits into from
Sep 25, 2020

Conversation

cgtobi
Copy link
Collaborator
@cgtobi cgtobi commented Sep 24, 2020

@sourcery-ai
Copy link
sourcery-ai bot commented Sep 24, 2020

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.01%.

Quality metrics Before After Change
Complexity 1.12 ⭐ 1.12 ⭐ 0.00
Method Length 52.09 ⭐ 52.23 ⭐ 0.14 👎
Working memory 9.36 🙂 9.37 🙂 0.01 👎
Quality 79.35% 79.34% -0.01% 👎
Other metrics Before After Change
Lines 1943 2012 69
Changed files Quality Before Quality After Quality Change
src/pyatmo/auth.py 78.52% ⭐ 78.52% ⭐ 0.00%
src/pyatmo/weather_station.py 73.25% 🙂 73.39% 🙂 0.14% 👍
tests/test_pyatmo.py 84.56% ⭐ 84.56% ⭐ 0.00%
tests/test_pyatmo_camera.py 83.63% ⭐ 83.63% ⭐ 0.00%
tests/test_pyatmo_thermostat.py 77.81% ⭐ 77.81% ⭐ 0.00%
tests/test_pyatmo_weatherstation.py 75.21% ⭐ 75.08% ⭐ -0.13% 👎

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
src/pyatmo/auth.py NetatmoOAuth2.post_request 29 😞 290 ⛔ 16 ⛔ 21.18% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
src/pyatmo/weather_station.py WeatherStationData.__init__.get_module_names.get_modules.get_monitored_conditions.get_last_data 19 😞 217 ⛔ 12 😞 36.39% 😞 Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
tests/test_pyatmo_thermostat.py test_home_status_set_thermmode 2 ⭐ 139 😞 26 ⛔ 47.37% 😞 Try splitting into smaller methods. Extract out complex expressions
src/pyatmo/weather_station.py WeatherStationData.__init__ 18 🙂 157 😞 7 🙂 52.38% 🙂 Try splitting into smaller methods
src/pyatmo/weather_station.py WeatherStationData.__init__.get_module_names.get_modules.get_monitored_conditions 11 🙂 126 😞 11 😞 53.13% 🙂 Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Let us know what you think of it by mentioning @sourcery-ai in a comment.

@cgtobi cgtobi requested a review from jabesq September 24, 2020 13:26
@jabesq jabesq merged commit 6e5748d into jabesq:development Sep 25, 2020
@cgtobi cgtobi deleted the fix_weather_40377 branch October 5, 2020 13:03
jabesq added a commit that referenced this pull request Oct 7, 2020
v4.1.0

  * Fix token update issue with non-OAuth2 login #115
  * Add trends #118
  * Fix crash when station_name not present #117
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Netatmo cannot fetch any sensors - fresh setup
2 participants
0