Skip to content

Expose params field on TriggerLogs LogEntry#1697

Open
startlingdan wants to merge 1 commit into
python-kasa:masterfrom
startlingdan:expose-triggerlogs-params
Open

Expose params field on TriggerLogs LogEntry#1697
startlingdan wants to merge 1 commit into
python-kasa:masterfrom
startlingdan:expose-triggerlogs-params

Conversation

@startlingdan

Copy link
Copy Markdown

The S200B (Smart Button / dial) emits rotation events whose direction and magnitude live in params.rotate_deg (signed int, positive = clockwise, negative = anti-clockwise, magnitude in degrees). Today LogEntry strips the params field on parse, so callers can detect that a rotation happened but not which way.

Add an optional params: dict[str, Any] | None field with default None. Fully backwards compatible (existing callers unaffected; events without params get None).

Verified on a Tapo H100 firmware 1.6.1 with an S200B child: captured 9 events across singleClick and rotation types with the field exposed; params.rotate_deg populated for every rotation, absent for singleClick.

Helps #1117.

The S200B (Smart Button / dial) emits rotation events whose
direction and magnitude live in `params.rotate_deg` (signed int,
positive = clockwise, negative = anti-clockwise, magnitude in
degrees). Today `LogEntry` strips the `params` field on parse, so
callers can detect that a rotation happened but not which way.

Add an optional `params: dict[str, Any] | None` field with default
None. Fully backwards compatible (existing callers unaffected;
events without params get None).

Verified on a Tapo H100 firmware 1.6.1 with an S200B child:
captured 9 events across `singleClick` and `rotation` types with
the field exposed; `params.rotate_deg` populated for every rotation,
absent for singleClick.

Helps python-kasa#1117.
@codecov

codecov Bot commented May 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.22%. Comparing base (76d9f68) to head (3c72624).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1697   +/-   ##
=======================================
  Coverage   93.22%   93.22%           
=======================================
  Files         157      157           
  Lines        9815     9816    +1     
  Branches     1003     1003           
=======================================
+ Hits         9150     9151    +1     
  Misses        472      472           
  Partials      193      193           

☔ 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.

@rytilahti rytilahti added the enhancement New feature or request label Jul 5, 2026

@rytilahti rytilahti left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @startlingdan, the change looks straightforward, flaky CI on Windows is unrelated.

Given you know how the data looks like, could you already extract & parse it instead of passing it forward as raw data? Also, it would be great to have a fixture file showing this and tests for it.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants