Skip to content
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

API to get all service options available for setting blocked_services #4520

Closed
3 tasks done
RoboMagus opened this issue Apr 23, 2022 · 3 comments
Closed
3 tasks done

Comments

@RoboMagus
Copy link
Contributor

Have a question or an idea? Please search it on our forum to make sure it was not yet asked. If you cannot find what you had in mind, please submit it here.

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Problem Description

I'm trying to create an automatic schedule that will block / unblock specific services through the AdGuardHome API using blocked_services/set. I've been working on getting this API access in a python module so I can then call this through HomeAssistant on demand and on schedule. This works quite well, given that I've first taken a look at the blocked_services page of my local instance.
However when the set of available services would change (#3092, #3814), there is no automated way of telling.

Proposed Solution

I would propose adding another function to the blocked_services API that allows anyone using the API to get an extensive list of services available on this interface.
E.g. GET /blocked_services/services. This could then either just return a list of service names compatible with the /blocked_services/set function, or a structure that contains their ID, name, (and icon).

Alternatives Considered

Hard coding the currently available list and updating this every time the interface is updated. However that's not ideal

Additional Information

Would like to eventually further integrate AdGuardHome into HomeAssistant, by extending the python wrapper. Then having all allowed data that can be passed over the API available programmaticaly becomes even more important.

@ainar-g
Copy link
Contributor

ainar-g commented Aug 25, 2022

Merged in #4535.

@ainar-g ainar-g closed this as completed Aug 25, 2022
@NebzHB
Copy link

NebzHB commented Sep 8, 2022

Dears,
About #4535 , Is it possible to have the full name in that service list too ? example : 'ok' is displayed 'OK.ru' in the web interface ('disneyplus' : 'Disney+', ...) + Icon (if possible) as stated in Proposed Solution in first message.

or can we already use https://github.com/AdguardTeam/HostlistsRegistry/blob/main/assets/services.json ? (i don't see recently added Bilibili service in it ?!). Source : #3814 (comment)

@ainar-g
Copy link
Contributor

ainar-g commented Sep 8, 2022

@NebzHB, if you want a change in the current API, please file a new issue.

Switching to the hostlist registry is planned for the v0.108 cycle. In the meantime, you can open an issue on that repo to add the Bilibili service as well, citing the fact that AdGuard Home already has it.

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

No branches or pull requests

3 participants