@@ -83,3 +83,158 @@ async def all_battery_health(
8383 "only_active" : only_active ,
8484 },
8585 )
86+
87+ async def states (
88+ self ,
89+ vin : str ,
90+ start : int | None = None ,
91+ end : int | None = None ,
92+ results : int | None = None ,
93+ page : int | None = None ,
94+ exclude : str | None = None ,
95+ fields : str | None = None ,
96+ ) -> Any :
97+ """Get historical vehicle states within timeframe."""
98+ return await self ._request (
99+ Method .GET ,
100+ f"{ vin } /states" ,
101+ params = {
102+ "from" : start ,
103+ "to" : end ,
104+ "results" : results ,
105+ "page" : page ,
106+ "exclude" : exclude ,
107+ "fields" : fields ,
108+ },
109+ )
110+
111+ async def location (self , vin : str ) -> Any :
112+ """Get coordinates, address, and saved location."""
113+ return await self ._request (Method .GET , f"{ vin } /location" )
114+
115+ async def firmware_alerts (self , vin : str ) -> Any :
116+ """Get list of firmware-generated alerts."""
117+ return await self ._request (Method .GET , f"{ vin } /firmware_alerts" )
118+
119+ async def map (
120+ self ,
121+ vin : str ,
122+ width : int | None = None ,
123+ height : int | None = None ,
124+ zoom : int | None = None ,
125+ ) -> Any :
126+ """Get map image of vehicle location."""
127+ return await self ._request (
128+ Method .GET ,
129+ f"{ vin } /map" ,
130+ params = {"width" : width , "height" : height , "zoom" : zoom },
131+ )
132+
133+ async def consumption_since_charge (self , vin : str ) -> Any :
134+ """Get energy use data since last charge."""
135+ return await self ._request (Method .GET , f"{ vin } /consumption_since_charge" )
136+
137+ async def weather (self , vin : str ) -> Any :
138+ """Get weather forecast around vehicle."""
139+ return await self ._request (Method .GET , f"{ vin } /weather" )
140+
141+ async def drives (
142+ self ,
143+ vin : str ,
144+ start : int | None = None ,
145+ end : int | None = None ,
146+ results : int | None = None ,
147+ page : int | None = None ,
148+ timezone : str | None = None ,
149+ distance_format : str | None = None ,
150+ ) -> Any :
151+ """Get historical drive records."""
152+ return await self ._request (
153+ Method .GET ,
154+ f"{ vin } /drives" ,
155+ params = {
156+ "from" : start ,
157+ "to" : end ,
158+ "results" : results ,
159+ "page" : page ,
160+ "timezone" : timezone ,
161+ "distance_format" : distance_format ,
162+ },
163+ )
164+
165+ async def path (
166+ self ,
167+ vin : str ,
168+ start : int ,
169+ end : int ,
170+ timezone : str | None = None ,
171+ ) -> Any :
172+ """Get driving route during specified timeframe."""
173+ return await self ._request (
174+ Method .GET ,
175+ f"{ vin } /path" ,
176+ params = {"from" : start , "to" : end , "timezone" : timezone },
177+ )
178+
179+ async def charges (
180+ self ,
181+ vin : str ,
182+ start : int | None = None ,
183+ end : int | None = None ,
184+ results : int | None = None ,
185+ page : int | None = None ,
186+ timezone : str | None = None ,
187+ distance_format : str | None = None ,
188+ ) -> Any :
189+ """Get charging history."""
190+ return await self ._request (
191+ Method .GET ,
192+ f"{ vin } /charges" ,
193+ params = {
194+ "from" : start ,
195+ "to" : end ,
196+ "results" : results ,
197+ "page" : page ,
198+ "timezone" : timezone ,
199+ "distance_format" : distance_format ,
200+ },
201+ )
202+
203+ async def charging_invoices (
204+ self ,
205+ start : int | None = None ,
206+ end : int | None = None ,
207+ only_active : bool = False ,
208+ ) -> Any :
209+ """Get charging costs for all vehicles (fleet)."""
210+ return await self ._request (
211+ Method .GET ,
212+ "charging_invoices" ,
213+ params = {"from" : start , "to" : end , "only_active" : only_active },
214+ )
215+
216+ async def idles (
217+ self ,
218+ vin : str ,
219+ start : int | None = None ,
220+ end : int | None = None ,
221+ results : int | None = None ,
222+ page : int | None = None ,
223+ timezone : str | None = None ,
224+ ) -> Any :
225+ """Get idle periods when vehicle inactive."""
226+ return await self ._request (
227+ Method .GET ,
228+ f"{ vin } /idles" ,
229+ params = {
230+ "from" : start ,
231+ "to" : end ,
232+ "results" : results ,
233+ "page" : page ,
234+ "timezone" : timezone ,
235+ },
236+ )
237+
238+ async def last_idle_state (self , vin : str ) -> Any :
239+ """Get latest idle period data."""
240+ return await self ._request (Method .GET , f"{ vin } /last_idle_state" )
0 commit comments