petsafe-api 3.0.1__tar.gz → 3.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: petsafe-api
3
- Version: 3.0.1
3
+ Version: 3.0.3
4
4
  Summary: Provides ability to connect and control a PetSafe Smart Feed, Scoopfree, and Smart Door devices using the PetSafe API.
5
5
  Home-page: https://github.com/ThomasHFWright/petsafe-api
6
6
  Author: Jordan Stremming & Dominick Meglio & Thomas Wright
@@ -0,0 +1,46 @@
1
+ import sys
2
+ import argparse
3
+ import asyncio
4
+
5
+ from petsafe import PetSafeClient
6
+
7
+ # create parser for arguments
8
+ parser = argparse.ArgumentParser(
9
+ usage="python -m petsafe email [-t email_code]"
10
+ )
11
+ parser.add_argument("email", help="account email address")
12
+
13
+ # if no arguments specified, show help
14
+ if len(sys.argv) < 2:
15
+ parser.print_help()
16
+ sys.exit(1)
17
+
18
+ # parse for arguments
19
+ args = parser.parse_args()
20
+
21
+ async def main() -> None:
22
+ client = PetSafeClient(email=args.email)
23
+ await client.request_code()
24
+ print("Code requested, please check your email.")
25
+ print("")
26
+
27
+ try:
28
+ code = input("Enter email code: ")
29
+ except EOFError:
30
+ print("\nNo code entered (EOF). Exiting.")
31
+ return
32
+
33
+ await client.request_tokens_from_code(code)
34
+
35
+ print("")
36
+ print("IdToken:")
37
+ print(client.id_token)
38
+ print("")
39
+ print("AccessToken:")
40
+ print(client.access_token)
41
+ print("")
42
+ print("RefreshToken:")
43
+ print(client.refresh_token)
44
+
45
+
46
+ asyncio.run(main())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: petsafe-api
3
- Version: 3.0.1
3
+ Version: 3.0.3
4
4
  Summary: Provides ability to connect and control a PetSafe Smart Feed, Scoopfree, and Smart Door devices using the PetSafe API.
5
5
  Home-page: https://github.com/ThomasHFWright/petsafe-api
6
6
  Author: Jordan Stremming & Dominick Meglio & Thomas Wright
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="petsafe-api",
8
- version="3.0.1",
8
+ version="3.0.3",
9
9
  author="Jordan Stremming & Dominick Meglio & Thomas Wright",
10
10
  license="MIT",
11
11
  author_email="thomas.h.f.wright@gmail.com",
@@ -1,36 +0,0 @@
1
- import sys
2
- import argparse
3
-
4
- from petsafe import PetSafeClient
5
-
6
- # create parser for arguments
7
- parser = argparse.ArgumentParser(
8
- usage="python -m petsafe email [-t email_code]"
9
- )
10
- parser.add_argument("email", help="account email address")
11
-
12
- # if no arguments specified, show help
13
- if len(sys.argv) < 2:
14
- parser.print_help()
15
- sys.exit(1)
16
-
17
- # parse for arguments
18
- args = parser.parse_args()
19
-
20
- client = PetSafeClient(email=args.email)
21
- client.request_code()
22
- print("Code requested, please check your email.")
23
- print("")
24
-
25
- code = input("Enter email code: ")
26
- client.request_tokens_from_code(code)
27
-
28
- print("")
29
- print("IdToken:")
30
- print(client.id_token)
31
- print("")
32
- print("AccessToken:")
33
- print(client.access_token)
34
- print("")
35
- print("RefreshToken:")
36
- print(client.refresh_token)
File without changes
File without changes
File without changes
File without changes