Replace NamedTuples with more flexible dataclass, which also support type hints. Introduce enums to replace constant strings, which need to be kept in sync. Also enhances interfaces by limiting it to the enum values. Remove unused variables.
19 lines
298 B
Python
19 lines
298 B
Python
import dataclasses
|
|
|
|
|
|
@dataclasses.dataclass
|
|
class DeviceInfo:
|
|
path: str
|
|
bus_id: str
|
|
vendor_id: str
|
|
product_id: str
|
|
interface: str
|
|
driver: str
|
|
manufacturer: str
|
|
product: str
|
|
serial: str
|
|
release: str
|
|
isDevice: bool
|
|
hidpp_short: str
|
|
hidpp_long: str
|