main.py 538 B

123456789101112131415161718192021
  1. import os
  2. from lib.mqtt import create_client, update_disc, control_player, create_config
  3. # Define the MQTT server details
  4. broker = os.environ.get("broker")
  5. port = int(os.environ.get("port"))
  6. # MQTT username and password
  7. username = os.environ.get('username')
  8. password = os.environ.get('password')
  9. client = create_client(broker, port, username, password)
  10. create_config(client)
  11. # update_disc(client, {"type":"album", "id":"MPREb_2UBRpewr9ad"})
  12. # update_disc(client, {"type":"playlist", "id":"LM"})
  13. #
  14. control_player(client, "EJECT")
  15. #