File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -92,8 +92,8 @@ def cache_folder(self, cache_folder: str) -> None:
9292 self ._network_cache .cache_root_directory = cache_folder
9393
9494 @property
95- def registry (self ) -> dict [ int , tuple [ str , NodeType | None ] ]:
96- """Return dictionary with all joined nodes."""
95+ def registry (self ) -> list [ str ]:
96+ """Return list with mac's of all joined nodes."""
9797 return deepcopy (self ._registry )
9898
9999 @property
@@ -252,13 +252,8 @@ async def unregister_node(self, mac: str) -> None:
252252 if not validate_mac (mac ):
253253 raise NodeError (f"MAC { mac } invalid" )
254254
255- mac_registered = False
256- for registration in self ._registry .values ():
257- if mac == registration [0 ]:
258- mac_registered = True
259- break
260- if not mac_registered :
261- raise NodeError (f"No existing registration '{ mac } ' found to unregister" )
255+ if mac not in self ._registry ():
256+ raise NodeError (f"No existing Node ({ mac } ) found to unregister" )
262257
263258 request = NodeRemoveRequest (self ._send_to_controller , self ._mac_nc , mac )
264259 if (response := await request .send ()) is None :
You can’t perform that action at this time.
0 commit comments