File tree Expand file tree Collapse file tree 1 file changed +18
-17
lines changed Expand file tree Collapse file tree 1 file changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -238,23 +238,24 @@ def _create_bus_config(config: Dict[str, Any]) -> typechecking.BusConfig:
238
238
if not 0 < port < 65535 :
239
239
raise ValueError ("Port config must be inside 0-65535 range!" )
240
240
241
- try :
242
- if set (typechecking .BitTimingFdDict .__annotations__ ).issubset (set (config )):
243
- config ["timing" ] = can .BitTimingFd (
244
- ** {
245
- key : int (config [key ])
246
- for key in typechecking .BitTimingFdDict .__annotations__
247
- }
248
- )
249
- elif set (typechecking .BitTimingDict .__annotations__ ).issubset (set (config )):
250
- config ["timing" ] = can .BitTiming (
251
- ** {
252
- key : int (config [key ])
253
- for key in typechecking .BitTimingDict .__annotations__
254
- }
255
- )
256
- except (ValueError , TypeError ):
257
- pass
241
+ if config .get ("timing" , None ) is None :
242
+ try :
243
+ if set (typechecking .BitTimingFdDict .__annotations__ ).issubset (config ):
244
+ config ["timing" ] = can .BitTimingFd (
245
+ ** {
246
+ key : int (config [key ])
247
+ for key in typechecking .BitTimingFdDict .__annotations__
248
+ }
249
+ )
250
+ elif set (typechecking .BitTimingDict .__annotations__ ).issubset (config ):
251
+ config ["timing" ] = can .BitTiming (
252
+ ** {
253
+ key : int (config [key ])
254
+ for key in typechecking .BitTimingDict .__annotations__
255
+ }
256
+ )
257
+ except (ValueError , TypeError ):
258
+ pass
258
259
259
260
if "bitrate" in config :
260
261
config ["bitrate" ] = int (config ["bitrate" ])
You can’t perform that action at this time.
0 commit comments