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

Error in Documentation of list_management.batch_delete_lists() (probably PiHole Bug) #2

Closed
muller2002 opened this issue Mar 17, 2025 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@muller2002
Copy link
Contributor

In function list_management.batch_delete_lists() it is told, that the keys "address" and "type" are required, but in realltiy it is "item" and "type".

I am really sure, that this is due to a bug in PiHole, see: pi-hole/FTL#2377

I am not sure, if waiting for an fix in PiHole or changing the documentation (or altering the "address" to "item" in the function is the best to do here.

@sbarbett
Copy link
Owner

Yeah, that's definitely not documented properly. I suspect that they will want to change the docs to specify the field as "item" vs changing it to "address," but I'd like to see how they respond to the issue before making any changes.

@sbarbett sbarbett self-assigned this Mar 18, 2025
@sbarbett sbarbett added the bug Something isn't working label Mar 18, 2025
@DL6ER
Copy link

DL6ER commented Mar 18, 2025

Yes, we will fix the API docs.

@DL6ER
Copy link

DL6ER commented Mar 18, 2025

pi-hole/FTL#2379

@sbarbett
Copy link
Owner

I fixed the stream comment that describes the list object structure.

    def batch_delete_lists(self, lists):
        """
        Delete multiple lists.

        :param lists: List of dictionaries with keys "item" and "type".
                      Example: [{"item": "https://example.com/blocklist.txt", "type": "block"}]
        """
        if not isinstance(lists, list):
            raise ValueError("lists must be a list of dictionaries.")

        return self.connection.post("lists:batchDelete", data=lists)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants