Make gear fully work with new helper functions
This commit is contained in:
parent
a71336cb73
commit
ac1dde751b
1 changed files with 4 additions and 17 deletions
21
__init__.py
21
__init__.py
|
@ -169,12 +169,10 @@ class FlightGearCopilotSkill(MycroftSkill):
|
||||||
tn = self.connect()
|
tn = self.connect()
|
||||||
|
|
||||||
# get acid
|
# get acid
|
||||||
tn.write("get /sim/aircraft\r\n")
|
acid = self.get_prop(tn, "/sim/aircraft")
|
||||||
acid = tn.read_until("\n")
|
|
||||||
|
|
||||||
profile = None
|
|
||||||
|
|
||||||
# read acid to know which profile to use
|
# read acid to know which profile to use
|
||||||
|
profile = None
|
||||||
for i_profiles in self.settings['profiles']:
|
for i_profiles in self.settings['profiles']:
|
||||||
for i_acid in i_profiles['acid']:
|
for i_acid in i_profiles['acid']:
|
||||||
if i_acid == acid:
|
if i_acid == acid:
|
||||||
|
@ -183,10 +181,6 @@ class FlightGearCopilotSkill(MycroftSkill):
|
||||||
if profile != None:
|
if profile != None:
|
||||||
break
|
break
|
||||||
|
|
||||||
# BYPASS THE PROFILE CHECK
|
|
||||||
# TODO REMOVE THIS BYPASS
|
|
||||||
profile = self.settings['profiles'][0]
|
|
||||||
|
|
||||||
if profile == None:
|
if profile == None:
|
||||||
# TODO when creation of profiles via voice is possible, add dialog how to
|
# TODO when creation of profiles via voice is possible, add dialog how to
|
||||||
self.speak("Profile not found")
|
self.speak("Profile not found")
|
||||||
|
@ -194,7 +188,6 @@ class FlightGearCopilotSkill(MycroftSkill):
|
||||||
|
|
||||||
if profile['gear-retractable'] == "true":
|
if profile['gear-retractable'] == "true":
|
||||||
self.speak("Gear up")
|
self.speak("Gear up")
|
||||||
# TODO puts the gear down right now... fix
|
|
||||||
self.nasal_exec(tn, "controls.gearDown(-1)")
|
self.nasal_exec(tn, "controls.gearDown(-1)")
|
||||||
else:
|
else:
|
||||||
self.speak_dialog("gear.not.retractable")
|
self.speak_dialog("gear.not.retractable")
|
||||||
|
@ -205,12 +198,10 @@ class FlightGearCopilotSkill(MycroftSkill):
|
||||||
tn = self.connect()
|
tn = self.connect()
|
||||||
|
|
||||||
# get acid
|
# get acid
|
||||||
tn.write("get /sim/aircraft\r\n")
|
acid = self.get_prop(tn, "/sim/aircraft")
|
||||||
acid = tn.read_until("\n")
|
|
||||||
|
|
||||||
profile = None
|
|
||||||
|
|
||||||
# read acid to know which profile to use
|
# read acid to know which profile to use
|
||||||
|
profile = None
|
||||||
for i_profiles in self.settings['profiles']:
|
for i_profiles in self.settings['profiles']:
|
||||||
for i_acid in i_profiles['acid']:
|
for i_acid in i_profiles['acid']:
|
||||||
if i_acid == acid:
|
if i_acid == acid:
|
||||||
|
@ -219,10 +210,6 @@ class FlightGearCopilotSkill(MycroftSkill):
|
||||||
if profile != None:
|
if profile != None:
|
||||||
break
|
break
|
||||||
|
|
||||||
# BYPASS THE PROFILE CHECK
|
|
||||||
# TODO REMOVE THIS BYPASS
|
|
||||||
profile = self.settings['profiles'][0]
|
|
||||||
|
|
||||||
if profile == None:
|
if profile == None:
|
||||||
# TODO when creation of profiles via voice is possible, add dialog how to
|
# TODO when creation of profiles via voice is possible, add dialog how to
|
||||||
self.speak("Profile not found")
|
self.speak("Profile not found")
|
||||||
|
|
Loading…
Add table
Reference in a new issue