/lifx-lights-openai

Change the brightness of the lights depending on the sentiment of the news

Primary LanguagePython

Change the brightness of the lights depending on the sentiment of the news

This script uses the newsAPI to get the top headlines and then uses openAI to get the sentiment of the headlines. The script then changes the brightness of the lifx lights depending on the sentiment of the news.

Table of Contents

How to use

  1. Create a lifx account and get your token from here
  2. Create an openAI account and get your token from here
  3. Create a newsAPI account and get your token from here
  4. Clone the repo
git clone https://github.com/catbox-dev/newsMoodLight.git
  1. Install the requirements
pip3 install -r requirements.txt
  1. Replace the tokens in confi.ini with your tokens
  2. Make sure you have correctly setup your lifx lights, see here
  3. Run the python script
python3 newsMoodLight.py

How to set up your lifx lights

  1. Install the lifx app on your phone
  2. Connect your phone and your computer to the same wifi network
  3. Open the lifx app and connect your lights

Credits