From 712cc3194d8c138b33b2bad553db338cbb578b04 Mon Sep 17 00:00:00 2001 From: Jef-GB <123937280+Jef-GB@users.noreply.github.com> Date: Tue, 24 Oct 2023 09:21:39 +0200 Subject: [PATCH] Removed automatic change from NMT BOOTING to NMT PRE-OPERATIONAL Removed the if statement for automatically setting the NMT state to pre-operational when the node published a message with the value booting. --- canopen/nmt.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/canopen/nmt.py b/canopen/nmt.py index 98d8ea25..ff42fe1b 100644 --- a/canopen/nmt.py +++ b/canopen/nmt.py @@ -122,11 +122,8 @@ def on_heartbeat(self, can_id, data, timestamp): logger.debug("Received heartbeat can-id %d, state is %d", can_id, new_state) for callback in self._callbacks: callback(new_state) - if new_state == 0: - # Boot-up, will go to PRE-OPERATIONAL automatically - self._state = 127 - else: - self._state = new_state + + self._state = new_state self._state_received = new_state self.state_update.notify_all()