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
1
2
import functools
2
3
import inspect
3
4
import typing
@@ -244,6 +245,8 @@ def _get_topic_type(
244
245
) -> Optional [Callable [[ntcore .Topic ], typing .Any ]]:
245
246
if return_annotation in _topic_types :
246
247
return _topic_types [return_annotation ]
248
+ if hasattr (return_annotation , "WPIStruct" ):
249
+ return lambda topic : ntcore .StructTopic (topic , return_annotation )
247
250
248
251
# Check for PEP 484 generic types
249
252
origin = getattr (return_annotation , "__origin__" , None )
@@ -256,6 +259,8 @@ def _get_topic_type(
256
259
inner_type = args [0 ]
257
260
if inner_type in _array_topic_types :
258
261
return _array_topic_types [inner_type ]
262
+ if hasattr (inner_type , "WPIStruct" ):
263
+ return lambda topic : ntcore .StructArrayTopic (topic , inner_type )
259
264
260
265
261
266
def 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
24
24
include_package_data = True
25
25
packages = find:
26
26
install_requires =
27
- wpilib>=2024.1.1.0 ,<2025
27
+ wpilib>=2024.3.2.1 ,<2025
28
28
setup_requires =
29
29
setuptools_scm > 6
30
30
python_requires = >=3.8
You can’t perform that action at this time.
0 commit comments