Compare commits

...

5 Commits

Author SHA1 Message Date
Tanner 38af4b3c7c Ignore aider 2026-06-13 16:30:19 -06:00
Tanner ae83f8e562 Pull data from stats API vestaboard 2025-10-06 01:25:21 +01:00
Tanner 3339bd07a2 Untrack .pyc files 2025-10-06 01:23:34 +01:00
Tanner 3f42c61352 Add gitignore 2025-10-06 01:23:11 +01:00
Tanner 66398d4359 Merge 2025-10-06 00:52:52 +01:00
5 changed files with 174 additions and 4 deletions
+154
View File
@@ -0,0 +1,154 @@
# Python
# ======
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# node / npm / yarn
# =================
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor
*.swp
*.swo
# Firmware
# =======
# ESP-IDF
sdkconfig
sdkconfig.old
# Custom
# ======
data/
secrets.py
secrets.h
*.bin
output.*
out.*
*.csv
*.txt
*.json
.aider*
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+20 -4
View File
@@ -21,12 +21,28 @@ def send_sign(text):
if len(lines) > ROWS: if len(lines) > ROWS:
lines = lines[:ROWS] lines = lines[:ROWS]
# The board controller expects spaces to be replaced with `0 for a blank character. special_chars = {
board_lines = [line.replace(' ', '`0') for line in lines] ' ': '`0',
'\\w': '`1', # white
'\\r': '`2', # red
'\\o': '`3', # orange
'\\y': '`4', # yellow
'\\g': '`5', # green
'\\b': '`6', # blue
'\\v': '`7', # violet
'\\d': '`8', # degree
# '`9', # also degree
}
for code, color in special_chars.items():
lines = [line.replace(code, color) for line in lines]
# setup_digits handles displaying the lines on the board. # setup_digits handles displaying the lines on the board.
# It will also vertically center the block of text. # It will also vertically center the block of text.
setup_digits(board_lines, left_to_right_swap=False, real_hw=True) try:
setup_digits(lines, left_to_right_swap=False, real_hw=True)
except BaseException as e:
print "Error setting digits:" + str(e)
def poll_and_display(): def poll_and_display():
@@ -40,7 +56,7 @@ def poll_and_display():
try: try:
response = urllib2.urlopen(url) response = urllib2.urlopen(url)
data = json.load(response) data = json.load(response)
message = data.get('sign') message = data.get('vestaboard')
if message and message != last_message: if message and message != last_message:
print "Updating sign with new message: " + message print "Updating sign with new message: " + message
BIN
View File
Binary file not shown.