Skip to content

Conversation

bouwew
Copy link
Contributor

@bouwew bouwew commented Oct 11, 2025

Summary by CodeRabbit

  • New Features
    • Expanded entity coverage reflected in datasets (now 197 entities).
  • Tests
    • Updated expectations to match the increased entity count.
  • Chores
    • Refreshed test data with current sensor readings and states: heating/flame active, higher boiler temperatures, updated outdoor temperature, thermostat setpoints moved to comfort levels with heating active, increased energy usage and relay activity, and added battery status for a new node.
    • Normalized device identifiers and timestamps; updated power-source metadata and added battery meters where relevant.

Copy link
Contributor

coderabbitai bot commented Oct 11, 2025

Walkthrough

Refreshes the Adam/Anna test fixtures and userdata: numerous sensor values, states, MAC addresses, timestamps, and thermostat configurations updated; adds a binary_sensors section for Emma; adjusts OpenTherm readings; and updates one test expectation (entity_items 195 → 197). No schema or code logic changes.

Changes

Cohort / File(s) Summary
Adam/Anna JSON fixtures refresh
fixtures/adam_anna_new_2/data.json, tests/data/adam/adam_anna_new_2.json
Updated sensor/state values (temperatures, setpoints, humidity, energy), OpenTherm flags and readings, added Emma low_battery and battery metrics, changed active presets/control_state, updated Zigbee MACs. No structural schema changes.
Userdata domain snapshot update
userdata/adam_anna_new_2/core.domain_objects.xml
Bulk timestamp normalization, updated MAC/network identifiers, power_source corrections, revised thermostat configs (setpoints, states, bounds), refreshed measurement logs/periods; consistency updates across gateway/OpenTherm relationships.
Test expectation tweak
tests/test_adam.py
Adjusted assertion: expected entity_items count increased from 195 to 197.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • CoMPaTech

Poem

A nibble of numbers, a hop through time,
MACs now shiny, setpoints align.
Flames flicker true, thermostats cheer,
Two more entities—carrots appear! 🥕
I thump with joy in binary rhyme,
Fixtures refreshed—right on time.

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 clearly indicates that the pull request’s primary focus is on enhancing the user data fixtures to support the newly added “Emma” device, which aligns with the extensive updates to JSON and XML user data seen in the diff. It is concise, specific to the main change, and free of extraneous detail.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch emma-active-userdata

📜 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 14a7fec and fba7bc7.

📒 Files selected for processing (4)
  • fixtures/adam_anna_new_2/data.json (18 hunks)
  • tests/data/adam/adam_anna_new_2.json (18 hunks)
  • tests/test_adam.py (1 hunks)
  • userdata/adam_anna_new_2/core.domain_objects.xml (54 hunks)
🔇 Additional comments (10)
tests/test_adam.py (1)

201-201: LGTM! Entity count correctly reflects Emma's new sensors.

The assertion update from 195 to 197 entities aligns with the addition of Emma's low_battery binary sensor and battery sensor in the fixture data, accounting for the 2 new entities.

fixtures/adam_anna_new_2/data.json (4)

6-7: Fixture data refreshed to active heating state.

The OpenTherm heater binary sensors now show active heating (flame_state: true, heating_state: true), consistent with the Living room's updated control_state: "heating" and increased electricity consumption.


29-31: Emma's binary sensors added as expected.

The new binary_sensors section for Emma with low_battery: false correctly implements battery monitoring for this zone thermostat, contributing to the entity count increase validated in the test assertion.


39-42: Emma's sensor values updated consistently.

The battery level (100%), humidity (65.0%), setpoint (21.0°C), and temperature (19.5°C) align with the Living room's transition to active_preset: "home" and heating mode in the fixture data.


239-263: Living room zone state correctly reflects heating activation.

The coordinated changes—active_preset: "home", control_state: "heating", setpoint: 21.0, electricity_consumed: 64.8—represent a consistent system state where the zone has transitioned from vacation mode to active heating.

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

1-310: Test data consistent with fixture updates.

The changes in this file correctly mirror the updates in fixtures/adam_anna_new_2/data.json, maintaining data consistency across test data formats. The Emma device updates, sensor value refreshes, and state transitions are identical.

userdata/adam_anna_new_2/core.domain_objects.xml (4)

243-245: Emma's battery monitoring properly implemented in userdata.

The addition of the battery_meter service (lines 243-245) and corresponding point_log (lines 1815-1824) for Emma correctly implements battery level tracking at the domain object level, completing the battery monitoring feature added in the JSON fixtures.

Also applies to: 1815-1824


261-261: Power source correctly updated for Emma's end_device.

The change from power_source: unknown to power_source: battery accurately reflects Emma's battery-powered operation as a ZigBee end device, aligning with the device's physical characteristics.

Also applies to: 264-264


734-734: Living room zone state transition properly synchronized.

The coordinated updates—preset: home (line 734), setpoint: 21 (line 814), and control_state: heating (line 818)—correctly represent the zone's activation from vacation mode, matching the state changes in the JSON fixtures.

Also applies to: 808-820


52-52: MAC address updates maintain network topology consistency.

The ZigBee MAC address updates across all devices (coordinator, routers, end devices) are internally consistent and align with the corresponding changes in the JSON fixtures, ensuring proper device identification throughout the test data.

Also applies to: 261-261, 430-430, 872-873, 1124-1124, 1316-1316, 1665-1665, 1978-1978, 2372-2372


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

@bouwew bouwew marked this pull request as ready for review October 11, 2025 14:58
@bouwew bouwew requested a review from a team as a code owner October 11, 2025 14:58
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 (14a7fec) to head (fba7bc7).

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

☔ 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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 14a7fec and fba7bc7.

📒 Files selected for processing (4)
  • fixtures/adam_anna_new_2/data.json (18 hunks)
  • tests/data/adam/adam_anna_new_2.json (18 hunks)
  • tests/test_adam.py (1 hunks)
  • userdata/adam_anna_new_2/core.domain_objects.xml (54 hunks)
⏰ 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: Process test coverage
🔇 Additional comments (9)
tests/test_adam.py (1)

201-201: LGTM! Entity count increase aligns with Emma enhancements.

The entity count increase from 195 to 197 correctly reflects the addition of two new entities for the Emma device: the low_battery binary sensor and the battery sensor, as evidenced in the corresponding fixture updates.

fixtures/adam_anna_new_2/data.json (3)

29-31: Binary sensor addition for Emma is correctly structured.

The addition of the binary_sensors block with low_battery: false for the Emma device properly extends the device's capabilities and aligns with the test expectation increase.


6-7: OpenTherm state changes reflect active heating.

The transition of flame_state and heating_state to true, along with the increase in intended_boiler_temperature from 0.0 to 22.5, correctly simulates an active heating scenario, which is consistent with the Living room zone's state change to heating.

Also applies to: 20-21


239-240: Living room state transitions are logically consistent.

The coordinated changes in the Living room zone—active_preset from vacation to home, control_state from idle to heating, and the increase in electricity_consumed from 15.6 to 64.8—form a coherent state reflecting active heating demand.

Also applies to: 248-249, 255-263

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

1-310: Test data aligns with fixture updates.

The changes in this test data file correctly mirror the updates made to fixtures/adam_anna_new_2/data.json, maintaining consistency between the fixture and test expectations. The device states, sensor values, and MAC addresses are properly synchronized.

userdata/adam_anna_new_2/core.domain_objects.xml (4)

243-245: Battery meter service correctly added for Emma.

The addition of the battery_meter service (id='17570d84b8f14d98bc732be2d6be98aa') to Emma's module properly extends the device's monitoring capabilities and aligns with the corresponding point_log addition in the appliance section.


1815-1824: Battery point_log correctly integrated into Emma appliance.

The battery point_log has been properly added to the Emma appliance with appropriate metadata (type, unit, timestamps) and a measurement value of 1.00 (representing 100% battery), which is consistent with the JSON fixture value of 100.


52-52: MAC address updates are systematic and consistent.

The MAC addresses have been updated to the CBA0 pattern throughout the XML file, matching the changes in the JSON fixtures. The updates appear in:

  • ZigBee node definitions
  • Gateway configurations
  • Device module protocols

This systematic update maintains consistency across all fixture files.

Also applies to: 261-261, 430-430, 872-873, 1124-1124, 1316-1316, 1665-1665, 1978-1978, 2372-2372


734-734: Living room state transitions correctly reflected in XML.

The Living room location's preset changed to home and the thermostat_functionality's control_state changed to heating with setpoint updated to 21, which properly mirrors the JSON fixture changes and represents an active heating scenario.

Also applies to: 814-818

@bouwew
Copy link
Contributor Author

bouwew commented Oct 11, 2025

Replaced by #799

@bouwew bouwew closed this Oct 11, 2025
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