Skip to content

Commit abbc2dc

Browse files
committed
Updated after merging in master
1 parent 30d695d commit abbc2dc

File tree

13 files changed

+31
-38
lines changed

13 files changed

+31
-38
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ __pycache__/
1111
# Distribution / packaging
1212
.Python
1313
env/
14+
venv/
1415
build/
1516
develop-eggs/
1617
dist/

README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ The :code:`n` is the PDO index (normally 1 to 4). The second form of access is f
139139
# network.connect(bustype='nican', channel='CAN0', bitrate=250000)
140140
141141
# Read a variable using SDO
142-
device_name = node.sdo['Manufacturer device name'].get_raw()
143-
vendor_id = node.sdo[0x1018][1].get_raw()
142+
device_name = node.sdo['Manufacturer device name'].raw
143+
vendor_id = node.sdo[0x1018][1].raw
144144
145145
# Write a variable using SDO
146-
node.sdo['Producer heartbeat time'].set_raw(1000)
146+
node.sdo['Producer heartbeat time'].raw = 1000
147147
148148
# Read PDO configuration from node
149149
node.tpdo.read()
@@ -167,8 +167,8 @@ The :code:`n` is the PDO index (normally 1 to 4). The second form of access is f
167167
168168
# Read a value from TPDO[1]
169169
node.tpdo[1].wait_for_reception()
170-
speed = node.tpdo[1]['Velocity actual value'].get_phys()
171-
val = node.tpdo['Some group.Some subindex'].get_raw()
170+
speed = node.tpdo[1]['Velocity actual value'].phys
171+
val = node.tpdo['Some group.Some subindex'].raw
172172
173173
# Disconnect from CAN bus
174174
network.sync.stop()

canopen/emcy.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
import struct
32
import logging
43
import threading

canopen/lss.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
from typing import Optional, TYPE_CHECKING
32
import logging
43
import time

canopen/nmt.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
import threading
32
import logging
43
import struct
@@ -11,7 +10,6 @@
1110
if TYPE_CHECKING:
1211
from canopen.network import Network
1312

14-
1513
logger = logging.getLogger(__name__)
1614

1715
NMT_STATES = {

canopen/node/base.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from __future__ import annotations
2-
from typing import TextIO, Union, Optional, TYPE_CHECKING
1+
from typing import TextIO, Union, TYPE_CHECKING
32

43
from canopen.objectdictionary import ObjectDictionary, import_od
54

@@ -22,7 +21,7 @@ def __init__(
2221
node_id: int,
2322
object_dictionary: Union[ObjectDictionary, str, TextIO],
2423
):
25-
self.network: Optional[Network] = None
24+
self.network: Network | None = None
2625

2726
if not isinstance(object_dictionary, ObjectDictionary):
2827
object_dictionary = import_od(object_dictionary, node_id)

canopen/node/remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(
3939
#: Enable WORKAROUND for reversed PDO mapping entries
4040
self.curtis_hack = False
4141

42-
self.sdo_channels: List[SdoClient] = []
42+
self.sdo_channels: list[SdoClient] = []
4343
self.sdo = self.add_sdo(0x600 + self.id, 0x580 + self.id)
4444
self.tpdo = TPDO(self)
4545
self.rpdo = RPDO(self)

canopen/objectdictionary/eds.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
import copy
32
import logging
43
import re

canopen/pdo/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
import logging
32

43
from canopen import node

canopen/sdo/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import annotations
21
import binascii
32
from typing import Iterable, Union, Optional, TYPE_CHECKING
43
try:

0 commit comments

Comments
 (0)