File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,15 +60,19 @@ def verbose(self, value):
6060 """sets the verbose mode. in verbose mode, diagnostic output is printed to console."""
6161 self .cache .cache .verbose = value
6262
63- def get_unitlist (self ,_type = None ,sort_by_hours = True ):
63+ async def _a_get_unitlist (self ,_type = None ,sort_by_hours = True ):
6464 """unitList method"""
65- data = asyncio . run ( self .cache .get_url ('Unit' ) )
65+ data = await self .cache .get_url ('Unit' )
6666 if _type is not None :
6767 data = list (filter (lambda x : " " in x ['name' ] and _type in x ['name' ],data ))
6868 if sort_by_hours :
6969 data .sort (key = lambda x : (x ['run1' ] if 'run1' in x else 0 ),reverse = True )
7070 return data
7171
72+ def get_unitlist (self ,_type = None ,sort_by_hours = True ):
73+ """unitList method"""
74+ return asyncio .run (self ._a_get_unitlist (_type ,sort_by_hours ))
75+
7276 async def _a_get_history (self ,veh_id ,tdelta ):
7377 """async getHistory method"""
7478 data = []
You can’t perform that action at this time.
0 commit comments