Skip to content

Restore documented Nextion.encoding property - #37

Merged
yozik04 merged 3 commits into
masterfrom
fix-encoding-property
Nov 11, 2026
Merged

yozik04 merged 3 commits into
masterfrom
fix-encoding-property

Conversation

@yozik04

@yozik04 yozik04 commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Refs #23

Problem

README documents client.encoding = 'latin-1' and print(client.encoding), but Nextion only had _encoding. Assigning client.encoding created an unused attribute, so commands kept encoding as ASCII and non-ASCII text such as ° failed.

Change

  • Add an encoding property (getter/setter over _encoding), used for both outgoing commands and incoming string replies.
  • README: note that the encoding must match the Nextion project character set/fonts, with a degree-sign example.

Tests

  • test_encoding_setter_is_used_for_commands: default is ascii; after client.encoding = 'latin-1', get decodes 21°C and set sends b't0.txt="21\xb0C"'. Fails on master with AttributeError.
  • pytest: 65 passed. black/flake8 clean.

Not verified

The scrolling-text component behaviour reported in #23 was not reproduced (no hardware), so this PR does not close #23.

yozik04 and others added 3 commits November 11, 2026 21:49
The README documents client.encoding for switching the serial codec at
runtime, but the client only had a private _encoding attribute, so the
assignment silently did nothing. Expose it as a property and document
that it must match the project's character set.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…load notes

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@yozik04
yozik04 merged commit 59ac542 into master Nov 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Degree symbol

1 participant