-
-
Notifications
You must be signed in to change notification settings - Fork 221
Fix changing brightness when effect is active #1019
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
Conversation
Note, this edits the active effect
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1019 +/- ##
==========================================
+ Coverage 91.33% 91.42% +0.08%
==========================================
Files 84 84
Lines 5657 5724 +67
Branches 1371 1392 +21
==========================================
+ Hits 5167 5233 +66
Misses 382 382
- Partials 108 109 +1 ☔ View full report in Codecov by Sentry. |
801744a
to
9526ca2
Compare
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.
Looks really good. Happy for you to merge if you want to defer the comment about the custom effect test to later.
Will update the branch with master.
docs/tutorial.py
Outdated
Device ID: 0000000000000000000000000000000000000000\nState: True\nSignal Level: 2\nRSSI: -52\nSSID: #MASKED_SSID#\nOverheated: False\nBrightness: 50\nCloud connection: True\nHSV: HSV(hue=0, saturation=100, value=50)\nColor temperature: 2700\nAuto update enabled: True\nUpdate available: False\nCurrent firmware version: 1.1.6 Build 240130 Rel.173828\nAvailable firmware version: 1.1.6 Build 240130 Rel.173828\nLight effect: Party\nLight preset: Light preset 1\nSmooth transition on: 2\nSmooth transition off: 2\nDevice time: 2024-02-23 02:40:15+01:00 | ||
Device ID: 0000000000000000000000000000000000000000\nState: True\nSignal Level: 2\nRSSI: -52\nSSID: #MASKED_SSID#\nOverheated: False\nBrightness: 100\nCloud connection: True\nHSV: HSV(hue=0, saturation=100, value=50)\nColor temperature: 2700\nAuto update enabled: True\nUpdate available: False\nCurrent firmware version: 1.1.6 Build 240130 Rel.173828\nAvailable firmware version: 1.1.6 Build 240130 Rel.173828\nLight effect: Party\nLight preset: Not set\nSmooth transition on: 2\nSmooth transition off: 2\nDevice time: 2024-02-23 02:40:15+01:00 |
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.
I'm guessing the test_readme_examples.py
picked this up. Great to see it working 😄
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.
Yeah, it was picked up by tests indeed 🎉 Bad news is, that this is actually wrong output as setting the effect is supposed to keep the brightness in the previously set 50...
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.
So, the issue here was that the code was not changing the brightness when activating the effect. This should be now fixed, but the test bulb still thinks that it has an active preset.
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.
LGTM, let's merge!
## [0.7.0.2](https://github.com/python-kasa/python-kasa/tree/0.7.0.2) (2024-07-01) [Full Changelog](0.7.0.1...0.7.0.2) This patch release fixes some minor issues found out during testing against all new homeassistant platforms. **Fixed bugs:** - Disable multi-request on unknown errors [\#1027](#1027) (@sdb9696) - Disable multi requests on json decode error during multi-request [\#1025](#1025) (@sdb9696) - Fix changing brightness when effect is active [\#1019](#1019) (@rytilahti) - Update light transition module to work with child devices [\#1017](#1017) (@sdb9696) - Handle unknown error codes gracefully [\#1016](#1016) (@rytilahti) **Project maintenance:** - Make parent attribute on device consistent across iot and smart [\#1023](#1023) (@sdb9696) - Cache SmartErrorCode creation [\#1022](#1022) (@bdraco)
This PR changes the behavior of
brightness
module if an effect is active.Currently, changing the brightness disables the effect when the brightness is changed, this fixes that.
This will also improve the
set_effect
interface to use the current brightness when an effect is activated.bAdjusted
with the changed properties changes the brightness.