jparise / vesta

Vestaboard client library for Python
https://vesta-py.readthedocs.io
MIT License
20 stars 1 forks source link

Example code produces an error #86

Closed garthwebb closed 1 year ago

garthwebb commented 1 year ago

The example code in the README for local access includes these two lines

message = vesta.encode("{67} Hello, World {68}")
assert local_client.write_message(message)

However, data produced by vesta.encode apparently does not meet the format required by local_client.write_message and produces this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.9/site-packages/vesta/clients.py", line 222, in write_message
    validate_rows(message)
  File "/opt/homebrew/lib/python3.9/site-packages/vesta/chars.py", line 52, in validate_rows
    raise ValueError(f"expected a ({ROWS}, {COLS}) array of encoded characters")
ValueError: expected a (6, 22) array of encoded characters
jparise commented 1 year ago

Thanks for spotting that, @garthwebb! Those examples should have used vesta.encode_text() to render the full character array. I've updated the README.md accordingly.