GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Do not return empty string for custom light effect name by sdb9696 · Pull Request #1491 · python-kasa/python-kasa

Conversation

@sdb9696

@sdb9696 sdb9696 commented Jan 29, 2025

Copy link
Copy Markdown
Contributor

Fixes HA Issue 134568

Issue caused when a custom effect has an empty string for a name. Causes the HA __validate_color_mode to treat as no effect active:

if not effect or effect == EFFECT_OFF:
    # No effect is active, the light must set color mode to one of the supported
    # color modes
    if color_mode in supported_color_modes:
        return

but the integration tests for != LightEffect.LIGHT_EFFECTS_OFF when deciding on the color mode:

if effect_module.effect != LightEffect.LIGHT_EFFECTS_OFF:
    self._attr_effect = effect_module.effect
    self._attr_color_mode = ColorMode.BRIGHTNESS
else:

As the effect is in fact on, we should not return empty string for effect name.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sdb9696
Do not return empty string for custom light effect name
e3bdc65
@sdb9696 sdb9696 added the bug Something isn't working label Jan 29, 2025
@sdb9696 sdb9696 added this to the 0.10.1 milestone Jan 29, 2025
@sdb9696 sdb9696 mentioned this pull request Jan 29, 2025
TP-Link (KL420L5 LED strip) set to unsupported color mode brightness home-assistant/core#134568
Closed
@codecov

codecov Bot commented Jan 29, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.63%. Comparing base (09e73fa) to head (e3bdc65).
Report is 15 commits behind head on master.

Files with missing lines Patch % Lines
kasa/smart/modules/lightstripeffect.py 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1491      +/-   ##
==========================================
- Coverage   92.64%   92.63%   -0.02%     
==========================================
  Files         149      149              
  Lines        9428     9431       +3     
  Branches      957      958       +1     
==========================================
+ Hits         8735     8736       +1     
- Misses        497      498       +1     
- Partials      196      197       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sdb9696
sdb9696 requested a review from rytilahti January 29, 2025 16:24
rytilahti
rytilahti approved these changes Jan 29, 2025
View reviewed changes

@rytilahti rytilahti left a comment

Copy link
Copy Markdown
Member

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, feel free to improve the coverage or merge as is, your call!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sdb9696

sdb9696 commented Jan 29, 2025

Copy link
Copy Markdown
Contributor Author

Yeah I thought about coverage, but hard to really test without hacking something low value together.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sdb9696
sdb9696 merged commit 82fbe12 into master Jan 29, 2025
@sdb9696
sdb9696 deleted the fix/light_effect_name branch January 29, 2025 18:49
@sdb9696 sdb9696 mentioned this pull request Jan 31, 2025
Prepare 0.10.1 #1494
Merged
sdb9696 added a commit that referenced this pull request Feb 2, 2025
@sdb9696
Prepare 0.10.1 (#1494)
cbab40a
## [0.10.1](https://github.com/python-kasa/python-kasa/tree/0.10.1) (2025-02-02)

[Full Changelog](0.10.0...0.10.1)

**Release summary:**

Small patch release for bugfixes

**Implemented enhancements:**

- dustbin\_mode: add 'off' mode for cleaner downstream impl [\#1488](#1488) (@rytilahti)
- Add Dimmer Configuration Support [\#1484](#1484) (@ryenitcher)

**Fixed bugs:**

- Do not return empty string for custom light effect name [\#1491](#1491) (@sdb9696)
- Add FeatureAttributes to smartcam Alarm [\#1489](#1489) (@sdb9696)

**Project maintenance:**

- Add module.device to the public api [\#1478](#1478) (@sdb9696)
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Aug 31, 2025
@sdb9696 @rytilahti
Do not return empty string for custom light effect name (python-kasa#…
48e9ccd
…1491)
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Aug 31, 2025
@sdb9696 @rytilahti
Prepare 0.10.1 (python-kasa#1494)
1c6ceb5
## [0.10.1](https://github.com/python-kasa/python-kasa/tree/0.10.1) (2025-02-02)

[Full Changelog](python-kasa/python-kasa@0.10.0...0.10.1)

**Release summary:**

Small patch release for bugfixes

**Implemented enhancements:**

- dustbin\_mode: add 'off' mode for cleaner downstream impl [\python-kasa#1488](python-kasa#1488) (@rytilahti)
- Add Dimmer Configuration Support [\python-kasa#1484](python-kasa#1484) (@ryenitcher)

**Fixed bugs:**

- Do not return empty string for custom light effect name [\python-kasa#1491](python-kasa#1491) (@sdb9696)
- Add FeatureAttributes to smartcam Alarm [\python-kasa#1489](python-kasa#1489) (@sdb9696)

**Project maintenance:**

- Add module.device to the public api [\python-kasa#1478](python-kasa#1478) (@sdb9696)
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Oct 26, 2025
@sdb9696 @rytilahti
Do not return empty string for custom light effect name (python-kasa#…
352cacf
…1491)
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Oct 26, 2025
@sdb9696 @rytilahti
Prepare 0.10.1 (python-kasa#1494)
9b22056
## [0.10.1](https://github.com/python-kasa/python-kasa/tree/0.10.1) (2025-02-02)

[Full Changelog](python-kasa/python-kasa@0.10.0...0.10.1)

**Release summary:**

Small patch release for bugfixes

**Implemented enhancements:**

- dustbin\_mode: add 'off' mode for cleaner downstream impl [\python-kasa#1488](python-kasa#1488) (@rytilahti)
- Add Dimmer Configuration Support [\python-kasa#1484](python-kasa#1484) (@ryenitcher)

**Fixed bugs:**

- Do not return empty string for custom light effect name [\python-kasa#1491](python-kasa#1491) (@sdb9696)
- Add FeatureAttributes to smartcam Alarm [\python-kasa#1489](python-kasa#1489) (@sdb9696)

**Project maintenance:**

- Add module.device to the public api [\python-kasa#1478](python-kasa#1478) (@sdb9696)
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Nov 10, 2025
@sdb9696 @rytilahti
Do not return empty string for custom light effect name (python-kasa#…
b12f85b
…1491)
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Nov 10, 2025
@sdb9696 @rytilahti
Prepare 0.10.1 (python-kasa#1494)
092771d
## [0.10.1](https://github.com/python-kasa/python-kasa/tree/0.10.1) (2025-02-02)

[Full Changelog](python-kasa/python-kasa@0.10.0...0.10.1)

**Release summary:**

Small patch release for bugfixes

**Implemented enhancements:**

- dustbin\_mode: add 'off' mode for cleaner downstream impl [\python-kasa#1488](python-kasa#1488) (@rytilahti)
- Add Dimmer Configuration Support [\python-kasa#1484](python-kasa#1484) (@ryenitcher)

**Fixed bugs:**

- Do not return empty string for custom light effect name [\python-kasa#1491](python-kasa#1491) (@sdb9696)
- Add FeatureAttributes to smartcam Alarm [\python-kasa#1489](python-kasa#1489) (@sdb9696)

**Project maintenance:**

- Add module.device to the public api [\python-kasa#1478](python-kasa#1478) (@sdb9696)
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Jul 5, 2026
@sdb9696 @rytilahti
Do not return empty string for custom light effect name (python-kasa#…
8538771
…1491)
rytilahti pushed a commit to rytilahti/python-kasa that referenced this pull request Jul 5, 2026
@sdb9696 @rytilahti
Prepare 0.10.1 (python-kasa#1494)
15a8bf8
## [0.10.1](https://github.com/python-kasa/python-kasa/tree/0.10.1) (2025-02-02)

[Full Changelog](python-kasa/python-kasa@0.10.0...0.10.1)

**Release summary:**

Small patch release for bugfixes

**Implemented enhancements:**

- dustbin\_mode: add 'off' mode for cleaner downstream impl [\python-kasa#1488](python-kasa#1488) (@rytilahti)
- Add Dimmer Configuration Support [\python-kasa#1484](python-kasa#1484) (@ryenitcher)

**Fixed bugs:**

- Do not return empty string for custom light effect name [\python-kasa#1491](python-kasa#1491) (@sdb9696)
- Add FeatureAttributes to smartcam Alarm [\python-kasa#1489](python-kasa#1489) (@sdb9696)

**Project maintenance:**

- Add module.device to the public api [\python-kasa#1478](python-kasa#1478) (@sdb9696)
pillarsdotnet pushed a commit to pillarsdotnet/python-kasa that referenced this pull request Oct 22, 2026
@sdb9696
Do not return empty string for custom light effect name (python-kasa#…
7b657da
…1491)
pillarsdotnet pushed a commit to pillarsdotnet/python-kasa that referenced this pull request Oct 22, 2026
@sdb9696
Prepare 0.10.1 (python-kasa#1494)
179d5e9
## [0.10.1](https://github.com/python-kasa/python-kasa/tree/0.10.1) (2025-02-02)

[Full Changelog](python-kasa/python-kasa@0.10.0...0.10.1)

**Release summary:**

Small patch release for bugfixes

**Implemented enhancements:**

- dustbin\_mode: add 'off' mode for cleaner downstream impl [\python-kasa#1488](python-kasa#1488) (@rytilahti)
- Add Dimmer Configuration Support [\python-kasa#1484](python-kasa#1484) (@ryenitcher)

**Fixed bugs:**

- Do not return empty string for custom light effect name [\python-kasa#1491](python-kasa#1491) (@sdb9696)
- Add FeatureAttributes to smartcam Alarm [\python-kasa#1489](python-kasa#1489) (@sdb9696)

**Project maintenance:**

- Add module.device to the public api [\python-kasa#1478](python-kasa#1478) (@sdb9696)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rytilahti rytilahti rytilahti approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug Something isn't working

Projects

None yet

Milestone

0.10.1

Development

Successfully merging this pull request may close these issues.

TP-Link (KL420L5 LED strip) set to unsupported color mode brightness

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@sdb9696 @rytilahti
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.