-
Notifications
You must be signed in to change notification settings - Fork 93
Conversation
Sourcery Code Quality Report❌ Merging this PR will decrease code quality in the affected files by 0.42%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
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! |
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.
Hey, thanks for your help. As I don't own the devices, I trust you tested and it works.
custom_components/vesync/light.py
Outdated
@@ -226,7 +226,10 @@ def brightness(self): | |||
@property | |||
def is_on(self): | |||
"""Return True if night light is on.""" | |||
return self.smarthumidifier.details["night_light_brightness"] > 0 | |||
if self.device.config_dict['module'] == 'VeSyncAirBypass': |
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.
Some fans don't have the config_dict object, in particular the PUR131S. I suppose line 53 would be false so this should be ok, but I'm not 100% sure...
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.
Oh i didn't notice that. I was going to check the device type with isinstance
, but then I saw the module property in the dict and thought that it would be cleaner to use it instead. I can change it to that if you think that it would safer.
I'll merge as soon as the style is fixed. You can use pip3 install pre-commit
pre-commit install
pre-commit run --all-files To run the style before committing. |
fix style
cd47d33
to
9e2b00d
Compare
Kudos, SonarCloud Quality Gate passed!
|
I have a Thanks again for the great work! |
A small PR to add support for the eu version of the core 600s.
I also fixed several small errors I was getting with the number, switch and light entities.
Thanks a lot for the great custom component!