tesla-fleet-api 0.1.1__py3-none-any.whl → 0.1.4__py3-none-any.whl

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,3 +1,9 @@
1
1
  from .teslafleetapi import TeslaFleetApi
2
2
  from .teslafleetoauth import TeslaFleetOAuth
3
3
  from .teslemetry import Teslemetry
4
+ from .charging import Charging
5
+ from .energy import Energy
6
+ from .partner import Partner
7
+ from .user import User
8
+ from .vehicle import Vehicle
9
+ from .vehiclespecific import VehicleSpecific
tesla_fleet_api/const.py CHANGED
@@ -1,5 +1,13 @@
1
1
  """Tesla Fleet API constants."""
2
- from enum import StrEnum, IntEnum
2
+ from enum import Enum
3
+
4
+
5
+ class IntEnum(int, Enum):
6
+ pass
7
+
8
+
9
+ class StrEnum(str, Enum):
10
+ pass
3
11
 
4
12
 
5
13
  class Methods(StrEnum):
@@ -41,7 +41,7 @@ class TeslaFleetApi:
41
41
  self.use_command_protocol = use_command_protocol
42
42
 
43
43
  if region and not server and region not in SERVERS:
44
- raise ValueError(f"Region must be one of {", ".join(SERVERS.keys())}")
44
+ raise ValueError(f"Region must be one of {', '.join(SERVERS.keys())}")
45
45
  self.server = server or SERVERS.get(region)
46
46
  self.raise_for_status = raise_for_status
47
47
 
@@ -21,11 +21,18 @@ class Teslemetry(TeslaFleetApi):
21
21
  user_scope=False,
22
22
  )
23
23
 
24
- async def subscription(self):
25
- """Get the subscribed vehicles."""
24
+ async def ping(self) -> bool:
25
+ """Send a ping."""
26
26
  return await self._request(
27
27
  Methods.GET,
28
- "/meta/subscription",
28
+ "/api/ping",
29
+ )
30
+
31
+ async def test(self) -> bool:
32
+ """Test API Authentication."""
33
+ return await self._request(
34
+ Methods.GET,
35
+ "/api/test",
29
36
  )
30
37
 
31
38
  async def find_server(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tesla_fleet_api
3
- Version: 0.1.1
3
+ Version: 0.1.4
4
4
  Summary: Tesla Fleet API library for Python
5
5
  Home-page: https://github.com/Teslemetry/tesla_fleet_api
6
6
  Author: Brett Adams
@@ -9,7 +9,7 @@ Classifier: Development Status :: 3 - Alpha
9
9
  Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: Apache Software License
11
11
  Classifier: Operating System :: OS Independent
12
- Requires-Python: >=3.8
12
+ Requires-Python: >=3.10
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: aiohttp
@@ -95,7 +95,8 @@ This extends TeslaFleetApi to send requests through Teslemetry, which manages al
95
95
  import asyncio
96
96
  import aiohttp
97
97
 
98
- from tesla_fleet_api import Teslemetry, TeslaFleetError
98
+ from tesla_fleet_api import Teslemetry
99
+ from tesla_fleet_api.exceptions import TeslaFleetError
99
100
 
100
101
 
101
102
  async def main():
@@ -109,7 +110,7 @@ async def main():
109
110
  try:
110
111
  data = await api.vehicle.list()
111
112
  print(data)
112
- except TeslaFleetError.Base as e:
113
+ except TeslaFleetError as e:
113
114
  print(e.message, e.error)
114
115
 
115
116
  asyncio.run(main())
@@ -1,17 +1,17 @@
1
- tesla_fleet_api/__init__.py,sha256=6RglNoLqskvtEuS7tKfp9hknHd80xGTQSSg8P7Uxa6w,121
1
+ tesla_fleet_api/__init__.py,sha256=Vo-D3IOuevmpGi05selvpwzBz2_NkqAGi5tY1G7cpqE,305
2
2
  tesla_fleet_api/charging.py,sha256=0pQKuqeDdooBpAzaRcBKsXl2wrLM1n4PKn_JhcdO3PE,1677
3
- tesla_fleet_api/const.py,sha256=1Mjp5TnvTZkbHsDevIn7A5F3gStlobpBKVnYWNskWjo,8966
3
+ tesla_fleet_api/const.py,sha256=vd_Qo--zFf5SZ4dLUT1SWn0BchQjqaE97igXjO1pElU,9028
4
4
  tesla_fleet_api/energy.py,sha256=3gN3i7SjvMQ2sQhoYxxrbY-4aXxH2Xd_hwWDcPItdmU,4616
5
5
  tesla_fleet_api/exceptions.py,sha256=PmIamDcy0j9wsnZs9Oq6kp7z99wa2jCD61OCp8FXQAw,8640
6
6
  tesla_fleet_api/partner.py,sha256=YMnuG2uY_VT79VVPrHn8Lvx6YUsV4aYSLpGq7Vi41pY,868
7
- tesla_fleet_api/teslafleetapi.py,sha256=3xjKlpNQ-MBZl0ojRPo24dzibCHv1LejzcR9zXuyykY,4498
7
+ tesla_fleet_api/teslafleetapi.py,sha256=DRZr6Anll5UIOePMW9oMgM4abxaoYXu8zxsoeJs3KJw,4498
8
8
  tesla_fleet_api/teslafleetoauth.py,sha256=728w-wj4eSaAAr4rm57NJ7DUgzImisKPZtjQ0fauVsY,3466
9
- tesla_fleet_api/teslemetry.py,sha256=P5DJ0NmC8CbQt5bB3TV6ABnPMbl00sSlRnvcOA2M68s,940
9
+ tesla_fleet_api/teslemetry.py,sha256=nHjBnNL82_-QzizoEAu1IJNCIxdvzPpD51JAH0C0kCk,1085
10
10
  tesla_fleet_api/user.py,sha256=3VWsLjrOhU0qTMG3LzPBAnkENdf7RcDvXsdWsOyXRHI,1185
11
11
  tesla_fleet_api/vehicle.py,sha256=jSHtzZY4vzJ9pj27gtgzV1YELjfxMeNAIbnVsVNgZuo,35774
12
12
  tesla_fleet_api/vehiclespecific.py,sha256=r9qeWyzPZUVhiqwrqadsz8AKwZr7dQWti4kbxVG4CJI,19903
13
- tesla_fleet_api-0.1.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
14
- tesla_fleet_api-0.1.1.dist-info/METADATA,sha256=q9vfNFjbArqNOpesX2gUwlLF_By-Wg31u0mK4dQoUMg,3118
15
- tesla_fleet_api-0.1.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
16
- tesla_fleet_api-0.1.1.dist-info/top_level.txt,sha256=jeNbog_1saXBFrGpom9WyPWmilxsyP3szL_G7JLWQfM,16
17
- tesla_fleet_api-0.1.1.dist-info/RECORD,,
13
+ tesla_fleet_api-0.1.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
14
+ tesla_fleet_api-0.1.4.dist-info/METADATA,sha256=gn-g6t_mGzXuubTiI6jRxhMLGpJfU1n2nCBjDWAYhNA,3152
15
+ tesla_fleet_api-0.1.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
16
+ tesla_fleet_api-0.1.4.dist-info/top_level.txt,sha256=jeNbog_1saXBFrGpom9WyPWmilxsyP3szL_G7JLWQfM,16
17
+ tesla_fleet_api-0.1.4.dist-info/RECORD,,