Skip to content

Commit 105c992

Browse files
committed
Correct varname, implement docstring suggestion
1 parent eef119c commit 105c992

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

plugwise_usb/network/registry.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,28 @@ def scan_completed(self) -> bool:
102102
def start_node_discover(
103103
self, callback: Callable[[str, NodeType | None, bool], Awaitable[bool]]
104104
) -> None:
105-
"""Register method to be called when a node is found."""
105+
"""Register async callback invoked when a node is found.
106+
107+
Args:
108+
mac: Node MAC address.
109+
node_type: NodeType if known (from cache), else None.
110+
ping_first: True when invoked from cache phase, False during Circle+ scan or manual register.
111+
Returns:
112+
bool: True when discovery succeeded; False to allow caller to fallback (e.g., SED path).
113+
"""
106114
self._start_node_discover = callback
107115

108116
def scan_completed_callback(self, callback: Callable[[], Awaitable[None]]) -> None:
109117
"""Register method to be called when a registry scan has completed."""
110118
self._scan_completed_callback = callback
111119

112120
async def _exec_node_discover_callback(
113-
self, mac: str, node_type: NodeType | None, output: bool,
121+
self, mac: str, node_type: NodeType | None, ping_first: bool,
114122
) -> None:
115123
"""Protect _start_node_discover() callback execution."""
116124
if self._start_node_discover is not None:
117125
try:
118-
await self._start_node_discover(mac, node_type, output)
126+
await self._start_node_discover(mac, node_type, ping_first)
119127
except CancelledError:
120128
raise
121129
except Exception:

0 commit comments

Comments
 (0)