Skip to content

Commit

Permalink
Fixed: error by adding new methods("httpclient.html") for Wi-Fi login…
Browse files Browse the repository at this point in the history
…/logout functionality
  • Loading branch information
worldofvarun committed Dec 22, 2023
1 parent 503feee commit 469163b
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/puwifi.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions src/puwifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
class WifiUtils:
"""class for wifi utils"""

method_login = method_logout = "httpclient.html"

def __init__(self):
pass

Expand Down Expand Up @@ -78,7 +80,7 @@ def pw_request(self,
response(xml data returned form server)
status_code(web request status code)
"""
url = "http://"+host+":"+port+"/"+method
url = f"http://{host}:{port}/{method}"
logging.info(url)

body_arg_passwd = f"&password={password}" if mode == "191" else ""
Expand Down Expand Up @@ -130,7 +132,7 @@ def login(self,
password,
host,
port="8090",
method="login.xml",
method=method_login,
timeout=10) -> list:
"""login: uses request method to send login web request with credentials to wifi host
Expand All @@ -151,7 +153,7 @@ def logout(self,
username,
host,
port="8090",
method="logout.xml",
method=method_logout,
timeout=10) -> list:
"""logout: uses request method to send logout web request with credentials to wifi host
Expand Down

0 comments on commit 469163b

Please sign in to comment.