Skip to content

Commit

Permalink
Update README. Change to QOD_API_TOKEN for consistency. Added default…
Browse files Browse the repository at this point in the history
… to balena setup.
  • Loading branch information
lmatter committed Jan 24, 2024
1 parent e356324 commit c0da2b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Running this project is as simple as deploying it to a balenaCloud application.

You can also deploy in the traditional manner using the balena CLI and `balena push` command. For more information [check out the docs](https://www.balena.io/docs/learn/deploy/deployment/).

UPDATE: The Quote of the Day service now requires authentication via API token. Please visit https://theysaidso.com/user/subscriptions to create an account and a token. You can set this token in the Balena deploy phase by selecting the advance setup option and updating the value of QOD_API_TOKEN. You can also set this later using the same process as other environment variables.

## Customization

Your fleet of Inkyshots can all be managed centrally via balenaCloud. Try any of the environment variables below to add some customization.
Expand Down
1 change: 1 addition & 0 deletions balena.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ data:
applicationEnvironmentVariables:
- UPDATE_HOUR: 9
- TZ: Europe/London
- QOD_API_TOKEN: MY_TOKEN
- QOD_CATEGORY: inspire
- FONT: AmaticSC
- TEST_CHARACTER: a
Expand Down
4 changes: 2 additions & 2 deletions inkyshot/update-display.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def temp_to_str(temp, scale):
BALENA_DEVICE_UUID = os.environ["BALENA_DEVICE_UUID"]
BALENA_SUPERVISOR_ADDRESS = os.environ["BALENA_SUPERVISOR_ADDRESS"]
BALENA_SUPERVISOR_API_KEY = os.environ["BALENA_SUPERVISOR_API_KEY"]
QUOTE_API_TOKEN = os.environ["QUOTE_API_TOKEN"]
QOD_API_TOKEN = os.environ["QOD_API_TOKEN"]

WAVESHARE = True if "WAVESHARE" in os.environ else False

Expand Down Expand Up @@ -354,7 +354,7 @@ def temp_to_str(temp, scale):
try:
response = requests.get(
f"https://quotes.rest/qod?category={CATEGORY}&language={LANGUAGE}",
headers = {"Accept": "application/json", "Authorization": f"Bearer {QUOTE_API_TOKEN}"}
headers = {"Accept": "application/json", "Authorization": f"Bearer {QOD_API_TOKEN}"}
)
data = response.json()
message = data['contents']['quotes'][0]['quote']
Expand Down

0 comments on commit c0da2b8

Please sign in to comment.