Skip to content

Commit

Permalink
pybricksdev.connections.pybricks: fix write_line endline
Browse files Browse the repository at this point in the history
While Miropython prints `\r\n` for endlines, when receiving input, it
only looks for `\n`.
  • Loading branch information
dlech committed Apr 21, 2023
1 parent 33056f4 commit a08db5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed
- Fixed endline in `PybricksHub.write_line()`.

## [1.0.0-alpha.44] - 2023-04-20

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions pybricksdev/connections/pybricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,13 @@ async def write_string(self, value: str) -> None:

async def write_line(self, value: str) -> None:
"""
Writes a string to stdin on the hub and adds a newline (``\\r\\n``)
Writes a string to stdin on the hub and adds a newline (``\\n``)
to the end.
Args:
value: The string to write.
"""
await self.write_string(value + self.EOL.decode())
await self.write_string(value + "\n")

async def read_line(self) -> str:
"""
Expand Down

0 comments on commit a08db5f

Please sign in to comment.