File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
src/main/python/main/ayab/engine Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -186,13 +186,13 @@ def __log_indState(self, msg: bytes) -> None:
186
186
state = msg [2 ]
187
187
hallLeft = struct .unpack (">H" , msg [3 :5 ])[0 ]
188
188
hallRight = struct .unpack (">H" , msg [5 :7 ])[0 ]
189
- carriage = carriageMap [ msg [7 ]]
189
+ carriage = carriageMap . get ( msg [ 7 ], f"0x { msg [7 ]:02x } ?" )
190
190
position = msg [8 ]
191
- direction = directionMap [ msg [9 ]]
191
+ direction = directionMap . get ( msg [ 9 ], f"0x { msg [9 ]:02x } ?" )
192
192
193
193
try : # AyabAsync supplies additional parameters
194
- hallActive = machineSideMap [ msg [10 ]]
195
- beltShift = beltShiftMap [ msg [11 ]]
194
+ hallActive = machineSideMap . get ( msg [ 10 ], f"0x { msg [10 ]:02x } ?" )
195
+ beltShift = beltShiftMap . get ( msg [ 11 ], f"0x { msg [11 ]:02x } ?" )
196
196
self .logger .info (
197
197
f"IndState: { error :1d} { state :1d} { position :3d} "
198
198
f" { carriage :5s} ({ beltShift :11s} ,{ direction :5s} )"
You can’t perform that action at this time.
0 commit comments