Skip to content

Commit

Permalink
Merge pull request #998 from puddly/puddly/load-network-info-after-form
Browse files Browse the repository at this point in the history
Load network information after forming a new network
  • Loading branch information
puddly committed Jun 19, 2022
2 parents 01feddc + c65d3d6 commit 3fa9eaf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_application.py
Expand Up @@ -593,7 +593,9 @@ async def test_startup_formed(app):
async def test_startup_not_formed(app):
app.start_network = AsyncMock()
app.form_network = AsyncMock()
app.load_network_info = AsyncMock(side_effect=NetworkNotFormed())
app.load_network_info = AsyncMock(
side_effect=[NetworkNotFormed(), NetworkNotFormed(), None]
)
app.permit = AsyncMock()

with pytest.raises(NetworkNotFormed):
Expand Down
1 change: 1 addition & 0 deletions zigpy/application.py
Expand Up @@ -72,6 +72,7 @@ async def startup(self, *, auto_form: bool = False):

LOGGER.info("Forming a new network")
await self.form_network()
await self.load_network_info(load_devices=False)

LOGGER.debug("Network info: %s", self.state.network_info)
LOGGER.debug("Node info: %s", self.state.node_info)
Expand Down

0 comments on commit 3fa9eaf

Please sign in to comment.