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

create_voucher fail #86

Open
Satzende opened this issue Apr 4, 2024 · 0 comments
Open

create_voucher fail #86

Satzende opened this issue Apr 4, 2024 · 0 comments

Comments

@Satzende
Copy link

Satzende commented Apr 4, 2024

Er kann sich einloggen aber einen voucher, kann er nicht setzen

c = Controller(host=myconf["unifi"]["ip"], version = myconf["unifi"]["version"],username=myconf["unifi"]["user"], password=myconf["unifi"]["pw"], ssl_verify=False) c.create_voucher(number="7777755555",quota="70",expire="60")

Fehler Meldung

/home/user/PycharmProjects/qrcode_unifi/venv/lib/python3.11/site-packages/urllib3/connectionpool.py:1103: InsecureRequestWarning: Unverified HTTPS request is being made to host '192.168.100.35'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
warnings.warn(
Failed to perform <function Controller._write at 0x7f073fcf7420> due to api.err.InvalidArgs
Traceback (most recent call last):
File "/home/user/PycharmProjects/qrcode_unifi/venv/lib/python3.11/site-packages/pyunifi/controller.py", line 31, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/user/PycharmProjects/qrcode_unifi/venv/lib/python3.11/site-packages/pyunifi/controller.py", line 151, in _write
return self._jsondec(response.text)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/PycharmProjects/qrcode_unifi/venv/lib/python3.11/site-packages/pyunifi/controller.py", line 120, in _jsondec
raise APIError(obj["meta"]["msg"])
pyunifi.controller.APIError: api.err.InvalidArgs

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/user/PycharmProjects/qrcode_unifi/venv/lib/python3.11/site-packages/pyunifi/controller.py", line 36, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/user/PycharmProjects/qrcode_unifi/venv/lib/python3.11/site-packages/pyunifi/controller.py", line 151, in _write
return self._jsondec(response.text)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/PycharmProjects/qrcode_unifi/venv/lib/python3.11/site-packages/pyunifi/controller.py", line 120, in _jsondec
raise APIError(obj["meta"]["msg"])
pyunifi.controller.APIError: api.err.InvalidArgs

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/user/PycharmProjects/qrcode_unifi/main.py", line 99, in
c.create_voucher(number="7777755555",quota="70",expire="60")
File "/home/user/PycharmProjects/qrcode_unifi/venv/lib/python3.11/site-packages/pyunifi/controller.py", line 832, in create_voucher
res = self._run_command(cmd, mgr="hotspot", params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/PycharmProjects/qrcode_unifi/venv/lib/python3.11/site-packages/pyunifi/controller.py", line 306, in _run_command
return self._api_write("cmd/" + mgr, params=params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/PycharmProjects/qrcode_unifi/venv/lib/python3.11/site-packages/pyunifi/controller.py", line 154, in _api_write
return self._write(self._api_url() + url, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/PycharmProjects/qrcode_unifi/venv/lib/python3.11/site-packages/pyunifi/controller.py", line 38, in wrapper
raise APIError(err)
pyunifi.controller.APIError: api.err.InvalidArgs

Process finished with exit code 1

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

1 participant