File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1+ import collections .abc
12import functools
23import inspect
34import typing
@@ -244,6 +245,8 @@ def _get_topic_type(
244245) -> Optional [Callable [[ntcore .Topic ], typing .Any ]]:
245246 if return_annotation in _topic_types :
246247 return _topic_types [return_annotation ]
248+ if hasattr (return_annotation , "WPIStruct" ):
249+ return lambda topic : ntcore .StructTopic (topic , return_annotation )
247250
248251 # Check for PEP 484 generic types
249252 origin = getattr (return_annotation , "__origin__" , None )
@@ -256,6 +259,8 @@ def _get_topic_type(
256259 inner_type = args [0 ]
257260 if inner_type in _array_topic_types :
258261 return _array_topic_types [inner_type ]
262+ if hasattr (inner_type , "WPIStruct" ):
263+ return lambda topic : ntcore .StructArrayTopic (topic , inner_type )
259264
260265
261266def collect_feedbacks (component , cname : str , prefix : Optional [str ] = "components" ):
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ zip_safe = False
2424include_package_data = True
2525packages = find:
2626install_requires =
27- wpilib>=2024.1.1.0 ,<2025
27+ wpilib>=2024.3.2.1 ,<2025
2828setup_requires =
2929 setuptools_scm > 6
3030python_requires = >=3.8
You can’t perform that action at this time.
0 commit comments