Skip to content

Conversation

@rbeuque74
Copy link

Proposed Changes

Since AGH v0.107.28, AGH allow to disable protection for a specific duration (see AdguardTeam/AdGuardHome#1333).
This option is not present in disable_protection, hence, cannot be used in Home Assistant, using a service.
This PR introduces having an optional pause_duration_miliseconds parameter.

Related Issues

#1030

@dbensmith
Copy link

dbensmith commented Aug 23, 2025

@rbeuque74 Thank you for submitting this!

Suggest adding a label so the PR passes the first check.

According to the workflow output, valid labels are: ['breaking-change', 'bugfix', 'documentation', 'enhancement', 'refactor', 'performance', 'new-feature', 'maintenance', 'ci', 'dependencies']

Maybe enhancement or new-feature?

@rbeuque74
Copy link
Author

@dbensmith in my understanding, @frenck configured the repository as only the maintainers can change the labels on pull requests.
I have no way on my side to add the required labels.

Or there is some automations based on commit message/pull request description that auto set the labels ? 🤷

@github-actions

This comment was marked as resolved.

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Sep 23, 2025
@rbeuque74
Copy link
Author

Hello
Still valid, still waiting for label to be applied for the CI to run

@github-actions github-actions bot removed the stale There has not been activity on this issue or PR for quite some time. label Sep 24, 2025
@github-actions

This comment was marked as resolved.

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Oct 24, 2025
@dbensmith

This comment was marked as resolved.

@rbeuque74

This comment was marked as resolved.

@github-actions github-actions bot removed the stale There has not been activity on this issue or PR for quite some time. label Oct 25, 2025
@frenck frenck changed the title feat: add disable protection for a specific duration Add disable protection for a specific duration Nov 15, 2025
@frenck frenck added the new-feature New features or options. label Nov 15, 2025
@frenck frenck requested a review from Copilot November 15, 2025 09:06
@codecov
Copy link

codecov bot commented Nov 15, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.41%. Comparing base (11f5f58) to head (35c4445).
⚠️ Report is 716 commits behind head on main.

Files with missing lines Patch % Lines
src/adguardhome/adguardhome.py 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main    #1573      +/-   ##
===========================================
- Coverage   100.00%   99.41%   -0.59%     
===========================================
  Files            9       10       +1     
  Lines          316      339      +23     
  Branches        26       17       -9     
===========================================
+ Hits           316      337      +21     
- Partials         0        2       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 support for temporarily disabling AdGuard Home protection for a specific duration, aligning with functionality introduced in AdGuard Home v0.107.28. The implementation updates both the API endpoint and payload format to use the newer /control/protection endpoint.

Key Changes:

  • Added optional pause_duration_miliseconds parameter to disable_protection() method
  • Updated API endpoints from /control/dns_config to /control/protection for both enable and disable operations
  • Updated JSON payload format from protection_enabled to enabled key
  • Fixed typo in test function name (test_veriontest_version)

Reviewed Changes

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

File Description
src/adguardhome/adguardhome.py Adds optional duration parameter to disable_protection(), updates API endpoint and payload format for protection methods
tests/test_adguardhome.py Updates test mocks to use new /control/protection endpoint and fixes test function name typo

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Owner

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Oh hi there @rbeuque74 👋

Thanks for the pull request. I think Copilot has raised a few valid concerns in the above review. Could you take a look?

Thanks! 👍

../Frenck

                       

Blogging my personal ramblings at frenck.dev

@frenck frenck marked this pull request as draft November 15, 2025 11:51
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rbeuque74 rbeuque74 force-pushed the disable-protection-duration branch from 9517fd8 to 842848b Compare November 30, 2025 09:58
@rbeuque74 rbeuque74 requested review from Copilot and frenck November 30, 2025 10:15
@rbeuque74 rbeuque74 marked this pull request as ready for review November 30, 2025 10:15
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rbeuque74 rbeuque74 force-pushed the disable-protection-duration branch from 842848b to e7bc299 Compare November 30, 2025 10:27
@rbeuque74 rbeuque74 requested a review from Copilot November 30, 2025 10:27
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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rbeuque74
Copy link
Author

Hey @frenck,
Thanks for your message, I addressed all comments from Copilot 👍

Romain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New features or options.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants