Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Add dim mode to night_light for air purifier. #52

Merged
merged 1 commit into from
Sep 19, 2022

Conversation

vlebourl
Copy link
Owner

Closing #50

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 16, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 2.20 ⭐ 2.47 ⭐ 0.27 👎
Method Length 37.95 ⭐ 39.50 ⭐ 1.55 👎
Working memory 5.42 ⭐ 5.47 ⭐ 0.05 👎
Quality 83.35% 82.76% -0.59% 👎
Other metrics Before After Change
Lines 214 221 7
Changed files Quality Before Quality After Quality Change
custom_components/vesync/light.py 83.35% ⭐ 82.76% ⭐ -0.59% 👎

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

File Function Complexity Length Working Memory Quality Recommendation
custom_components/vesync/light.py VeSyncBaseLight.turn_on 5 ⭐ 128 😞 10 😞 60.44% 🙂 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!

Help us improve this quality report!

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vlebourl
Copy link
Owner Author

vlebourl commented Sep 16, 2022

This hasn't been tested as I don't own the device. The intended use is to add brightness to the night light, and whenenver that brightness isn't 255, use "dim" instead of "on".

Another solution could be to look at "effect" instead of "brightness", but I've never done it yet, so I'm not sure how that works, and it's hard to test without the device.

@vlebourl vlebourl merged commit f15e78e into main Sep 19, 2022
@vlebourl vlebourl deleted the feature/add-dim-night-light branch September 19, 2022 14:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant