Commit Graph

2 Commits

Author SHA1 Message Date
MasterofJOKers 0c2dd51ac1 udev-device-plug-handler: Support more than bind
There can be cases where we want to support more than "bind" events -
e.g. "remove". Therefore, we rewrite how things work in the spirit of
the STLs `SimpleHTTPRequestHandler`: any "handle_{action}" method of a
`KnownDevice` subclass allows the class to receive events for that
action.

To not use `getattr()` on every `KnownDevice` on every event, we use
`__init_subclass__()` to build a list of `KnownDevice` registered for
each `action`.
2024-02-03 13:55:52 +01:00
MasterofJOKers 2f9f69ec77 Add udev-device-plug-handler
This command runs in the background and listens for udev bind events,
comparing the attributes of those events to known implemented devices.
If any match, we call their handle() method. The same handle() method is
called on startup if the presence of the device is detected via the
check_available() method.

Currently implemented devices are my Logitech G930 headset and my TEX
Shinobi keyboard.
2022-09-06 20:47:01 +02:00