Fix update_available when it is disabled#1680
Merged
frenck merged 1 commit intofrenck:mainfrom Nov 16, 2025
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1680 +/- ##
===========================================
- Coverage 100.00% 99.70% -0.30%
===========================================
Files 9 10 +1
Lines 316 341 +25
Branches 26 16 -10
===========================================
+ Hits 316 340 +24
- Partials 0 1 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where the AdGuardHome client couldn't properly handle API responses when auto-update is disabled (common in Docker installations). When updates are disabled, the API returns only {"disabled": true} without the other update-related fields.
- Modified
AdGuardHomeAvailableUpdatedataclass to makenew_version,announcement,announcement_url, andcan_autoupdateoptional withNonedefaults - Added comprehensive test coverage for the disabled update scenario
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/adguardhome/update.py | Updated dataclass fields to be optional (except disabled), allowing proper instantiation when API returns minimal response |
| tests/test_update.py | Added test case to verify correct handling of disabled auto-update scenario |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
frenck
approved these changes
Nov 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
on docker installation types, the auto update mechanism is disabled via cli option (see here), but this results in a response, that only contains the
disabledkey, so we need to default all other properties toNonerelated error (it's on my dev, but PR for HA is incoming)
Related Issues