Skip to content

Commit

Permalink
Cleanup/clarify commission_on_network (#415)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Hjelmare <[email protected]>
  • Loading branch information
marcelveldt and MartinHjelmare authored Oct 25, 2023
1 parent 916677a commit 93c6a65
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
15 changes: 1 addition & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Inform the controller about the Thread credentials it needs to use when commissi
```

**Commission with code**
Commission a new device. For WiFi or Thread based devices, the credentials need to be set upfront, otherwise commisisoning will fail.
Commission a new device. For WiFi or Thread based devices, the credentials need to be set upfront, otherwise commissioning will fail. Supports both QR-code syntax (MT:...) and manual pairing code as string.
The controller will use bluetooth for the commissioning of wireless devices. If the machine running the Python Matter Server controller lacks bluetooth support, commissioning will only work for devices already connected to the network (by cable or another controller).

```json
Expand All @@ -196,19 +196,6 @@ The controller will use bluetooth for the commissioning of wireless devices. If
}
```

**Commission on Network**
Commission a device already connected to the network.

```json
{
"message_id": "2",
"command": "commission_on_network",
"args": {
"setup_pin_code": 1234567
}
}
```

**Open Commissioning window**
Open a commissioning window to commission a device present on this controller to another.
Returns code to use as discriminator.
Expand Down
5 changes: 4 additions & 1 deletion matter_server/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ async def commission_with_code(self, code: str) -> MatterNodeData:

async def commission_on_network(self, setup_pin_code: int) -> MatterNodeData:
"""
Commission a device already connected to the network.
Do the routine for OnNetworkCommissioning.
NOTE: For advanced usecases only, use `commission_with_code`
for regular commissioning.
Returns basic MatterNodeData once complete.
"""
Expand Down
7 changes: 5 additions & 2 deletions matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,14 @@ async def commission_on_network(
filter: Any = None, # pylint: disable=redefined-builtin
) -> MatterNodeData:
"""
Commission a device already connected to the network.
Do the routine for OnNetworkCommissioning, with a filter for mDNS discovery.
Does the routine for OnNetworkCommissioning, with a filter for mDNS discovery.
The filter can be an integer,
a string or None depending on the actual type of selected filter.
NOTE: For advanced usecases only, use `commission_with_code`
for regular commissioning.
Returns full NodeInfo once complete.
"""
if self.chip_controller is None:
Expand Down

0 comments on commit 93c6a65

Please sign in to comment.