Skip to content
Snippets Groups Projects
Verified Commit f411dec3 authored by dos's avatar dos
Browse files

wurzelitzer: Check whether SD card is present

parent ea8dd078
No related branches found
No related tags found
No related merge requests found
import st3m.run, st3m.wifi, media, os, ctx import st3m.run, st3m.wifi, media, uos, ctx
from st3m.application import Application from st3m.application import Application
from st3m.utils import sd_card_plugged
RADIOSTATIONS = [ RADIOSTATIONS = [
"http://radio-paralax.de:8000/", "http://radio-paralax.de:8000/",
...@@ -16,7 +17,8 @@ class App(Application): ...@@ -16,7 +17,8 @@ class App(Application):
def __init__(self, app_ctx): def __init__(self, app_ctx):
super().__init__(app_ctx) super().__init__(app_ctx)
self._streams = RADIOSTATIONS.copy() self._streams = RADIOSTATIONS.copy()
for entry in os.ilistdir("/sd/"): if sd_card_plugged():
for entry in uos.ilistdir("/sd/"):
if entry[1] == 0x8000: if entry[1] == 0x8000:
if ( if (
entry[0].endswith(".mp3") entry[0].endswith(".mp3")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment