Skip to content

Add system health to Portainer#169698

Open
erwindouna wants to merge 2 commits intohome-assistant:devfrom
erwindouna:portainer-add-system-health
Open

Add system health to Portainer#169698
erwindouna wants to merge 2 commits intohome-assistant:devfrom
erwindouna:portainer-add-system-health

Conversation

@erwindouna
Copy link
Copy Markdown
Member

Breaking change

Proposed change

SSIA

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a System Health platform for the Portainer integration so Home Assistant can report basic connectivity status for Portainer via the System Health UI/websocket.

Changes:

  • Add homeassistant.components.portainer.system_health to expose a “can reach server” check.
  • Add Portainer System Health strings for the info label.
  • Add tests covering reachable vs unreachable Portainer server scenarios.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
homeassistant/components/portainer/system_health.py Registers Portainer’s system health callback and performs a reachability check to the Portainer API status endpoint.
homeassistant/components/portainer/strings.json Adds the system_health.info.can_reach_server label for Portainer.
tests/components/portainer/test_system_health.py Adds tests for successful and failed reachability checks.

Comment on lines +60 to +66
entry = MockConfigEntry(
domain=DOMAIN,
data=MOCK_TEST_CONFIG,
unique_id=TEST_INSTANCE_ID,
entry_id=TEST_ENTRY,
state=ConfigEntryState.LOADED,
)
Comment thread homeassistant/components/portainer/system_health.py
Comment thread tests/components/portainer/test_system_health.py Outdated
Comment thread tests/components/portainer/test_system_health.py Outdated
Comment thread tests/components/portainer/test_system_health.py Outdated
@erwindouna erwindouna marked this pull request as draft May 3, 2026 18:17
@erwindouna erwindouna marked this pull request as ready for review May 3, 2026 19:07
Copilot AI review requested due to automatic review settings May 3, 2026 19:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment on lines +24 to +27
return {
"can_reach_server": system_health.async_check_can_reach_url(
hass, f"{config_entry.data[CONF_URL].rstrip('/')}/api/system/status"
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants