Skip to content

Commit 055c447

Browse files
committed
added indexed suport to request find.
AircraftRequests.Find will now auto detcect and set index on index requests.
1 parent da8d9e6 commit 055c447

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

SimConnect/RequestList.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,17 @@ def json(self):
137137

138138
class AircraftRequests():
139139
def find(self, key):
140+
index = None
141+
if ':' in key:
142+
(keyname, index) = key.split(":", 1)
143+
key = "%s:index" % (keyname)
140144
for clas in self.list:
141145
for test in clas.list:
142146
if key == test[0]:
143-
return getattr(clas, key)
147+
rqest = getattr(clas, key)
148+
if index is not None:
149+
rqest.setIndex(index)
150+
return rqest
144151
return None
145152

146153
def get(self, key):

0 commit comments

Comments
 (0)