Skip to content

Commit b06e638

Browse files
committed
Create a zigpy device for the coordinator itself (fixes #27)
1 parent 0b6100c commit b06e638

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

zigpy_znp/zigbee/application.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import zigpy.util
99
import zigpy.types
10+
import zigpy.device
1011
import zigpy.config
1112
import zigpy.application
1213
import zigpy.profiles
@@ -453,6 +454,9 @@ async def startup(self, auto_form=False):
453454
self.channel,
454455
)
455456

457+
# Add the coordinator as a device to make groups work
458+
self.devices[self.ieee] = ZNPCoordinator(self, self.ieee, self.nwk)
459+
456460
async def update_network(
457461
self,
458462
*,
@@ -828,3 +832,13 @@ async def permit_ncp(self, time_s: int) -> None:
828832

829833
if response.Status != t.Status.SUCCESS:
830834
raise RuntimeError(f"Permit join response failure: {response}")
835+
836+
837+
class ZNPCoordinator(zigpy.device.Device):
838+
@property
839+
def manufacturer(self):
840+
return "Texas Instruments"
841+
842+
@property
843+
def model(self):
844+
return "ZNP Coordinator"

0 commit comments

Comments
 (0)