Skip to content

Mergemaster#140

Merged
beniroquai merged 3 commits into
masterfrom
mergemaster
Jun 3, 2026
Merged

Mergemaster#140
beniroquai merged 3 commits into
masterfrom
mergemaster

Conversation

@beniroquai

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 3, 2026 08:11
@beniroquai beniroquai merged commit 1d6be0e into master Jun 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request extends the Python UC2 client by adding a fan controller module and improves serial link robustness (baudrate handling, reconnect behavior, and a lightweight connection health check). It also removes an accidental Jupyter checkpoint file from documentation.

Changes:

  • Add Fan module and expose it via UC2Client.fan.
  • Improve serial connection handling: honor caller-provided baudrate, refine is_connected semantics, add reconnect(port=..., baudrate=...), and add a ping() helper.
  • Remove DOCUMENTATION/.ipynb_checkpoints/... notebook checkpoint from version control.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
uc2rest/UC2Client.py Imports/initializes new Fan controller on client creation.
uc2rest/mserial.py Serial connection robustness improvements (baudrate propagation, connection state tracking, reconnect + ping).
uc2rest/fan.py New fan controller wrapper (get/set fan state, temperature readout, callback integration).
DOCUMENTATION/.ipynb_checkpoints/DOC_UC2Client-PinConfigurator-checkpoint.ipynb Removes an auto-generated Jupyter checkpoint file from the repo.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread uc2rest/UC2Client.py
Comment on lines +135 to 140
# initialize fan controller
self.fan = Fan(self)

# initialize laser
self.state = State(self)

Comment thread uc2rest/mserial.py
Comment on lines 109 to +114
try: # try to close an eventually open serial connection
if str(type(self.ser)) != "<class 'uc2rest.mserial.MockSerial'>":
self.serialdevice.close()
except: pass


# Honour the baudrate passed in — previously tryToConnect used
Comment thread uc2rest/mserial.py
Comment on lines 318 to 322
mReadline = self._read(self.serialdevice)
if mReadline == False :
nFailedCommands += 1
if nFailedCommands > nFailedCommandsMax:
raise Exception("Failed to read the line in serial: "+str(mReadline))
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.

2 participants