Added function and a bug fix
Signed-off-by: merspieler <merspieler@users.noreply.github.com>
This commit is contained in:
parent
bb93471f57
commit
c664642c3a
1 changed files with 16 additions and 0 deletions
16
__init__.py
16
__init__.py
|
@ -156,6 +156,8 @@ class FlightGearCopilotSkill(MycroftSkill):
|
||||||
else:
|
else:
|
||||||
self.speak("Speed checked.")
|
self.speak("Speed checked.")
|
||||||
|
|
||||||
|
flaps_request = int(flaps_request)
|
||||||
|
|
||||||
if flaps_mov == "extend":
|
if flaps_mov == "extend":
|
||||||
pos_reached = 0
|
pos_reached = 0
|
||||||
while pos_reached == 0:
|
while pos_reached == 0:
|
||||||
|
@ -896,6 +898,20 @@ class FlightGearCopilotSkill(MycroftSkill):
|
||||||
tn.read_until("\n")
|
tn.read_until("\n")
|
||||||
return ret[:-1]
|
return ret[:-1]
|
||||||
|
|
||||||
|
# count number of items in a prop tree dir
|
||||||
|
def get_item_count(self, tn, directory):
|
||||||
|
tn.write("ls " + directory + "\r\n")
|
||||||
|
ret = 0
|
||||||
|
result = " "
|
||||||
|
|
||||||
|
while result != "":
|
||||||
|
result = tn.read_until("\n", 1)
|
||||||
|
ret = ret + 1
|
||||||
|
|
||||||
|
ret = ret - 1
|
||||||
|
tn.write("cd /\r\n")
|
||||||
|
return ret
|
||||||
|
|
||||||
# exit routine to properly close the tn con
|
# exit routine to properly close the tn con
|
||||||
def exit(self, tn):
|
def exit(self, tn):
|
||||||
tn.close
|
tn.close
|
||||||
|
|
Loading…
Reference in a new issue