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
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.22%. Comparing base (76d9f68) to head (3c72624).

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant