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

Open
opened 2023-10-04 15:32:57 +02:00 by Zerka30 · 1 comment
Zerka30 commented 2023-10-04 15:32:57 +02:00 (Migrated from github.com)

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 ?

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 : ```py 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 : ```py 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 commented 2023-10-05 00:17:02 +02:00 (Migrated from github.com)

Try using keyword arguments as per the documentation:

api.add_tag(name="TEST", color="#FF0000")
Try using keyword arguments as per [the documentation](https://uptime-kuma-api.readthedocs.io/en/latest/api.html#uptime_kuma_api.UptimeKumaApi.add_tag): ```py api.add_tag(name="TEST", color="#FF0000") ```
Sign in to join this conversation.
No description provided.