Skip to content

Release v2.6.0 - #13

Merged
telard-pixel merged 3 commits into
mainfrom
dev
Jun 14, 2026
Merged

Release v2.6.0#13
telard-pixel merged 3 commits into
mainfrom
dev

Conversation

@telard-pixel

@telard-pixel telard-pixel commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Automated release PR for v2.6.0.

Summary by CodeRabbit

Release Notes

  • Dependencies

    • Updated pyhon library dependency to version 2.6.0
  • Improvements

    • Enhanced appliance statistics handling to ensure proper tracking of program counters and cycle counts
    • Appliances now reliably load and merge statistics data during refresh cycles
    • Improved attribute resolution to fallback to statistics when primary sources are unavailable

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e4c9775d-f320-4385-a7e7-af0f79044c5d

📥 Commits

Reviewing files that changed from the base of the PR and between 32bdad4 and 1ac865c.

📒 Files selected for processing (6)
  • .gitignore
  • custom_components/haier_hon/base_entity.py
  • custom_components/haier_hon/hon_client.py
  • custom_components/haier_hon/manifest.json
  • tests/test_program_select.py
  • tests/test_sensor_per_type.py

📝 Walkthrough

Walkthrough

HonClient now conditionally calls load_statistics() after a successful update() and includes a statistics field in coordinator snapshots. HonBaseEntity._get_attr gains a _statistics property and a new fallback stage that resolves attributes from statistics before existing prefix-based logic. programsCounter is added to tracked consumption attributes, the pyhon dependency is bumped to 2.6.0, and two new tests cover the statistics loading and entity reading paths.

Changes

Statistics Integration

Layer / File(s) Summary
HonClient statistics loading and snapshot
custom_components/haier_hon/hon_client.py
programsCounter added to _CONSUMPTION_ATTRS; _update_appliance_sync conditionally calls load_statistics() after update() returns non-empty attributes, with reauth/retry error handling, skipping the generic fallback; async_get_appliances_data adds a statistics field to each appliance entry.
HonBaseEntity statistics property and _get_attr fallback
custom_components/haier_hon/base_entity.py
New _statistics property reads the appliance statistics dict from coordinator.data; _get_attr gains a statistics lookup stage (direct key + dotted-path traversal, value normalization, debug logging) inserted before the existing settings/startProgram prefix handling.
Tests, manifest bump, and gitignore
tests/test_program_select.py, tests/test_sensor_per_type.py, custom_components/haier_hon/manifest.json, .gitignore
New GetAttributesStatisticsTest method asserts load_statistics() is invoked and programsCounter is surfaced via _get_attributes even when attributes are already populated; new sensor test asserts td-1_total_washes reads native_value from statistics.programsCounter; pyhon bumped to 2.6.0; /diagnostics/ excluded from git.

Sequence Diagram(s)

sequenceDiagram
    participant Coordinator
    participant HonClient
    participant Appliance
    participant HonBaseEntity

    Coordinator->>HonClient: _update_appliance_sync(appliance)
    HonClient->>Appliance: update()
    Appliance-->>HonClient: attributes (non-empty)
    HonClient->>Appliance: load_statistics()
    Appliance-->>HonClient: statistics populated
    HonClient-->>Coordinator: snapshot includes statistics field

    Coordinator->>HonBaseEntity: state update triggered
    HonBaseEntity->>HonBaseEntity: _get_attr(key)
    HonBaseEntity->>HonBaseEntity: check _statistics[key]
    HonBaseEntity-->>HonBaseEntity: return normalized value from statistics
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • telard-pixel/haier_hon#11: Refactors TD sensors to read programsCounter and adds tests for that behavior — directly related to the statistics-based attribute resolution introduced here.
  • telard-pixel/haier_hon#8: Changes hon_client.py and tests/test_program_select.py to merge appliance statistics so sensor/consumption attributes are derived from statistics — the same integration path extended in this PR.

Poem

🐇 Hop, hop, stats are here at last,
The programsCounter found so fast!
When attributes are empty or bare,
Statistics data fills the air.
With pyhon bumped to 2.6,
This bunny's counting all the spins! 🧺

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Release v2.6.0' accurately reflects the PR objective as an automated release PR consolidating v2.6.0 changes into the main branch.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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

@telard-pixel
telard-pixel merged commit d2fe413 into main Jun 14, 2026
9 checks passed
tis24dev added a commit that referenced this pull request Jun 23, 2026
#3: the watchdog rebuild (_start + _subscribe_appliances) sat outside try/except
in 'while True', so a transient error (load_aws_token 5xx, subscribe timeout)
ended the task and left realtime dead until a reload. Wrap the loop body: re-raise
asyncio.CancelledError FIRST (stop() cancels+awaits the task, so swallowing it
would deadlock shutdown), and on any other error log a WARNING (exc_info) and keep
looping with an additive backoff (capped at 60s, reset on recovery) so a persistent
5xx is not hammered every tick.

#13: _subscribe used a blocking awscrt future .result(_SUBSCRIBE_TIMEOUT), freezing
the hon_loop up to 10s per topic. Make _subscribe/_subscribe_appliances async and
await asyncio.wait_for(asyncio.wrap_future(future), _SUBSCRIBE_TIMEOUT) instead,
yielding the loop while keeping the order and the timeout bound. Also use the
null-tolerant _subscribed_topics() helper.

Tests: watchdog survives a raising _start, propagates CancelledError, backoff
grows/resets/caps; subscribe preserves order, yields the loop, honours the timeout.
tis24dev added a commit that referenced this pull request Jun 23, 2026
#3: the watchdog rebuild (_start + _subscribe_appliances) sat outside try/except
in 'while True', so a transient error (load_aws_token 5xx, subscribe timeout)
ended the task and left realtime dead until a reload. Wrap the loop body: re-raise
asyncio.CancelledError FIRST (stop() cancels+awaits the task, so swallowing it
would deadlock shutdown), and on any other error log a WARNING (exc_info) and keep
looping with an additive backoff (capped at 60s, reset on recovery) so a persistent
5xx is not hammered every tick.

#13: _subscribe used a blocking awscrt future .result(_SUBSCRIBE_TIMEOUT), freezing
the hon_loop up to 10s per topic. Make _subscribe/_subscribe_appliances async and
await asyncio.wait_for(asyncio.wrap_future(future), _SUBSCRIBE_TIMEOUT) instead,
yielding the loop while keeping the order and the timeout bound. Also use the
null-tolerant _subscribed_topics() helper.

Tests: watchdog survives a raising _start, propagates CancelledError, backoff
grows/resets/caps; subscribe preserves order, yields the loop, honours the timeout.
tis24dev added a commit that referenced this pull request Jun 23, 2026
#3: the watchdog rebuild (_start + _subscribe_appliances) sat outside try/except
in 'while True', so a transient error (load_aws_token 5xx, subscribe timeout)
ended the task and left realtime dead until a reload. Wrap the loop body: re-raise
asyncio.CancelledError FIRST (stop() cancels+awaits the task, so swallowing it
would deadlock shutdown), and on any other error log a WARNING (exc_info) and keep
looping with an additive backoff (capped at 60s, reset on recovery) so a persistent
5xx is not hammered every tick.

#13: _subscribe used a blocking awscrt future .result(_SUBSCRIBE_TIMEOUT), freezing
the hon_loop up to 10s per topic. Make _subscribe/_subscribe_appliances async and
await asyncio.wait_for(asyncio.wrap_future(future), _SUBSCRIBE_TIMEOUT) instead,
yielding the loop while keeping the order and the timeout bound. Also use the
null-tolerant _subscribed_topics() helper.

Tests: watchdog survives a raising _start, propagates CancelledError, backoff
grows/resets/caps; subscribe preserves order, yields the loop, honours the timeout.
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