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

Bug: api.add_tag() takes 1 positional #59

Open
Zerka30 opened this issue Oct 4, 2023 · 1 comment
Open

Bug: api.add_tag() takes 1 positional #59

Zerka30 opened this issue Oct 4, 2023 · 1 comment

Comments

@Zerka30
Copy link

Zerka30 commented Oct 4, 2023

Hey πŸ‘‹

I think a find a new bug in this wrapper.

When I tried to add a tag using api.add_tag("test", "FF0000"), I got the following error :

vscode ➜ /workspaces/KumaCompanion (main) $ kuma tag add --name test -c "#FFFFFF"
Traceback (most recent call last):
  File "/workspaces/KumaCompanion/src/main.py", line 44, in <module>
    main()
  File "/workspaces/KumaCompanion/src/main.py", line 38, in main
    args.func(args)
  File "/workspaces/KumaCompanion/src/commands/tag/add.py", line 13, in add_tag
    api.add_tag("TEST", "#FF0000")
TypeError: UptimeKumaApi.add_tag() takes 1 positional argument but 3 were given

Here a snippet of my code :

def add_tag(args):
    # Connection to Uptime Kuma API
    api = KumaCompanion().get_api()

    # Creating a new tag
    # Add tag
    api.add_tag("TEST", "#FF0000")

Do you have any solutions ?

@obfusk
Copy link

obfusk commented Oct 4, 2023

Try using keyword arguments as per the documentation:

api.add_tag(name="TEST", color="#FF0000")

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

No branches or pull requests

2 participants