Closed uzlonewolf closed 1 year ago
Turns out when setting Zigbee DPs, "devId" must match the cid or be omitted. New "zigbee" device type added to handle this.
@uzlonewolf this is great! You're amazing. Thank you! I don't have a zigbee gw to test but I trust you. I will try to pick one up for a 2nd test.
I think we should add your zigbee.py example above in the examples
folder and/or a note of zigbee parent/child support in the README (with reference to the example).
This was the one I was testing with: https://www.amazon.com/dp/B0969ZHH83
I also picked up a https://www.amazon.com/dp/B09LM644XJ to see how it acts when not registered but haven't had a chance to mess with it yet.
I'll try to get that example added later today.
This PR updates Zigbee Gateway handling to be a parent/child model. First a connection is made to the gateway, and then one or more children are attached to that gateway. This allows persistence to be used to receive async updates for multiple different devices simultaneously. When sending commands it also makes an attempt to only return responses from the selected child, even if an async update from a different child is received first.
The wizard has been updated to include the node_id and parent device id in the devices.json file.
As the device id of a child is used for identification, all children must have unique device ids. Tuya's cloud assigns a unique id to every device so this should not be a problem as long as the correct device id from devices.json is used.
When a response containing a known cid is received,
result['device']
contains a reference to the child device object and can be used in place of the original object.Closes #31