Closed Hedda closed 3 years ago
I had autodetection implemented in the past but it was not useful. This is currently done by the ControllerApplication.probe
classmethod, which returns True
or False
when passed a radio configuration with a serial port. It is used by ZHA to autodetect the radio library when you select a serial port in the dropdown.
For reference, here is the old implementation: https://github.com/zigpy/zigpy-znp/commit/61f8ea7933852b134bbae4d6659261bc5448b2a1
The ZZH using a generic CH340 chip makes it indistinguishable from every other cheap Arduino or dev kit. I think it's up to the upstream application using a radio library to figure out autodetection if it wants to go that route instead of presenting a dropdown of serial ports with model and manufacturer info, which seems pretty user-friendly in my opinion.
Would it be practical for zigpy-znp to have a probe method that scan all available serial ports in order to auto-detect port-path?
puddly posted in https://github.com/zigpy/zigpy-znp/issues/28 slaesh provided information autodetecting at least his adapters:
slaesh adapter does however not use the same type of USB-to-serial converter chip as others such as example Electrorama's ZZH.
Perhaps that belongs in either the ZHA integration application level, discovery and/or Home Assistant Supervisor level instead?
HA already has several different methods to discover network services but no probes to discover Serial and/or USB adapters?
https://www.home-assistant.io/integrations/discovery/
https://developers.home-assistant.io/docs/supervisor/
https://www.home-assistant.io/integrations/zha/
PS: It would also be very good to be able to probe and discover if an adapter is already "in use" by any other application or not.