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 — Add WhiteLamp SmartCam module for outdoor cameras (e.g. C325WB) by ijardillier · Pull Request #1713 · python-kasa/python-kasa

Conversation

@ijardillier

@ijardillier ijardillier commented Jun 24, 2026

Copy link
Copy Markdown

New WhiteLamp module under kasa/smartcam/modules/

  • Exposes white_lamp_state (on/off toggle via reverseWhitelampStatus) and white_lamp_brightness (1-100, only if device supports it)
  • Adds Module.SmartCamWhiteLamp and Module.WhiteLamp module names
  • Adds fixture for C325WB(EU) 1.0 / 1.4.4
  • Adds unit tests in tests/smartcam/modules/test_whitelamp.py
  • Fixes fake protocol to handle reverseWhitelampStatus toggle command

Pre-commit OK
Tests : OK

Also tested with python-kasa CLI and my own Home Assistant instance with 2 C325WB cameras.

Hope all is compliant with your guidelines and nothing missing.

Sorry, something went wrong.

Uh oh!

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

All reactions
@codecov

codecov Bot commented Jun 24, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.47%. Comparing base (2a81f74) to head (1df9048).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1713      +/-   ##
==========================================
+ Coverage   93.42%   93.47%   +0.04%     
==========================================
  Files         160      161       +1     
  Lines       10091    10168      +77     
  Branches     1041     1050       +9     
==========================================
+ Hits         9428     9505      +77     
  Misses        471      471              
  Partials      192      192              

☔ View full report in Codecov by Harness.
📢 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.

rytilahti
rytilahti requested changes Jul 5, 2026
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.

Thanks for the PR @ijardillier, I have done a quick review on it. The module looks very straightforward, so this can be merged rather quickly after the issues mentioned in the comments are fixed.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread kasa/smartcam/modules/whitelamp.py Outdated
@@ -0,0 +1,96 @@
"""Module for white lamp (floodlight) controls on Tapo outdoor cameras."""

@rytilahti rytilahti Jul 5, 2026

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.

If it is a floodlight, feel free to name the class also like that, no need to keep the internal namings :-) The name of the class and the file could be simply FloodLight and floodlight.py respectively. If you want to keep the internal naming available in docstrings, you can put that in parentheses.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread kasa/smartcam/modules/whitelamp.py Outdated
Comment on lines +17 to +20
"""Implementation of white lamp controls for outdoor cameras (e.g. C325WB).

The white lamp is the built-in floodlight that can be triggered manually
or by motion events. It is distinct from the LED status indicator.

@rytilahti rytilahti Jul 5, 2026

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.

Suggested change
"""Implementation of white lamp controls for outdoor cameras (e.g. C325WB).
The white lamp is the built-in floodlight that can be triggered manually
or by motion events. It is distinct from the LED status indicator.
"""Implementation of floodlight controls for outdoor cameras.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread kasa/smartcam/modules/whitelamp.py Outdated
@@ -0,0 +1,96 @@
"""Module for white lamp (floodlight) controls on Tapo outdoor cameras."""

@rytilahti rytilahti Jul 5, 2026

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.

Suggested change
"""Module for white lamp (floodlight) controls on Tapo outdoor cameras."""
"""Module for floodlight controls ("whitelamp" module) on Tapo outdoor cameras."""

If it is a floodlight, feel free to name the class also like that, no need to keep the internal namings :-) The name of the class and the file could be simply FloodLight and floodlight.py respectively. If you want to keep the internal naming available in docstrings, you can put that in parentheses.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread kasa/smartcam/modules/whitelamp.py Outdated
Feature(
self._device,
id="white_lamp_state",
name="White lamp state",

@rytilahti rytilahti Jul 5, 2026

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.

See my comment above, these are user-interfacing names.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread kasa/smartcam/smartcammodule.py

@rytilahti rytilahti Jul 5, 2026

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.

I am not sure what is going on here, newline separator changes?

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread kasa/smartcam/modules/whitelamp.py Outdated
_LOGGER = logging.getLogger(__name__)


class WhiteLamp(SmartCamModule):

@rytilahti rytilahti Jul 5, 2026

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.

Suggested change
class WhiteLamp(SmartCamModule):
class WhiteLamp(SmartCamModule, LightInterface):

It would be nice to inherit from the lightinterface like other light modules do. This will make it also easier to integrate elsewhere.

Sorry, something went wrong.

Uh oh!

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

All reactions
@rytilahti rytilahti added the enhancement New feature or request label Jul 5, 2026
ijardillier and others added 2 commits October 17, 2026 15:58
@ijardillier Ingrid Jardillier
Add WhiteLamp SmartCam module for outdoor cameras (e.g. C325WB)
515159a
- New WhiteLamp module under kasa/smartcam/modules/
- Exposes white_lamp_state (on/off toggle via reverseWhitelampStatus)
  and white_lamp_brightness (1-100, only if device supports it)
- Adds Module.SmartCamWhiteLamp and Module.WhiteLamp module names
- Adds fixture for C325WB(EU) 1.0 / 1.4.4
- Adds unit tests in tests/smartcam/modules/test_whitelamp.py
- Fixes fake protocol to handle reverseWhitelampStatus toggle command
Ingrid Jardillier
- Fix SmartCamWhiteLamp ModuleName key from 'whiteLamp' to 'WhiteLamp'
16da3a6
  to match the class name used as key in dev.modules
- Add SmartCamModule.SmartCamWhiteLamp assertion in test_whitelamp_is_on
- Add test_whitelamp_no_brightness to cover the case where brightness
  is not supported by the device"
@ijardillier
ijardillier force-pushed the add-smartcam-whitelamp branch from 2c10b1e to 16da3a6 Compare October 17, 2026 14:25
Ingrid Jardillier
Rename WhiteLamp to FloodLight and implement the light interface
1df9048
@ijardillier

ijardillier commented Oct 17, 2026

Copy link
Copy Markdown
Author

Hi @rytilahti

Thanks for the review ans sorry for the delay!
Renamed the module to FloodLight (floodlight.py) and the features to floodlight / floodlight_brightness, applied the docstring suggestions, and made it implement the light interface.
The newline issue came from my side and is fixed by the rebase.

All reactions

Sorry, something went wrong.

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rytilahti rytilahti rytilahti requested changes

Requested changes must be addressed to merge this pull request.

Uh oh!

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

Assignees

No one assigned

Labels

enhancement New feature or request

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

2 participants

@ijardillier @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 01402520 — 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.