@@ -266,6 +266,31 @@ def format_capabilities(capabilities_list: List[dict]) -> List[Capability]:
266266
267267Response = NamedTuple ("Response" , [("body" , dict ), ("meta" , namedtuple )])
268268
269+ # ===========================================
270+ # Lock Status Tuples
271+ # ===========================================
272+
273+ Door = NamedTuple ("Door" , [("type" , str ), ("status" , str )])
274+ Window = NamedTuple ("Window" , [("type" , str ), ("status" , str )])
275+ Sunroof = NamedTuple ("Sunroof" , [("type" , str ), ("status" , str )])
276+ Storage = NamedTuple ("Storage" , [("type" , str ), ("status" , str )])
277+ ChargingPort = NamedTuple ("ChargingPort" , [("type" , str ), ("status" , str )])
278+
279+
280+ LockStatus = NamedTuple (
281+ "LockStatus" ,
282+ [
283+ ("is_locked" , bool ),
284+ ("doors" , List [Door ]),
285+ ("windows" , List [Window ]),
286+ ("sunroof" , List [Sunroof ]),
287+ ("storage" , List [Storage ]),
288+ ("charging_port" , List [ChargingPort ]),
289+ ("meta" , namedtuple ),
290+ ],
291+ )
292+
293+
269294# ===========================================
270295# Named Tuple Selector Function
271296# ===========================================
@@ -378,7 +403,16 @@ def select_named_tuple(path: str, response_or_dict) -> NamedTuple:
378403 Paging (data ["paging" ]["count" ], data ["paging" ]["offset" ]),
379404 headers ,
380405 )
381-
406+ elif path == "security" :
407+ return LockStatus (
408+ data ["isLocked" ],
409+ data ["doors" ],
410+ data ["windows" ],
411+ data ["sunroof" ],
412+ data ["storage" ],
413+ data ["chargingPort" ],
414+ headers ,
415+ )
382416 elif path == "subscribe" :
383417 return Subscribe (data ["webhookId" ], data ["vehicleId" ], headers )
384418
0 commit comments