Skip to content

Commit

Permalink
Network: Remove sender parameter
Browse files Browse the repository at this point in the history
This commit closes #61.
  • Loading branch information
sanssecours committed Sep 9, 2024
1 parent ec362fa commit ea01755
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
3 changes: 0 additions & 3 deletions Documentation/API/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ To communicate with the ICOtronic system use the :class:`Network` class:

.. autoclass:: Network

.. note::
Please ignore the ``sender`` parameter, you will never need to change it. In fact, we are `planning to get rid of the parameter in a future version of ICOc <https://github.com/MyTooliT/ICOc/issues/61>`_.

We recommend you use the context manager to open and close the connection (to the STU):

.. doctest::
Expand Down
10 changes: 2 additions & 8 deletions mytoolit/can/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,20 +387,14 @@ class Network:
# - https://mytoolit.github.io/Documentation/#page-system-configuration
ADVERTISEMENT_TIME_EEPROM_TO_MS = 0.625

def __init__(self, sender: Union[str, Node] = "SPU 1") -> None:
def __init__(self) -> None:
"""Create a new network from the given arguments
Please note, that you have to clean up used resources after you use
this class using the method `shutdown`. Since this class implements
the context manager interface we recommend you use a with statement to
handle the cleanup phase automatically.
Parameters
----------
sender:
The default sender of the network
Examples
--------
Expand Down Expand Up @@ -447,7 +441,7 @@ def __init__(self, sender: Union[str, Node] = "SPU 1") -> None:
# We create the notifier when we need it for the first time, since
# there might not be an active loop when you create the network object
self._notifier: Optional[Notifier] = None
self.sender = Node(sender)
self.sender = Node("SPU 1")

async def __aenter__(self) -> Network:
"""Initialize the network
Expand Down

0 comments on commit ea01755

Please sign in to comment.