tesla-fleet-api 0.1.1__tar.gz → 0.1.4__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.
Files changed (23) hide show
  1. {tesla_fleet_api-0.1.1/tesla_fleet_api.egg-info → tesla_fleet_api-0.1.4}/PKG-INFO +5 -4
  2. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/README.md +3 -2
  3. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/setup.py +2 -2
  4. tesla_fleet_api-0.1.4/tesla_fleet_api/__init__.py +9 -0
  5. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api/const.py +9 -1
  6. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api/teslafleetapi.py +1 -1
  7. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api/teslemetry.py +10 -3
  8. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4/tesla_fleet_api.egg-info}/PKG-INFO +5 -4
  9. tesla_fleet_api-0.1.1/tesla_fleet_api/__init__.py +0 -3
  10. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/LICENSE +0 -0
  11. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/setup.cfg +0 -0
  12. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api/charging.py +0 -0
  13. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api/energy.py +0 -0
  14. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api/exceptions.py +0 -0
  15. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api/partner.py +0 -0
  16. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api/teslafleetoauth.py +0 -0
  17. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api/user.py +0 -0
  18. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api/vehicle.py +0 -0
  19. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api/vehiclespecific.py +0 -0
  20. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api.egg-info/SOURCES.txt +0 -0
  21. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api.egg-info/dependency_links.txt +0 -0
  22. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api.egg-info/requires.txt +0 -0
  23. {tesla_fleet_api-0.1.1 → tesla_fleet_api-0.1.4}/tesla_fleet_api.egg-info/top_level.txt +0 -0
@@ -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())
@@ -79,7 +79,8 @@ This extends TeslaFleetApi to send requests through Teslemetry, which manages al
79
79
  import asyncio
80
80
  import aiohttp
81
81
 
82
- from tesla_fleet_api import Teslemetry, TeslaFleetError
82
+ from tesla_fleet_api import Teslemetry
83
+ from tesla_fleet_api.exceptions import TeslaFleetError
83
84
 
84
85
 
85
86
  async def main():
@@ -93,7 +94,7 @@ async def main():
93
94
  try:
94
95
  data = await api.vehicle.list()
95
96
  print(data)
96
- except TeslaFleetError.Base as e:
97
+ except TeslaFleetError as e:
97
98
  print(e.message, e.error)
98
99
 
99
100
  asyncio.run(main())
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="tesla_fleet_api",
8
- version="0.1.1",
8
+ version="0.1.4",
9
9
  author="Brett Adams",
10
10
  author_email="hello@teslemetry.com",
11
11
  description="Tesla Fleet API library for Python",
@@ -19,6 +19,6 @@ setuptools.setup(
19
19
  "License :: OSI Approved :: Apache Software License",
20
20
  "Operating System :: OS Independent",
21
21
  ],
22
- python_requires=">=3.8",
22
+ python_requires=">=3.10",
23
23
  install_requires=["aiohttp"],
24
24
  )
@@ -0,0 +1,9 @@
1
+ from .teslafleetapi import TeslaFleetApi
2
+ from .teslafleetoauth import TeslaFleetOAuth
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
@@ -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,3 +0,0 @@
1
- from .teslafleetapi import TeslaFleetApi
2
- from .teslafleetoauth import TeslaFleetOAuth
3
- from .teslemetry import Teslemetry
File without changes