Skip to content

Commit

Permalink
add more info screen to installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
pszafer committed Jan 23, 2022
1 parent 784727c commit 91495f4
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions install_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def represent_none(self, v):
_LOGGER.error("Wrong Python version")
exit(1)
whiptail = Whiptail(
title="BoneIO", backtitle="Installation script", height=20, width=80
title="boneIO", backtitle="Installation script", height=20, width=80
)
_LOGGER.info("Installing BoneIO package")
_command = run_command(
Expand Down Expand Up @@ -212,6 +212,13 @@ def represent_none(self, v):
),
],
)
_enabled_outputs = whiptail.radiolist(
"Outputs, choose which output you want to enable.",
items=[
("RB32", "Relay board 32x5A", OFF),
("RB24", "Relay board 24x16A", OFF),
],
)
_enabled_sensors = whiptail.checklist(
"Sensors, choose which sensors you have onboard.",
items=[
Expand All @@ -233,13 +240,6 @@ def represent_none(self, v):
("ADC", "ADC input sensors", OFF),
],
)
_enabled_outputs = whiptail.radiolist(
"Outputs, choose which output you want to enable.",
items=[
("RB32", "Relay board 32x5A", OFF),
("RB24", "Relay board 24x16A", OFF),
],
)
mqtt_part = {
"host": _mqtt_hostname,
"topic_prefix": _boneio_name,
Expand Down Expand Up @@ -274,7 +274,7 @@ def represent_none(self, v):
output["output"] = "!include output32x5A.yaml"
if "LM75_RB32" in _enabled_sensors:
output["lm75"] = {"id": "temp", "address": "0x72"}
if "Input" in _enabled_inputs:
if "Input board" in _enabled_inputs:
copyfile(f"{exampled_dir}input.yaml", f"{maindir}/input.yaml")
output["input"] = "!include input.yaml"
if "ADC" in _enabled_sensors:
Expand Down Expand Up @@ -324,4 +324,7 @@ def represent_none(self, v):
)
run_command(cmd=shlex.split("sudo systemctl daemon-reload"))
run_command(cmd=shlex.split("sudo systemctl enable --now boneio"))
whiptail.alert(
f"Your config is in {maindir}config.yaml. \nChange it according to your needs.\nRead more at https://docs.boneio.eu"
)
sys.exit(0)

0 comments on commit 91495f4

Please sign in to comment.