Compare commits
5 Commits
9718807fb7
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 38af4b3c7c | |||
| ae83f8e562 | |||
| 3339bd07a2 | |||
| 3f42c61352 | |||
| 66398d4359 |
+154
@@ -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
Binary file not shown.
+20
-4
@@ -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
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user