-
-
Notifications
You must be signed in to change notification settings - Fork 39
Add client resources #694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add client resources #694
Conversation
- added getters for the list of client / autoclient / supported tags resources
- docstrings everywhere - removed some imports I'd missed
Fixed by using RFC 5737 compliant test range IPs (as an aside, how dumb is it that the scanner couldn't tell this was test code?)
|
Kudos, SonarCloud Quality Gate passed!
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
I'll ping too. Please test/merge this. I'd like to use it upstream with HomeAssistant |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Kudos, SonarCloud Quality Gate passed!
|
I hate to bring it to you, but if you goal is to use this in Home Assistant: You can't. To make this possible, we need an identifier. A request for this is open @ the AdGuard Home team. So, if that is your only goal, I suggest closing this PR as it has no foreseeing future. |
|
Nope, I'm using this for scripting independent of HA. |
|
Sorry I now realize I responded to a non-author, sorry about that 👍 ../Frenck |
|
Okay; I'll add update methods here as well and then update the PR. Thanks. |
This comment was marked as resolved.
This comment was marked as resolved.
|
I'm still interested in merging this, just haven't had the time to finish it up. |
|
Kudos, SonarCloud Quality Gate passed!
|
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
|
I am still interested in merging this, I just need the maintainer to okay it. |
This comment was marked as resolved.
This comment was marked as resolved.
|
@frenck if you are not interested in maintaining this -- and that's entirely fair! -- how about discussing handing it off? I'm interested and willing. |
I am, sorry. I don't see the use case for Home Assistant in this regard (which is the primary use of this library).
Because I haven't merged your itch? 🤷 Sorry, nope. |
|
So, for clarity, this isn't a "Python" adguard client, it is a home assistant adguard client library that happens to be written in Python? |
|
Mostly I'd like to know if this is considered a general purpose client library for the Adguard API, with features that are usable outside of HA, or if additions will purely be considered in the context of whether they are usable for HA. I've got some decisions to make about how I use it depending on that. The README indicates that home assistant is an example of an integration, not the only one that matters. Can you clarify please? |
There was a problem hiding this 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 AdGuard Home Client resources, enabling retrieval of automatically discovered clients (AutoClients), manually configured clients (Clients), and supported tags through a new Clients resource facade.
- Introduces three dataclasses (
WhoisInfo,AutoClient,Client) to represent client data structures - Adds a
Clientsresource facade with methods to fetch auto clients, configured clients, and supported tags - Integrates the Clients resource into the main
AdGuardHomeclass
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 17 comments.
| File | Description |
|---|---|
| src/adguardhome/client.py | Implements the new Clients resource facade with dataclasses and methods for retrieving client information from the AdGuard Home API |
| src/adguardhome/adguardhome.py | Adds a clients property to the AdGuardHome class for accessing the Clients resource |
| tests/test_client.py | Provides comprehensive test coverage for the new client resource methods including empty lists, auto clients, and configured clients |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
frenck
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, let's move this one forward.
However, the are some issues raised by the Copilot review and by the CI (which is failing).
Could you take a look?
../Frenck
Blogging my personal ramblings at frenck.dev
1735801 to
cf158ef
Compare
There was a problem hiding this 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 3 out of 3 changed files in this pull request and generated 16 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cf158ef to
49fad81
Compare
49fad81 to
a54f118
Compare
There was a problem hiding this 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 3 out of 4 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/adguardhome/client.py
Outdated
| from __future__ import annotations | ||
|
|
||
| from dataclasses import dataclass | ||
| from typing import TYPE_CHECKING, Any, Mapping |
Copilot
AI
Jan 1, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import of 'Mapping' is not used.
| from typing import TYPE_CHECKING, Any, Mapping | |
| from typing import TYPE_CHECKING, Any |
- numpy-style comments - removed ic() - clearer typing
a54f118 to
8992269
Compare
|
Just saw this in the morass of notifications; I've addressed the changes. I elected not to rebase on top of main in order to avoid patch churn. Hopefully this works. |









Proposed Changes
Adding support for the Client / AutoClient resources in AdGuard Home
The first commit here is to open discussion on structure and naming; if this is desirable in this state, I will add the update operations to it as well.
I don't intend to get super clever with remote ORM stuff here; I only want to have simple "add", "update", "delete" methods for them that refer to the APIs directly.
Related Issues