Skip to content

Conversation

bouwew
Copy link
Contributor

@bouwew bouwew commented Oct 11, 2025

Summary by CodeRabbit

  • New Features

    • Added support for the Emma device (model 170-01) in Adam setups via ZigBee.
  • Documentation

    • Changelog and README updated to document Emma support and refreshed device list entries.
    • Project version bumped to v1.8.0.
  • Tests

    • Added new test data and an end-to-end test validating Adam setups with Emma (includes firmware 3.9.0).

Copy link
Contributor

coderabbitai bot commented Oct 11, 2025

Walkthrough

Adds Emma hardware model mapping, new Adam/Anna ZigBee fixture and test dataset, a test validating the dataset connection, a changelog entry documenting v1.8.0, and bumps project version to 1.8.0. No runtime control-flow or API changes.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Replace "Ongoing" header with v1.8.0 and add an entry documenting initial support for the Emma (PR #797).
Project metadata
pyproject.toml
Bump project version from 1.7.8 to 1.8.0.
Hardware model mapping
plugwise/constants.py
Add HW_MODELS mapping entry: "170-01": "Emma".
Test fixtures and datasets
fixtures/adam_anna_new_2/data.json, tests/data/adam/adam_anna_new_2.json
Add comprehensive JSON fixtures describing Adam+Anna ZigBee devices, thermostats, switches, climate zones, schedules, and relationships for testing.
Tests
tests/test_adam.py
Add async def test_connect_adam_anna_new_2(self) to validate connection and dataset handling (firmware 3.9.0) and assert expected entity count.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Bump to v1.7.4 #741 — also updates pyproject.toml project.version; likely related to the version bump.

Suggested labels

enhancement

Suggested reviewers

  • CoMPaTech

Poem

A nibble of bytes and a twitch of ear,
Emma hops into Adam—welcome here!
Fixtures arranged in a cozy little row,
Tests hum like carrots in warm, gentle glow.
I thump my foot—build passes, joy near! 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title accurately and concisely describes the primary change, which is introducing support for the Emma device in Zigbee mode.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch emma-zigbee

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 26a09f8 and f0ccb0e.

📒 Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • README.md (1 hunks)
  • pyproject.toml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Prepare

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

codecov bot commented Oct 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ca34ffa) to head (f0ccb0e).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #797   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         3389      3400   +11     
=========================================
+ Hits          3389      3400   +11     

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/test_adam.py (1)

184-204: Expand test coverage for Emma functionality.

The basic test structure is correct and properly handles connection/disconnection. However, compared to similar tests like test_connect_adam_plus_anna_new (lines 20-182), this test lacks coverage for:

  • Thermostat operations (tinker_thermostat)
  • Schedule management (set_schedule_state)
  • Switch operations (tinker_switch)
  • Gateway mode changes
  • Updated data scenarios

Consider adding these test cases to ensure Emma's ZigBee integration works correctly across all functionality areas.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca34ffa and 26a09f8.

📒 Files selected for processing (5)
  • CHANGELOG.md (1 hunks)
  • fixtures/adam_anna_new_2/data.json (1 hunks)
  • plugwise/constants.py (1 hunks)
  • tests/data/adam/adam_anna_new_2.json (1 hunks)
  • tests/test_adam.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/test_adam.py (2)
tests/test_init.py (4)
  • load_testdata (81-90)
  • connect_wrapper (366-401)
  • device_test (480-601)
  • disconnect (453-456)
plugwise/smilecomm.py (1)
  • close_connection (148-150)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Run pytest using Python 3.13
  • GitHub Check: Run pytest using Python 3.14
🔇 Additional comments (3)
CHANGELOG.md (1)

7-7: LGTM!

The changelog entry clearly documents the new Emma ZigBee capability and aligns with the related code changes in this PR.

plugwise/constants.py (1)

53-53: LGTM!

The hardware model mapping for Emma is correctly added and follows the established pattern. The model ID "170-01" is consistently referenced in the test fixtures.

tests/data/adam/adam_anna_new_2.json (1)

1-306: LGTM with note on location reference.

The test data structure with the "devices" wrapper (line 2) is consistent with how other test data files are organized. The content matches the fixture file appropriately. The same location reference concern mentioned for fixtures/adam_anna_new_2/data.json applies here - location "8201a2ac4d1b4303bf994e18d67311eb" (line 103) is referenced but not defined as a climate/location entry.

Copy link
Member

@CoMPaTech CoMPaTech left a comment

Choose a reason for hiding this comment

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

Nothing much to add to it 👍

Copy link

@bouwew bouwew marked this pull request as ready for review October 11, 2025 14:21
@bouwew bouwew requested a review from a team as a code owner October 11, 2025 14:21
@bouwew bouwew merged commit 14a7fec into main Oct 11, 2025
18 checks passed
@bouwew bouwew deleted the emma-zigbee branch October 11, 2025 14:21
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.

2 participants