Skip to content

Commit

Permalink
mcu: expose non critical status (#473)
Browse files Browse the repository at this point in the history
* mcu: expose non critical status

* docs: adds non_critical_disconnected to Status_Reference.md

* mcu: only report if it is non critical
  • Loading branch information
rogerlz authored Dec 20, 2024
1 parent cf9b9d7 commit 5c42ff9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/Status_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ objects:
- `power`: The fan power as a float between 0|`min_power` and 1.0|`max_power`.
- `rpm`: The measured fan speed in rotations per minute if the fan has
a tachometer_pin defined.
deprecated objects (for UI compatibility only):
- `speed`: The fan speed as a float between 0.0 and `max_power`.
deprecated objects (for UI compatibility only):
- `speed`: The fan speed as a float between 0.0 and `max_power`.

## filament_switch_sensor

Expand Down Expand Up @@ -346,6 +346,7 @@ The following information is available in
micro-controller architectures and with each code revision.
- `last_stats.<statistics_name>`: Statistics information on the
micro-controller connection.
- `non_critical_disconnected`: True/False if the mcu is disconnected.

## motion_report

Expand Down
4 changes: 4 additions & 0 deletions klippy/mcu.py
Original file line number Diff line number Diff line change
Expand Up @@ -1148,9 +1148,13 @@ def _check_serial_exists(self):
def _mcu_identify(self):
if self.is_non_critical and not self._check_serial_exists():
self.non_critical_disconnected = True
if self.is_non_critical:
self._get_status_info["non_critical_disconnected"] = True
return False
else:
self.non_critical_disconnected = False
if self.is_non_critical:
self._get_status_info["non_critical_disconnected"] = False
if self.is_fileoutput():
self._connect_file()
else:
Expand Down

0 comments on commit 5c42ff9

Please sign in to comment.