Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Motion Console TEC status query to use a single OW_CTRL_TEC_STATUS response containing a structured “TecStats” payload, intended to support tripping behavior on overheating.
Changes:
- Replaces the prior two-step TEC status read (status flag + ADC read) with a single TecStats unpack.
- Adds TecStats struct parsing (
<I4f?) and validates minimum response length. - Clears the UART buffer after the TEC status request before parsing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@georgevigelette I've opened a new pull request, #32, to work on those changes. Once the pull request is ready, I'll request review from you. |
[WIP] [WIP] Address feedback from review on 'update tec_status' pull request
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
omotion/Console.py:1369
tec_statusnow advertisesTuple[str, str, str, str, bool]and returns formatted strings, but in demo mode it still returns numeric floats, and the docstring describes numeric values. This makes the API inconsistent across modes and is a breaking change for callers that previously consumed floats. Prefer returning floats consistently (update the annotation/docstring and return raw floats in both the legacy and TecStats paths), and keep formatting confined to logging/UI layers.
def tec_status(self) -> Tuple[str, str, str, str, bool]:
"""
Get TEC status: (voltage, Temperature Setpoint, TEC Current, TEC Voltage, TEC Good)
Returns:
tuple: (volt, temp_set, tec_curr, tec_volt, tec_good)
Raises:
ValueError: If not connected or response lengths are unexpected.
Exception: If the device reports an OW_ERROR.
"""
try:
# Demo mode mock
if getattr(self.uart, "demo_mode", False):
return (1.0, 0.5, 0.5, 25.0, True)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
update tec-status to support tripping on overheating.