Skip to content

Commit

Permalink
Adapt expression to test if IEEE is coordinator (zigpy changes?)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Jun 10, 2023
1 parent f475115 commit 8b4b106
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions custom_components/zha_toolkit/binds.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,11 @@ async def bind_ieee(
# when command_data is set to 0 or false, bind to coordinator
data = app.ieee

isCoordinatorTarget = str(data) == str(app.ieee)

dst_dev = await u.get_device(app, listener, data)

# Coordinator has nwk address 0
isCoordinatorTarget = dst_dev.nwk == 0x0000

zdo = src_dev.zdo
src_out_clusters = BINDABLE_OUT_CLUSTERS
src_in_clusters = BINDABLE_IN_CLUSTERS
Expand Down
3 changes: 2 additions & 1 deletion custom_components/zha_toolkit/zha.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ async def zha_devices(
devices = [device.zha_device_info for device in listener.devices.values()]

if ieee is not None:
ieee = str(ieee)
# Select only the device with the given address
devices = [d for d in devices if d["ieee"] == ieee]
devices = [d for d in devices if str(d['ieee']) == ieee ]

# Set default value for 'devices' in event_data,
# may be slimmed down. Ensures that devices is set in case
Expand Down

0 comments on commit 8b4b106

Please sign in to comment.