Skip to content

add switch platform to fressnapf_tracker#157971

Merged
zweckj merged 1 commit into
home-assistant:devfrom
eifinger:fressnapf_tracker_switch
Dec 4, 2025
Merged

add switch platform to fressnapf_tracker#157971
zweckj merged 1 commit into
home-assistant:devfrom
eifinger:fressnapf_tracker_switch

Conversation

@eifinger
Copy link
Copy Markdown
Contributor

@eifinger eifinger commented Dec 4, 2025

Proposed change

German: Schlafmodus
Dutch: slaapmodus
French: le mode veille
Italian: la modalità notturna

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 switch platform to the fressnapf_tracker integration to control the energy saving (sleep mode) feature of GPS trackers. The switch entity is only created when the tracker supports energy saving mode, providing users with a configuration option to toggle this feature.

Key Changes

  • New switch platform implementation that controls energy saving mode via the tracker API
  • Comprehensive test coverage including entity creation, state snapshots, and turn on/off operations
  • Translations and state-based icons for the sleep mode switch

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
homeassistant/components/fressnapf_tracker/switch.py Implements the switch platform with energy saving control functionality
homeassistant/components/fressnapf_tracker/strings.json Adds "Sleep mode" translation for the switch entity
homeassistant/components/fressnapf_tracker/icons.json Adds state-based icons (sleep/sleep-off) for the switch
tests/components/fressnapf_tracker/test_switch.py Adds comprehensive tests for switch entity creation and control
tests/components/fressnapf_tracker/snapshots/test_switch.ambr Snapshot data for entity and state validation
tests/components/fressnapf_tracker/conftest.py Updates mock tracker data to include energy saving feature

Comment thread tests/components/fressnapf_tracker/test_switch.py Outdated
Comment thread tests/components/fressnapf_tracker/test_switch.py Outdated
Comment thread tests/components/fressnapf_tracker/test_switch.py Outdated
Comment thread homeassistant/components/fressnapf_tracker/switch.py Outdated
@eifinger eifinger force-pushed the fressnapf_tracker_switch branch from c1c5cef to d3b766a Compare December 4, 2025 15:35
@zweckj zweckj merged commit 0ccfd77 into home-assistant:dev Dec 4, 2025
36 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 5, 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