tesla-fleet-api 0.5.8__py3-none-any.whl → 0.5.10__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.
tesla_fleet_api/const.py CHANGED
@@ -3,7 +3,7 @@
3
3
  from enum import Enum
4
4
  import logging
5
5
 
6
- VERSION = "0.5.8"
6
+ VERSION = "0.5.10"
7
7
  LOGGER = logging.getLogger(__package__)
8
8
  SERVERS = {
9
9
  "na": "https://fleet-api.prd.na.vn.cloud.tesla.com",
@@ -37,12 +37,16 @@ class TeslaFleetApi:
37
37
 
38
38
  self.session = session
39
39
  self.access_token = access_token
40
+ self.raise_for_status = raise_for_status
40
41
 
41
- if region is not None:
42
- if not server and region not in SERVERS:
42
+ if server is not None:
43
+ self.server = server
44
+ elif region is not None:
45
+ if region not in SERVERS:
43
46
  raise ValueError(f"Region must be one of {', '.join(SERVERS.keys())}")
44
- self.server = server or SERVERS.get(region)
45
- self.raise_for_status = raise_for_status
47
+ self.server = SERVERS.get(region)
48
+ else:
49
+ raise ValueError("Either server or region must be provided.")
46
50
 
47
51
  LOGGER.debug("Using server %s", self.server)
48
52
 
@@ -17,7 +17,7 @@ class VehicleSpecific:
17
17
  self._parent = parent
18
18
  self.vin = vin
19
19
 
20
-
20
+ @property
21
21
  def pre2021(self) -> bool:
22
22
  """Checks if a vehicle is pre-2021."""
23
23
  return self._parent.pre2021(self.vin)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tesla_fleet_api
3
- Version: 0.5.8
3
+ Version: 0.5.10
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
@@ -1,19 +1,19 @@
1
1
  tesla_fleet_api/__init__.py,sha256=0MON9vh3AShIiX16FZ6NU3yZ7kyXFh5GxA0rY8CzVRM,584
2
2
  tesla_fleet_api/charging.py,sha256=N_mc8axrXj3iduqLj_jCt4Vx86tHqe3xqQT4R1R7HvU,1689
3
- tesla_fleet_api/const.py,sha256=Iw-pOe1Bg2vU4uk0SQ1Nf6YiXy0ndXMZ0SWl1T27znQ,9277
3
+ tesla_fleet_api/const.py,sha256=zLa3iWJlYRCcaHFr88fy7zi-205oeXpIZ8DdxI4XYWg,9278
4
4
  tesla_fleet_api/energy.py,sha256=kE-HDupzhgatIsizJoer1MAALP-wH6jjjGliiRQN0Os,5285
5
5
  tesla_fleet_api/energyspecific.py,sha256=kICxdeDoWR9JHlgjHvnmjJ1ErLOWJT8bCSESoXo9axU,3732
6
6
  tesla_fleet_api/exceptions.py,sha256=Wh9roGPYB9oBGgEEfxMDay5A7RkPy8JFKloKPStGQ2Y,9211
7
7
  tesla_fleet_api/partner.py,sha256=1vIBUaxKLIfqcC0X6VXZN0dMAzj_CLNPUMjA6QVqZ1k,1223
8
- tesla_fleet_api/teslafleetapi.py,sha256=3-gGx-RxOD92Ul0lNCEsCwVBsYunKsO2Sr5rYH0YtIg,5070
8
+ tesla_fleet_api/teslafleetapi.py,sha256=KYtfkqthYxWuKpctLbyAcE32sN5yMpJaCsMSWM7bX2E,5199
9
9
  tesla_fleet_api/teslafleetoauth.py,sha256=FfLnuqZMxF2HsZ5miLNtm3pRwKDoQKi2GD-oXgKxZgA,3594
10
10
  tesla_fleet_api/teslemetry.py,sha256=XOqm7SaakooJSNXEasJI_tRoCIyiFCD6n_PCx9U_D9g,2107
11
11
  tesla_fleet_api/tessie.py,sha256=ZttWuDdQOuTFO4k-BMq7fXKP3Nb4Dsxk3gFJprHHsco,2214
12
12
  tesla_fleet_api/user.py,sha256=TZE2oh-n5zrhKXmGRuiNL9voKVODD7rBhGE_IObYVGA,1179
13
13
  tesla_fleet_api/vehicle.py,sha256=3MF8KN3BjY2dQxmu6-hrrVxrXxI8iQF-rBS8v89ruUw,32835
14
- tesla_fleet_api/vehiclespecific.py,sha256=Weadm-IU9vsL5JCwXilaz3Yrwxb1iZdsdmGxuUHMxMA,21493
15
- tesla_fleet_api-0.5.8.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
16
- tesla_fleet_api-0.5.8.dist-info/METADATA,sha256=Yrzt0AyLUq2aQjQV3i7PI0vXijUflTkvMlHrmcTkGCg,3961
17
- tesla_fleet_api-0.5.8.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
18
- tesla_fleet_api-0.5.8.dist-info/top_level.txt,sha256=jeNbog_1saXBFrGpom9WyPWmilxsyP3szL_G7JLWQfM,16
19
- tesla_fleet_api-0.5.8.dist-info/RECORD,,
14
+ tesla_fleet_api/vehiclespecific.py,sha256=Oaz5InhWwXuKgyoQSYWpLLsMPjZ2iF0bShlnDLxEk5k,21506
15
+ tesla_fleet_api-0.5.10.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
16
+ tesla_fleet_api-0.5.10.dist-info/METADATA,sha256=zM0SyX16sfeztQ3dyVOCSM9EnZlZoAbg6FAB1zVf5uM,3962
17
+ tesla_fleet_api-0.5.10.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
18
+ tesla_fleet_api-0.5.10.dist-info/top_level.txt,sha256=jeNbog_1saXBFrGpom9WyPWmilxsyP3szL_G7JLWQfM,16
19
+ tesla_fleet_api-0.5.10.dist-info/RECORD,,