Skip to content

Commit

Permalink
quick fix for remote configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ftylitak committed Sep 6, 2023
1 parent 4776d5e commit 0503ec1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions insighioNode/www/configuration_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,28 @@ def apply_configuration(keyValuePairDictionary):

operation = ""
board = ""
shield = ""
for param in keyValuePairDictionary:
if param == "network":
operation = keyValuePairDictionary[param]
elif param == "selected-board":
board = keyValuePairDictionary[param]
elif param == "selected-shield":
shield = keyValuePairDictionary[param]

rootFolder = device_info.get_device_root_folder()

contents = utils.readFromFile(rootFolder + 'apps/demo_console/templ/common_templ.py')

if shield:
if shield == "scale" or shield == "dig_analog":
board = "ins_esp_gen_1"
# elif shield == "dig_analog":
# board = "ins_esp_gen_s1"
elif shield == "advind":
board = "ins_esp_gen_sdi12"
keyValuePairDictionary["selected-board"] = board

# set project configuration content
if device_info.is_esp32():
if board == "ins_esp_gen_1":
Expand All @@ -31,13 +43,13 @@ def apply_configuration(keyValuePairDictionary):
contents += utils.readFromFile(rootFolder + 'apps/demo_console/templ/device_ins_esp_gen_s1_config_templ.py')
contents += utils.readFromFile(rootFolder + 'apps/demo_console/templ/shield_i2c_dig_analog_templ.py')
contents += utils.readFromFile(rootFolder + 'apps/demo_console/templ/device_i2c_analog_config_templ.py')
elif board == "ins_esp_gen_sdi12":
elif board == "ins_esp_gen_sdi12" or shield == "advind":
contents += utils.readFromFile(rootFolder + 'apps/demo_console/templ/device_ins_esp_gen_s1_config_templ.py')
contents += utils.readFromFile(rootFolder + 'apps/demo_console/templ/shield_sdi12_templ.py')
contents += utils.readFromFile(rootFolder + 'apps/demo_console/templ/device_sdi12_config_templ.py')
else:
contents += utils.readFromFile(rootFolder + 'apps/demo_console/templ/device_ins_py_gen_1_config_templ.py')
if board == "sdi12":
if board == "sdi12" or shield == "advind":
contents += utils.readFromFile(rootFolder + 'apps/demo_console/templ/device_sdi12_config_templ.py')
contents += utils.readFromFile(rootFolder + 'apps/demo_console/templ/py_sdi12_config_templ.py')
else:
Expand Down

0 comments on commit 0503ec1

Please sign in to comment.