fiftyfive 0.3.0__tar.gz → 0.4.0__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.
- {fiftyfive-0.3.0 → fiftyfive-0.4.0}/PKG-INFO +3 -3
- {fiftyfive-0.3.0 → fiftyfive-0.4.0}/README.md +2 -2
- {fiftyfive-0.3.0 → fiftyfive-0.4.0}/example.py +2 -2
- {fiftyfive-0.3.0 → fiftyfive-0.4.0}/fiftyfive/api.py +14 -2
- {fiftyfive-0.3.0 → fiftyfive-0.4.0}/pyproject.toml +1 -1
- {fiftyfive-0.3.0 → fiftyfive-0.4.0}/.github/workflows/release.yaml +0 -0
- {fiftyfive-0.3.0 → fiftyfive-0.4.0}/.gitignore +0 -0
- {fiftyfive-0.3.0 → fiftyfive-0.4.0}/LICENSE +0 -0
- {fiftyfive-0.3.0 → fiftyfive-0.4.0}/fiftyfive/__init__.py +0 -0
- {fiftyfive-0.3.0 → fiftyfive-0.4.0}/fiftyfive/decorators.py +0 -0
- {fiftyfive-0.3.0 → fiftyfive-0.4.0}/fiftyfive/models.py +0 -0
- {fiftyfive-0.3.0 → fiftyfive-0.4.0}/fiftyfive/requests.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fiftyfive
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Python 3 package to retrieve EV charger data from 50five
|
|
5
5
|
Project-URL: Homepage, https://github.com/Crazy-Duck/fiftyfive
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/Crazy-Duck/fiftyfive/issues
|
|
@@ -29,14 +29,14 @@ pip3 install fiftyfive
|
|
|
29
29
|
import asyncio
|
|
30
30
|
|
|
31
31
|
from aiohttp import ClientSession
|
|
32
|
-
from fiftyfive import Api, Market, NetworkOverview
|
|
32
|
+
from fiftyfive import Api, CustomerType, Market, NetworkOverview
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
async def main():
|
|
36
36
|
"""Main module"""
|
|
37
37
|
|
|
38
38
|
async with ClientSession() as session:
|
|
39
|
-
api = Api(session, "email", "password", Market.BELUX,
|
|
39
|
+
api = Api(session, "email", "password", Market.BELUX, CustomerType.FORMER_SHELL)
|
|
40
40
|
|
|
41
41
|
result = await api.make_requests([NetworkOverview()])
|
|
42
42
|
print(result)
|
|
@@ -14,14 +14,14 @@ pip3 install fiftyfive
|
|
|
14
14
|
import asyncio
|
|
15
15
|
|
|
16
16
|
from aiohttp import ClientSession
|
|
17
|
-
from fiftyfive import Api, Market, NetworkOverview
|
|
17
|
+
from fiftyfive import Api, CustomerType, Market, NetworkOverview
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
async def main():
|
|
21
21
|
"""Main module"""
|
|
22
22
|
|
|
23
23
|
async with ClientSession() as session:
|
|
24
|
-
api = Api(session, "email", "password", Market.BELUX,
|
|
24
|
+
api = Api(session, "email", "password", Market.BELUX, CustomerType.FORMER_SHELL)
|
|
25
25
|
|
|
26
26
|
result = await api.make_requests([NetworkOverview()])
|
|
27
27
|
print(result)
|
|
@@ -9,7 +9,7 @@ from sys import stdout
|
|
|
9
9
|
from aiohttp import ClientSession
|
|
10
10
|
from dotenv import load_dotenv
|
|
11
11
|
|
|
12
|
-
from fiftyfive import Api, Market, NetworkOverview, Overview
|
|
12
|
+
from fiftyfive import Api, CustomerType, Market, NetworkOverview, Overview
|
|
13
13
|
|
|
14
14
|
load_dotenv()
|
|
15
15
|
|
|
@@ -18,7 +18,7 @@ async def main():
|
|
|
18
18
|
"""Main module"""
|
|
19
19
|
|
|
20
20
|
async with ClientSession() as session:
|
|
21
|
-
api = Api(session, getenv("50FIVE_EMAIL"), getenv("50FIVE_PASSWORD"), Market.BELUX)
|
|
21
|
+
api = Api(session, getenv("50FIVE_EMAIL"), getenv("50FIVE_PASSWORD"), Market.BELUX, CustomerType.FORMER_SHELL)
|
|
22
22
|
|
|
23
23
|
networks = await api.make_requests([NetworkOverview()])
|
|
24
24
|
networks[0] += networks[0]
|
|
@@ -19,17 +19,29 @@ class Market(StrEnum):
|
|
|
19
19
|
UK = "uk"
|
|
20
20
|
|
|
21
21
|
|
|
22
|
+
class CustomerType(StrEnum):
|
|
23
|
+
"""Enum type for customers."""
|
|
24
|
+
|
|
25
|
+
FIFTYFIVE = "fiftyfive"
|
|
26
|
+
FORMER_SHELL = "shell"
|
|
27
|
+
|
|
28
|
+
|
|
22
29
|
class Api:
|
|
23
30
|
"""Class to make API requests"""
|
|
24
31
|
|
|
25
32
|
def __init__(
|
|
26
|
-
self,
|
|
33
|
+
self,
|
|
34
|
+
session: ClientSession,
|
|
35
|
+
email: str,
|
|
36
|
+
password: str,
|
|
37
|
+
market: Market,
|
|
38
|
+
customer_type=CustomerType.FORMER_SHELL,
|
|
27
39
|
):
|
|
28
40
|
"""Initilaize the session."""
|
|
29
41
|
self.session = session
|
|
30
42
|
self.email = email
|
|
31
43
|
self.password = password
|
|
32
|
-
self.url = f"https://50five{'-s' if
|
|
44
|
+
self.url = f"https://50five{'-s' if customer_type == CustomerType.FORMER_SHELL else ''}{market}.evc-net.com"
|
|
33
45
|
self.api = f"{self.url}/api/ajax"
|
|
34
46
|
self.logger = logging.getLogger("50five")
|
|
35
47
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|