Skip to content

Commit 8b2ae08

Browse files
committed
Bugfix to prevent an exception for events that are not related to a specific door or auxiliary
1 parent e7dafd6 commit 8b2ae08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

c3/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ def _update_inout_status(self, logs: list[rtlog.RTLogRecord]):
446446
for lock_nr in range(1, self.nr_of_locks+1):
447447
self._set_lock_status(lock_nr, log.door_sensor_status(lock_nr), auto_close=False)
448448

449-
elif isinstance(log, rtlog.EventRecord):
449+
elif isinstance(log, rtlog.EventRecord) and log.port_nr-1 in range(self.nr_of_locks):
450450
if log.event_type == consts.EventType.OPEN_AUX_OUTPUT:
451451
self._set_aux_out_status(log.port_nr, consts.InOutStatus.OPEN, auto_close=False)
452452
elif log.event_type == consts.EventType.CLOSE_AUX_OUTPUT:

0 commit comments

Comments
 (0)