Skip to content

Conversation

@lesliefdo08
Copy link

Proposed change

This PR adds diagnostics support to the SensorPush integration. SensorPush devices are popular temperature and humidity monitors, and diagnostics will help users troubleshoot when their sensor data isn't updating as expected.

With diagnostics enabled, users can easily see the connection state and coordinator status, which is especially useful when sensors are placed at the edge of Bluetooth range.

Type of change

  • New feature (non-breaking change which adds functionality)

Additional information

The diagnostics data includes:

  • Configuration entry information (sensitive data is redacted)
  • Coordinator update status
  • Device availability information

This should help identify whether issues are due to connection problems or other factors.

Checklist

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works.

@home-assistant
Copy link

home-assistant bot commented Oct 7, 2025

Hey there @bdraco, mind taking a look at this pull request as it has been labeled with an integration (sensorpush) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of sensorpush can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign sensorpush Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

Copy link
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

This PR adds diagnostics support to the SensorPush integration to help users troubleshoot connectivity and sensor data issues. The diagnostics feature exposes configuration entry information and coordinator status, which is particularly useful for Bluetooth-based sensors that may experience range-related connectivity problems.

Key changes:

  • Implements diagnostics endpoint with coordinator status and configuration data
  • Adds comprehensive test coverage with snapshot testing
  • Creates reusable test fixtures for the SensorPush integration

Reviewed Changes

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

File Description
homeassistant/components/sensorpush/diagnostics.py Implements the diagnostics endpoint with data redaction for sensitive information
tests/components/sensorpush/test_diagnostics.py Adds test coverage for the diagnostics functionality using snapshot assertions
tests/components/sensorpush/snapshots/test_diagnostics.ambr Snapshot file capturing expected diagnostics output structure
tests/components/sensorpush/conftest.py Adds mock config entry fixture for testing

Comment on lines 9 to 14
from homeassistant.const import CONF_UNIQUE_ID
from homeassistant.core import HomeAssistant

from .const import DOMAIN

CONF_TITLE = "title"
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

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

Use constants from homeassistant.const instead of defining custom constants. CONF_TITLE should be imported from homeassistant.const where it's already defined as a standard configuration key.

Suggested change
from homeassistant.const import CONF_UNIQUE_ID
from homeassistant.core import HomeAssistant
from .const import DOMAIN
CONF_TITLE = "title"
from homeassistant.const import CONF_UNIQUE_ID, CONF_TITLE
from homeassistant.core import HomeAssistant
from .const import DOMAIN

Copilot uses AI. Check for mistakes.
@epenet epenet marked this pull request as draft October 7, 2025 13:49
@epenet
Copy link
Contributor

epenet commented Oct 7, 2025

As a new contributor, I suggest that you keep all diagnostic PRs but one in "draft" until at least the first one has been accepted and merged, then apply corresponding reviews to the other PRs before marking them as ready for review.

@lesliefdo08 lesliefdo08 force-pushed the add-sensorpush-diagnostics branch from f37d384 to 0f2582c Compare October 9, 2025 16:41
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.

3 participants