Allow re-scan of devices to support hot-plugging#99
Allow re-scan of devices to support hot-plugging#99j3kestrel wants to merge 1 commit intozeth:masterfrom
Conversation
The use of a bare generator in `EVENT_MAP['type_codes']` makes `EVENT_MAP` a single use object. Converting the generator to a tuple allows reuse of `EVENT_MAP` and constructing a new `DeviceManager` that re-scans for devices.
|
I now see that pull request #81 fixes the same problem, but doesn't add a function to re-scan devices. |
|
Thanks. I just need to find a day to test with the 100 devices. |
|
This should also fix #106. Attempting to create a new |
|
This fix works only when >>> import inputs
>>> from inputs import devices
>>>
>>> inputs.devices == devices
True
>>> inputs.rescan_devices()
>>>
>>> inputs.devices == devices
False
>>> |
|
I suspect that is because Or, perhaps Is there a better solution other than updating examples and documentation? |
The use of a bare generator in
EVENT_MAP['type_codes']makesEVENT_MAPa single use object. Converting the generator to a tuple allows reuse ofEVENT_MAPand constructing a newDeviceManagerthat re-scans for devices.Addresses issue #66