diff --git a/pypck/connection.py b/pypck/connection.py index 05ead61..4d42a42 100644 --- a/pypck/connection.py +++ b/pypck/connection.py @@ -411,7 +411,9 @@ def get_module_conn( addr = LcnAddr(self.local_seg_id, addr.addr_id, addr.is_group) address_conn = self.address_conns.get(addr, None) if address_conn is None: - address_conn = ModuleConnection(self, addr) + address_conn = ModuleConnection( + self, addr, wants_ack=self.settings["ACKNOWLEDGE"] + ) if request_serials: self.task_registry.create_task(address_conn.request_serials()) self.address_conns[addr] = address_conn diff --git a/pypck/lcn_defs.py b/pypck/lcn_defs.py index 2a04542..d667491 100644 --- a/pypck/lcn_defs.py +++ b/pypck/lcn_defs.py @@ -1386,6 +1386,7 @@ class AccessControlPeriphery(Enum): # failed-state. "SK_NUM_TRIES": 3, # Total number of segment coupler scan tries "DIM_MODE": OutputPortDimMode.STEPS50, + "ACKNOWLEDGE": True, # modules request an acknowledge command "PING_TIMEOUT": 600000, # The default timeout for pings sent to PCHK. "DEFAULT_TIMEOUT_MSEC": 3500, # Default timeout for send command retries "MAX_STATUS_EVENTBASED_VALUEAGE_MSEC": 600000, # Poll interval for diff --git a/pypck/module.py b/pypck/module.py index 7b8bf87..aac1aec 100644 --- a/pypck/module.py +++ b/pypck/module.py @@ -751,10 +751,13 @@ def __init__( activate_status_requests: bool = False, has_s0_enabled: bool = False, software_serial: int | None = None, + wants_ack: bool = True, ): """Construct ModuleConnection instance.""" assert not addr.is_group - super().__init__(conn, addr, software_serial=software_serial, wants_ack=True) + super().__init__( + conn, addr, software_serial=software_serial, wants_ack=wants_ack + ) self.activate_status_requests = activate_status_requests self.has_s0_enabled = has_s0_enabled @@ -796,10 +799,6 @@ def __init__( if self.activate_status_requests: self.task_registry.create_task(self.activate_status_request_handlers()) - def set_wants_ack(self, wants_ack: bool) -> None: - """Set request acknowledgement.""" - self.wants_ack = wants_ack - async def send_command(self, wants_ack: bool, pck: str | bytes) -> bool: """Send a command to the module represented by this class.