Skip to content

Commit

Permalink
Add portal and networking constants (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
shbatm authored Feb 7, 2023
1 parent 8244ea9 commit 135abf3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyisy/isy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
from .constants import (
ATTR_ACTION,
CMD_X10,
CONFIG_NETWORKING,
CONFIG_PORTAL,
ES_CONNECTED,
ES_RECONNECT_FAILED,
ES_RECONNECTING,
Expand Down Expand Up @@ -133,7 +135,7 @@ async def initialize(self, with_node_servers=False):
self.conn.get_variable_defs(),
self.conn.get_variables(),
]
if self.configuration["Networking Module"]:
if self.configuration[CONFIG_NETWORKING] or self.configuration[CONFIG_PORTAL]:
isy_setup_tasks.append(asyncio.create_task(self.conn.get_network()))
isy_setup_results = await asyncio.gather(*isy_setup_tasks)

Expand All @@ -145,7 +147,7 @@ async def initialize(self, with_node_servers=False):
def_xml=isy_setup_results[4],
var_xml=isy_setup_results[5],
)
if self.configuration["Networking Module"]:
if self.configuration[CONFIG_NETWORKING] or self.configuration[CONFIG_PORTAL]:
self.networking = NetworkResources(self, xml=isy_setup_results[6])
await self.nodes.update(xml=isy_setup_results[0])
if self.node_servers and with_node_servers:
Expand Down

0 comments on commit 135abf3

Please sign in to comment.