itchcraft.device
Base class for devices
Attributes
Classes
Device metadata for a supported bite healer connected to the |
|
Device metadata for an unsupported bite healer connected to the |
Functions
|
Creates a metadata object from a USB device. |
Module Contents
- class itchcraft.device.SupportedBiteHealerMetadata
Device metadata for a supported bite healer connected to the host but not necessarily activated. Clients can query information from the bite healer and open a connection.
- usb_product_name: str | None
Product name of the backing USB device.
- serial_number: str | None
Serial number of the backing USB device.
- connection_supplier: collections.abc.Callable[[], contextlib.AbstractContextManager[BiteHealer]]
Callable that connects to the bite healer.
- support_statement: SupportStatement
Details about the support status for this bite healer.
- connect()
Connects to the device.
- Return type:
contextlib.AbstractContextManager[BiteHealer]
- property vendor_name: str
Canonical vendor name from Itchcraft’s point of view.
- Return type:
str
- property product_name: str
Canonical product name from Itchcraft’s point of view.
- Return type:
str
- property supported: bool
Whether Itchcraft supports this device.
- Return type:
bool
- class itchcraft.device.UnsupportedBiteHealerMetadata
Device metadata for an unsupported bite healer connected to the host. Clients can query information from the bite healer.
- usb_product_name: str | None
Product name of the backing USB device.
- serial_number: str | None
Serial number of the backing USB device.
- support_statement: SupportStatement
Details about the support status for this bite healer.
- property vendor_name: str
Canonical vendor name from Itchcraft’s point of view.
- Return type:
str
- property product_name: str
Canonical product name from Itchcraft’s point of view.
- Return type:
str
- property supported: bool
Whether Itchcraft supports this device.
- Return type:
bool
- itchcraft.device.BiteHealerMetadata
- itchcraft.device.from_usb_device(usb_device, support_statement)
Creates a metadata object from a USB device.
- Parameters:
usb_device (usb.core.Device) – the PyUSB device to be queried for metadata.
support_statement (SupportStatement) – Describes the level of support that Itchcraft offers for usb_device.
- Returns:
a metadata object that unifies info from both the PyUSB device and support_statement.
- Return type:
BiteHealerMetadata