I recently discovered another issue with having tons of devices. Like I mentioned in https://github.com/jasonacox/tinytuya/discussions/208#discussioncomment-4082687, I'm dumping a bunch of device sockets into select.select() just like the scanner does. Do you know what happens if you turn debug on and then poll the status of 52 devices simultaneously? It's... not pretty. So, I reworked the logging. Log messages now include the "name" of the source, which for devices is i.e. "tinytuya.OutletDevice.eb1######s". Initially I removed the red coloring of the text from the message, but then decided it was probably there for a reason and put it back. I did keep the device ID in cyan though. Red removed:
Red put back:
When I added the per-device debug toggle I also made its color selection independent (default is to match the global). I didn't intend it to be this way, but it worked out really well as it allows things like:
Anyway, I have this as a draft as it needs a *lot* more testing. I've only verified it works for basic functions.
I recently discovered another issue with having tons of devices. Like I mentioned in https://github.com/jasonacox/tinytuya/discussions/208#discussioncomment-4082687, I'm dumping a bunch of device sockets into select.select() just like the scanner does. Do you know what happens if you turn debug on and then poll the status of 52 devices simultaneously? It's... not pretty. So, I reworked the logging. Log messages now include the "name" of the source, which for devices is i.e. "tinytuya.OutletDevice.eb1######s". Initially I removed the red coloring of the text from the message, but then decided it was probably there for a reason and put it back. I did keep the device ID in cyan though. Red removed:![Screenshot from 2023-03-13 20-14-56 cropped](https://user-images.githubusercontent.com/16113541/224949821-295ec19e-bbe1-4f82-bbc8-96b09da381c4.png)
Red put back:![Screenshot from 2023-03-13 23-55-49 cropped](https://user-images.githubusercontent.com/16113541/224949814-1759b670-ad3d-4064-aef5-b48b87d3ffdf.png)
When I added the per-device debug toggle I also made its color selection independent (default is to match the global). I didn't intend it to be this way, but it worked out really well as it allows things like:![Screenshot from 2023-03-14 01-42-14 cropped](https://user-images.githubusercontent.com/16113541/224949803-6249cdd1-50f7-4494-93f3-d285731918d5.png)
Anyway, I have this as a draft as it needs a *lot* more testing. I've only verified it works for basic functions.