Skip to content

Add sensor platform to fressnapf_tracker#157658

Merged
joostlek merged 6 commits into
home-assistant:devfrom
eifinger:fressnapf_tracker_sensor
Dec 2, 2025
Merged

Add sensor platform to fressnapf_tracker#157658
joostlek merged 6 commits into
home-assistant:devfrom
eifinger:fressnapf_tracker_sensor

Conversation

@eifinger
Copy link
Copy Markdown
Contributor

@eifinger eifinger commented Dec 1, 2025

Proposed change

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

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 link to the changelog, or at minimum a diff between library versions 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

This PR adds a battery sensor platform to the Fressnapf Tracker integration, complementing the existing device tracker functionality. The sensor monitors the battery percentage of GPS pet trackers.

Key Changes

  • Added a new sensor platform for battery level monitoring
  • Created a reusable entity base class to reduce code duplication
  • Refactored test infrastructure to support multiple platforms with proper platform isolation

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
homeassistant/components/fressnapf_tracker/__init__.py Added Platform.SENSOR to the PLATFORMS list to enable sensor setup
homeassistant/components/fressnapf_tracker/sensor.py Implemented the sensor platform with battery entity support using coordinator pattern
homeassistant/components/fressnapf_tracker/entity.py Added FressnapfTrackerEntity base class to handle entity descriptions and unique ID generation for sensor entities
homeassistant/components/fressnapf_tracker/strings.json Added translation configuration for the battery sensor using standard battery component key
tests/components/fressnapf_tracker/test_sensor.py Created comprehensive snapshot tests for the new sensor platform
tests/components/fressnapf_tracker/test_device_tracker.py Refactored to isolate device tracker platform testing and extract common device snapshot logic
tests/components/fressnapf_tracker/__init__.py Added reusable snapshot_devices helper function to reduce test code duplication
tests/components/fressnapf_tracker/snapshots/test_sensor.ambr Added snapshot data for entity and device registry verification

Comment thread homeassistant/components/fressnapf_tracker/sensor.py Outdated
Comment thread homeassistant/components/fressnapf_tracker/sensor.py Outdated
Comment thread homeassistant/components/fressnapf_tracker/entity.py Outdated
Comment thread homeassistant/components/fressnapf_tracker/sensor.py Outdated
Comment thread homeassistant/components/fressnapf_tracker/sensor.py Outdated
Comment thread homeassistant/components/fressnapf_tracker/sensor.py Outdated
Comment thread tests/components/fressnapf_tracker/__init__.py Outdated
@home-assistant home-assistant Bot marked this pull request as draft December 2, 2025 12:56
@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented Dec 2, 2025

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@eifinger eifinger marked this pull request as ready for review December 2, 2025 14:03
@home-assistant home-assistant Bot requested a review from joostlek December 2, 2025 14:03
Comment thread homeassistant/components/fressnapf_tracker/sensor.py Outdated
Comment thread homeassistant/components/fressnapf_tracker/sensor.py Outdated
@joostlek joostlek merged commit c866dc9 into home-assistant:dev Dec 2, 2025
36 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants