Skip to content

Commit 565e425

Browse files
authored
Remove programs that require wifi from the main menu if EuroPi doesn't have a wifi-enabled Pico; these programs will not work (#439)
1 parent db51c97 commit 565e425

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

software/contrib/menu.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515
# Reset the module state and display bootsplash screen.
1616
from europi import bootsplash
1717

18-
1918
bootsplash()
2019

21-
2220
from bootloader import BootloaderMenu
2321
from collections import OrderedDict
22+
import europi_config
2423

2524
## Scripts that are included in the menu
2625
#
@@ -102,5 +101,17 @@
102101
])
103102
# fmt: on
104103

104+
105+
# Remove scripts that require wifi if the Pico model in use doesn't
106+
# have a wifi module included
107+
cfg = europi_config.load_europi_config()
108+
if (
109+
cfg.PICO_MODEL != europi_config.MODEL_PICO_W
110+
and cfg.PICO_MODEL != europi_config.MODEL_PICO_2W
111+
):
112+
EUROPI_SCRIPTS.pop("HTTP Interface")
113+
EUROPI_SCRIPTS.pop("OSC Interface")
114+
115+
105116
if __name__ == "__main__":
106117
BootloaderMenu(EUROPI_SCRIPTS).main()

0 commit comments

Comments
 (0)