Skip to content

Commit

Permalink
No error on missing def.
Browse files Browse the repository at this point in the history
  • Loading branch information
shbatm committed Feb 9, 2023
1 parent 050af4e commit 6a73cdf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"eisy",
"nodedefs",
"Polisy",
"pyisyox",
"qualname",
"websession",
"xmltodict",
Expand Down
4 changes: 2 additions & 2 deletions pyisyox/nodes/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,10 @@ def get_node_def(self) -> NodeDef | None:
"""Retrieve the node server information for a node and control."""
if not (self.protocol == Protocol.NODE_SERVER and self.node_def_id):
return None

servers: NodeServers = self.isy.node_servers
if not servers.loaded or self.node_server not in servers.slots:
raise ValueError("Node definitions not loaded")
return None

if not (profile := servers.profiles.get(self.node_server)) or profile is None:
_LOGGER.error("Node profile not found")
return None
Expand Down

0 comments on commit 6a73cdf

Please sign in to comment.