Skip to content

Commit 41e4706

Browse files
committed
add can_filters with typing information to the signature of SocketcanBus
1 parent 59139e9 commit 41e4706

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

can/interfaces/socketcan/socketcan.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
RestartableCyclicTaskABC,
3535
LimitedDurationCyclicSendTaskABC,
3636
)
37+
from can.typechecking import CanFilters
3738
from can.interfaces.socketcan.constants import * # CAN_RAW, CAN_*_FLAG
3839
from can.interfaces.socketcan.utils import pack_filters, find_available_interfaces
3940

@@ -593,6 +594,7 @@ def __init__(
593594
channel: str = "",
594595
receive_own_messages: bool = False,
595596
fd: bool = False,
597+
can_filters: Optional[CanFilters] = None,
596598
**kwargs,
597599
) -> None:
598600
"""Creates a new socketcan bus.
@@ -613,7 +615,7 @@ def __init__(
613615
If transmitted messages should also be received by this bus.
614616
:param fd:
615617
If CAN-FD frames should be supported.
616-
:param List can_filters:
618+
:param can_filters:
617619
See :meth:`can.BusABC.set_filters`.
618620
"""
619621
self.socket = create_socket()
@@ -647,7 +649,7 @@ def __init__(
647649

648650
bind_socket(self.socket, channel)
649651
kwargs.update({"receive_own_messages": receive_own_messages, "fd": fd})
650-
super().__init__(channel=channel, **kwargs)
652+
super().__init__(channel=channel, can_filters=can_filters, **kwargs)
651653

652654
def shutdown(self) -> None:
653655
"""Stops all active periodic tasks and closes the socket."""

0 commit comments

Comments
 (0)