Skip to content

Commit

Permalink
Annotate emcy.EmcyProducer.network and avoid None dummy value.
Browse files Browse the repository at this point in the history
Use a _DummyNetwork object instead.
  • Loading branch information
acolomb committed Aug 11, 2024
1 parent 2e01485 commit 1c56ec1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion canopen/emcy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
import time
from typing import Callable, List, Optional

import canopen.network


# Error code, error register, vendor specific data
EMCY_STRUCT = struct.Struct("<HB5s")

Expand Down Expand Up @@ -82,7 +85,7 @@ def wait(
class EmcyProducer:

def __init__(self, cob_id: int):
self.network = None
self.network: canopen.network.Network = canopen.network._DummyNetwork()
self.cob_id = cob_id

def send(self, code: int, register: int = 0, data: bytes = b""):
Expand Down

0 comments on commit 1c56ec1

Please sign in to comment.