Skip to content

Exception Handling and User Feedback #270

@hl2guide

Description

@hl2guide

Please improve the Exception handling in the code to help the user do troubelshooting.

Please also consider actual documenation for this package.

e.g.:

image

My code:

from adguardhome import AdGuardHome

import asyncio

ipAddress = "192.168.1.100"

async def main():
    """Show example how to get status of your AdGuard Home instance."""
    async with AdGuardHome(ipAddress) as adguard:
        version = await adguard.version()
        print("AdGuard version:", version)

        active = await adguard.protection_enabled()
        active = "Yes" if active else "No"
        print("Protection enabled?", active)

        if not active:
            print("AdGuard Home protection disabled. Enabling...")
            await adguard.enable_protection()


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions