parent
b64d7789b8
commit
4d2e67a29a
11
main.py
11
main.py
|
@ -156,6 +156,17 @@ if __name__ == '__main__':
|
||||||
elif payload == "Random Color per LED":
|
elif payload == "Random Color per LED":
|
||||||
mode = 4
|
mode = 4
|
||||||
|
|
||||||
|
if os.path.isfile(current_path+r'/.env') == False:
|
||||||
|
# If not create it and add content
|
||||||
|
with open(current_path+r'/.env', 'w') as f:
|
||||||
|
var_lines = ["SPOTIPY_CLIENT_ID = ", "SPOTIPY_CLIENT_SECRET = ", "SPOTIPY_USER_NAME = ", "SPOTIPY_REDIRECT_URI = "]
|
||||||
|
for var_line in var_lines:
|
||||||
|
f.write(var_line+'\n')
|
||||||
|
print('Please fill out the variables in the .env file ( '+current_path+r'/.env )')
|
||||||
|
exit()
|
||||||
|
else:
|
||||||
|
load_dotenv()
|
||||||
|
|
||||||
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
|
strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL)
|
||||||
strip.begin()
|
strip.begin()
|
||||||
|
|
||||||
|
|
|
@ -3,5 +3,5 @@ paho_mqtt==1.6.1
|
||||||
Pillow==9.2.0
|
Pillow==9.2.0
|
||||||
python-dotenv==0.20.0
|
python-dotenv==0.20.0
|
||||||
requests==2.28.1
|
requests==2.28.1
|
||||||
rpi_ws281x==4.3.4
|
|
||||||
spotipy==2.20.0
|
spotipy==2.20.0
|
||||||
|
rpi_ws281x==4.3.4
|
||||||
|
|
Loading…
Reference in New Issue