Merge branch 'devel-en' into devel-zhs

This commit is contained in:
dragonpilot
2019-10-14 11:04:37 +10:00
3 changed files with 19 additions and 28 deletions
+17 -22
View File
@@ -3,14 +3,10 @@ from common.params import Params, put_nonblocking
default_conf = {
'DragonEnableDashcam': '1',
'DragonDisableDriverSafetyCheck': '0', # deprecated
'DragonEnableDriverSafetyCheck': '1',
'DragonAutoShutdownAt': '30', # in minute
'DragonTempDisableSteerOnSignal': '0', # deprecated
'DragonEnableSteeringOnSignal': '0',
'DragonDisableLogger': '0', # deprecated
'DragonEnableLogger': '1',
'DragonDisableUploader': '0', # deprecated
'DragonEnableUploader': '1',
'DragonNoctuaMode': '0',
'DragonCacheCar': '0',
@@ -18,7 +14,6 @@ default_conf = {
'DragonCachedFP': '', # for cache car
'DragonCachedVIN': '', # for cache car
'DragonAllowGas': '0',
'DragonBBUI': '0', # deprecated
'DragonToyotaStockDSU': '0',
'DragonLatCtrl': '1',
'DragonUISpeed': '1',
@@ -61,26 +56,26 @@ deprecated_conf = {
'DragonBBUI': 'DragonUIDev',
}
deprecated_conf_invert = {
'DragonDisableDriverSafetyCheck': True,
'DragonTempDisableSteerOnSignal': False,
'DragonDisableLogger': True,
'DragonDisableUploader': True,
'DragonBBUI': False
}
# deprecated_conf_invert = {
# 'DragonDisableDriverSafetyCheck': True,
# 'DragonTempDisableSteerOnSignal': False,
# 'DragonDisableLogger': True,
# 'DragonDisableUploader': True,
# 'DragonBBUI': False
# }
def dragonpilot_set_params(params):
# remove deprecated params
for old, new in deprecated_conf.items():
if params.get(old) is not None:
if new is not None:
old_val = str(params.get(old))
new_val = old_val
# invert the value if true
if old in deprecated_conf_invert and deprecated_conf_invert[old] is True:
new_val = "1" if old_val == "0" else "0"
put_nonblocking(new, new_val)
params.delete(old)
# for old, new in deprecated_conf.items():
# if params.get(old) is not None:
# if new is not None:
# old_val = str(params.get(old))
# new_val = old_val
# # invert the value if true
# if old in deprecated_conf_invert and deprecated_conf_invert[old] is True:
# new_val = "1" if old_val == "0" else "0"
# put_nonblocking(new, new_val)
# params.delete(old)
# set params
for key, val in default_conf.items():
+2 -1
View File
@@ -42,7 +42,8 @@ def main(gctx=None):
# Write latest release notes to param
try:
r = subprocess.check_output(["git", "--no-pager", "show", "@{u}:RELEASES.md"])
# r = subprocess.check_output(["git", "--no-pager", "show", "@{u}:RELEASES.md"])
r = subprocess.check_output(["curl", "-s", "https://raw.githubusercontent.com/dragonpilot-community/dragonpilot/docs/CHANGELOG.md"])
r = r[:r.find(b'\n\n')] # Slice latest release notes
params.put("ReleaseNotes", r + b"\n")
except: