fiftyfive 0.2.0__tar.gz → 0.3.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fiftyfive
3
- Version: 0.2.0
3
+ Version: 0.3.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
@@ -36,7 +36,7 @@ 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, was_shell=True)
40
40
 
41
41
  result = await api.make_requests([NetworkOverview()])
42
42
  print(result)
@@ -49,7 +49,8 @@ if __name__ == "__main__":
49
49
 
50
50
  ## WARNING
51
51
 
52
- 50five uses separate endpoints depending on the market (belux, nl, de, ...). As
53
- I myself only have access to an account in the belux market, I cannot do any
54
- testing/reverse engineering on the other markets, so I can't give any guarantee
55
- anything will work for accounts in them.
52
+ 50five uses separate endpoints depending on the market (belux, nl, de, ...) as
53
+ well as whether or not you were migrated over from Shell Recharge. As I myself
54
+ only have access to an account in the belux market as an ex-Shell customer, I
55
+ cannot do any testing/reverse engineering on the other markets, so I can't give
56
+ any guarantee anything will work for accounts in them.
@@ -21,7 +21,7 @@ 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, was_shell=True)
25
25
 
26
26
  result = await api.make_requests([NetworkOverview()])
27
27
  print(result)
@@ -34,7 +34,8 @@ if __name__ == "__main__":
34
34
 
35
35
  ## WARNING
36
36
 
37
- 50five uses separate endpoints depending on the market (belux, nl, de, ...). As
38
- I myself only have access to an account in the belux market, I cannot do any
39
- testing/reverse engineering on the other markets, so I can't give any guarantee
40
- anything will work for accounts in them.
37
+ 50five uses separate endpoints depending on the market (belux, nl, de, ...) as
38
+ well as whether or not you were migrated over from Shell Recharge. As I myself
39
+ only have access to an account in the belux market as an ex-Shell customer, I
40
+ cannot do any testing/reverse engineering on the other markets, so I can't give
41
+ any guarantee anything will work for accounts in them.
@@ -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, NetworkOverviewDetails, Channel
12
+ from fiftyfive import Api, Market, NetworkOverview, Overview, Channel
13
13
 
14
14
  load_dotenv()
15
15
 
@@ -20,17 +20,18 @@ async def main():
20
20
  async with ClientSession() as session:
21
21
  api = Api(session, getenv("50FIVE_EMAIL"), getenv("50FIVE_PASSWORD"), Market.BELUX)
22
22
 
23
- result = await api.make_requests([NetworkOverview()])
24
- print(result)
23
+ networks = await api.make_requests([NetworkOverview()])
24
+ networks[0] += networks[0]
25
25
 
26
26
  details = await api.make_requests(
27
27
  [
28
- NetworkOverviewDetails([Channel(charger["IDX"], charger["CHANNEL"])])
29
- for charger in result[0]
28
+ Overview(network["IDX"])
29
+ for network in networks[0]
30
30
  ]
31
31
  )
32
32
 
33
- [print(d) for d in details[0]]
33
+ result = [c | d[0] for c, d in zip(networks[0], details, strict=True)]
34
+ [print(r) for r in result]
34
35
 
35
36
 
36
37
  if __name__ == "__main__":
@@ -23,13 +23,13 @@ class Api:
23
23
  """Class to make API requests"""
24
24
 
25
25
  def __init__(
26
- self, session: ClientSession, email: str, password: str, market: Market
26
+ self, session: ClientSession, email: str, password: str, market: Market, was_shell=True
27
27
  ):
28
28
  """Initilaize the session."""
29
29
  self.session = session
30
30
  self.email = email
31
31
  self.password = password
32
- self.url = f"https://50five-s{market}.evc-net.com"
32
+ self.url = f"https://50five{'-s' if was_shell else ''}{market}.evc-net.com"
33
33
  self.api = f"{self.url}/api/ajax"
34
34
  self.logger = logging.getLogger("50five")
35
35
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fiftyfive"
3
- version = "0.2.0"
3
+ version = "0.3.0"
4
4
  description = "Python 3 package to retrieve EV charger data from 50five"
5
5
  dependencies = [
6
6
  "aiohttp",
File without changes
File without changes
File without changes