Skip to content

Next HA updates II#1082

Merged
bouwew merged 13 commits into
mainfrom
next-ha-158
Jun 6, 2026
Merged

Next HA updates II#1082
bouwew merged 13 commits into
mainfrom
next-ha-158

Conversation

@bouwew

@bouwew bouwew commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Changed required for compatibility with Core 2026.6.0.

Summary by CodeRabbit

  • New Features

    • Added diagnostics support for configuration entries
    • Added a "delete notification" service
  • Improvements

    • Improved Python 3.14 compatibility
    • Enhanced entity command error handling with clearer messages and automatic coordinator refresh
  • Code Quality

    • Simplified module setup and reduced unused imports
    • Updated configuration flow linting standard and changelog "Ongoing" entry

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Complex PR? Review this PR in Change Stack to move by importance, not file order.

Review Change Stack

Warning

Review limit reached

@bouwew, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 28 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9a7aef59-a2e3-41ee-9ad6-efbfb88dde51

📥 Commits

Reviewing files that changed from the base of the PR and between ba42cc8 and 9b692f2.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • custom_components/plugwise/manifest.json
  • hacs.json
  • pyproject.toml
📝 Walkthrough

Walkthrough

Modularizes service registration into a new services module, adds diagnostics entrypoint, updates the plugwise_command decorator, removes postponed annotation imports across modules, and updates changelog and services schema.

Changes

Plugwise Integration Service Refactor and Feature Enhancements

Layer / File(s) Summary
Service Module Extraction and Main Setup Simplification
custom_components/plugwise/services.py, custom_components/plugwise/__init__.py
New services.py module registers the delete_notification service; async_setup_entry no longer registers the service and async_setup delegates to async_setup_services. The service handler resolves the config entry, accesses entry.runtime_data coordinator, and calls coordinator.api.delete_notification().
Diagnostics Support
custom_components/plugwise/diagnostics.py
Adds async_get_config_entry_diagnostics that returns coordinator data from entry.runtime_data as the diagnostics payload.
Command Decorator Error Handling
custom_components/plugwise/util.py
Adds/updates plugwise_command decorator to await wrapped async calls, translate PlugwiseException into HomeAssistantError with translation metadata, and always call self.coordinator.async_request_refresh().
Python 3.14 Compatibility: Remove Future Annotations
custom_components/plugwise/binary_sensor.py, custom_components/plugwise/button.py, custom_components/plugwise/climate.py, custom_components/plugwise/entity.py, custom_components/plugwise/select.py, custom_components/plugwise/sensor.py, custom_components/plugwise/switch.py
Removes from __future__ import annotations from multiple modules to rely on Python 3.14 annotation behavior.
Documentation and Configuration Updates
CHANGELOG.md, custom_components/plugwise/config_flow.py, custom_components/plugwise/services.yaml, custom_components/plugwise/const.py
Adds an “Ongoing” changelog entry about Python 3.14 compatibility and moving service work to services.py; updates a pylint disable directive; adds config_entry selector field to services.yaml for delete_notification; introduces CONFIG_ENTRY constant.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • CoMPaTech
  • github-actions
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Next HA updates II' is vague and generic, using non-descriptive terminology that does not convey meaningful information about the specific changes in the changeset. Provide a more specific title that describes the main changes, such as 'Refactor service registration and remove future annotations for Core 2026.6.0 compatibility' or 'Move service setup to dedicated module'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch next-ha-158

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.

@bouwew bouwew changed the title Next HA updated II Next HA updates II Jun 4, 2026
@coderabbitai coderabbitai Bot requested a review from CoMPaTech June 4, 2026 06:11
@coderabbitai coderabbitai Bot added downstreaming Things that are changed on HA-core side and to be applied to -beta require-dev-pass Require actions to pass against HA dev-branch (and silently fail on HA master-branch) labels Jun 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@custom_components/plugwise/services.py`:
- Around line 49-50: The service schema in services.py now requires
CONF_CONFIG_ENTRY (the schema variable constructed with
vol.Required(CONF_CONFIG_ENTRY) in services.py), but the public service metadata
in custom_components/plugwise/services.yaml wasn’t updated; update services.yaml
to declare the new required "config_entry" argument (name and description, and
mark it required) so Home Assistant's service UI/docs match the actual schema
and callers see the required field.
- Around line 45-52: The service registration for plugwise.delete_notification
is incorrectly placed inside the handler function delete_notification so
async_setup_services never registers it; move the hass.services.async_register
call (using DOMAIN, SERVICE_DELETE, delete_notification, and schema with
CONF_CONFIG_ENTRY) out of the delete_notification function into the
async_setup_services setup path (or another module initialization function) so
the service is registered during integration setup rather than when the handler
is invoked.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c1bb2fa2-bdbc-4f0d-aea5-f413b3deb5e7

📥 Commits

Reviewing files that changed from the base of the PR and between a38eb62 and 20b7a9f.

📒 Files selected for processing (15)
  • CHANGELOG.md
  • custom_components/plugwise/__init__.py
  • custom_components/plugwise/binary_sensor.py
  • custom_components/plugwise/button.py
  • custom_components/plugwise/climate.py
  • custom_components/plugwise/config_flow.py
  • custom_components/plugwise/const.py
  • custom_components/plugwise/diagnostics.py
  • custom_components/plugwise/entity.py
  • custom_components/plugwise/number.py
  • custom_components/plugwise/select.py
  • custom_components/plugwise/sensor.py
  • custom_components/plugwise/services.py
  • custom_components/plugwise/switch.py
  • custom_components/plugwise/util.py
💤 Files with no reviewable changes (10)
  • custom_components/plugwise/button.py
  • custom_components/plugwise/number.py
  • custom_components/plugwise/switch.py
  • custom_components/plugwise/diagnostics.py
  • custom_components/plugwise/binary_sensor.py
  • custom_components/plugwise/select.py
  • custom_components/plugwise/climate.py
  • custom_components/plugwise/entity.py
  • custom_components/plugwise/sensor.py
  • custom_components/plugwise/util.py

Comment thread custom_components/plugwise/services.py Outdated
Comment thread custom_components/plugwise/services.py Outdated
@coderabbitai coderabbitai Bot requested a review from CoMPaTech June 4, 2026 17:06

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@custom_components/plugwise/services.yaml`:
- Around line 3-8: The delete_notification service field in services.yaml is
named "config_entry" but the service schema and handler use ATTR_CONFIG_ENTRY_ID
("config_entry_id"); rename the field in
custom_components/plugwise/services.yaml from config_entry to config_entry_id
(and adjust any selector keys accordingly) so it matches the schema used in
services.py and the call.data lookup of ATTR_CONFIG_ENTRY_ID.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 14799739-38ba-4678-aaf5-678c643f4d8a

📥 Commits

Reviewing files that changed from the base of the PR and between 71ef8cc and bd78a99.

📒 Files selected for processing (2)
  • custom_components/plugwise/services.py
  • custom_components/plugwise/services.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • custom_components/plugwise/services.py

Comment thread custom_components/plugwise/services.yaml
@bouwew bouwew marked this pull request as ready for review June 6, 2026 07:30
@bouwew bouwew requested a review from a team as a code owner June 6, 2026 07:30
@sonarqubecloud

sonarqubecloud Bot commented Jun 6, 2026

Copy link
Copy Markdown

@bouwew bouwew merged commit b39c7cd into main Jun 6, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

downstreaming Things that are changed on HA-core side and to be applied to -beta require-dev-pass Require actions to pass against HA dev-branch (and silently fail on HA master-branch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants