+
     viU  c                   s8    R t  ! R R4      t ! R R4      tR tR# )zlBase bus and driver API.

Copyright Jonas Malaco and contributors
SPDX-License-Identifier: GPL-3.0-or-later
c                   s   a  ] tR t^
t o Rt]R 4       tR tR tR t	R t
R tR tR	 tR
 t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       tR tR tRtV tR# )
BaseDrivera  Base driver API.

All drivers are expected to implement this API for compatibility with the
liquidctl CLI or other thirdy party tools.

Drivers will automatically implement the context manager protocol, but this
should only be used from a call to `connect`.

Example:

    for dev in <Driver>.find_supported_devices():
        with dev.connect():
            print(dev.get_status())
            if dev.serial_number == '49385027ZP':
                dev.set_fixed_speed('fan3', 42)

c                    \        4       h)zPFind and bind to compatible devices.

Returns a list of bound driver instances.
ZNotImplementedError)clskwargs   &,:/usr/lib/python3.14/site-packages/liquidctl/driver/base.pyfind_supported_devicesZ!BaseDriver.find_supported_devices        "##    c                r   )zConnect to the device.

Returns `self`.

## Notes for driver authors

Procedure before any read or write operation can be performed.
Typically a handshake between driver and device.
r   selfr   r   r   connectZBaseDriver.connect&   s     "##r	   c                r   )a~  Initialize the device and the driver.

This method should be called every time the systems boots, resumes from
a suspended state, or if the device has just been (re)connected.  In
those scenarios, no other method, except `connect()` or `disconnect()`,
should be called until the device and driver has been (re-)initialized.

Returns None or a list of `(property, value, unit)` tuples, similarly
to `get_status()`.

## Notes for driver authors

Apart from `connect()`, some devices might require a one-time
initialization procedure after powering on, or to detect hardware
changes.  This should be called *after* connecting to the device.
r   r
   r   r   
initializeZBaseDriver.initialize3   s    $ "##r	   c                r   )zDisconnect from the device.

## Notes for driver authors

Procedure before the driver can safely unbind from the device.
Typically just cleanup.
r   r
   r   r   
disconnectZBaseDriver.disconnectG   s     "##r	   c                r   )zJGet a status report.

Returns a list of `(property, value, unit)` tuples.
r   r
   r   r   
get_statusZBaseDriver.get_statusR        "##r	   c                r   )z*Set the color mode for a specific channel.r   )r   channelmodeZcolorsr      &&&&,r   	set_colorZBaseDriver.set_colorZ        "##r	   c                r   )z,Set the screen mode and content.

Unstable.
r   )r   r   r   Zvaluer   r   r   
set_screenZBaseDriver.set_screen_   r   r	   c                r   )z+Set channel to follow a speed duty profile.r   )r   r   Zprofiler      &&&,r   set_speed_profileZBaseDriver.set_speed_profileg   r   r	   c                r   )z"Set channel to a fixed speed duty.r   )r   r   Zdutyr   r   r   set_fixed_speedZBaseDriver.set_fixed_speedl   r   r	   c                r   )z7Human readable description of the corresponding device.r   r      &r   descriptionZBaseDriver.descriptionq        "##r	   c                r   )z*Numeric vendor identifier, or None if N/A.r   r   r   r   	vendor_idZBaseDriver.vendor_idw   r   r	   c                r   )z+Numeric product identifier, or None if N/A.r   r   r   r   
product_idZBaseDriver.product_id}   r   r	   c                r   )zMDevice versioning number, or None if N/A.

In USB devices this is bcdDevice.
r   r   r   r   release_numberZBaseDriver.release_number   r   r	   c                r   )z5Serial number reported by the device, or None if N/A.r   r   r   r   serial_numberZBaseDriver.serial_number   r   r	   c                r   )z/Bus the device is connected to, or None if N/A.r   r   r   r   busZBaseDriver.bus   r   r	   c                r   )zvAddress of the device on the corresponding bus, or None if N/A.

This typically depends on the bus enumeration order.
r   r   r   r   addressZBaseDriver.address   r   r	   c                r   )a@  Physical location of the device, or None if N/A.

This typically refers to a USB port, which is *not* dependent on bus
enumeration order.  However, a USB port is hub-specific, and hubs can
be chained.  Thus, for USB devices, this returns a tuple of port
numbers, from the root hub to the parent of the connected device.
r   r   r   r   portZBaseDriver.port   s     "##r	   c                s    V # N r   r   r   	__enter__ZBaseDriver.__enter__   s    r	   c                s&    V P                  4        R # r%   )r   )r   Zargss   &*r   __exit__ZBaseDriver.__exit__   s    r	   r&   N)__name__
__module____qualname____firstlineno____doc__Zclassmethodr   r   r   r   r   r   r   r   r   Zpropertyr   r   r   r    r!   r"   r#   r$   r'   r(   __static_attributes____classdictcell__Z__classdict__   @r   r    r    
   s     $ $ $$$(	$$$
$$
$
 $ $
 $ $
 $ $
 $ $ $ $
 $ $
 $ $ 	$ 	$ r	   r    c                   s*   a  ] tR t^t o RtR tRtV tR# )BaseBuszBase bus API.c                s    R# )zAFind compatible devices and yield corresponding driver instances.Nr&   r
   r   r   find_devicesZBaseBus.find_devices   s    r	   r&   N)r)   r*   r+   r,   r-   r3   r.   r/   r0   r1   r   r2   r2      s      r	   r2   c           	     s    \        V P                  4       4      pTP                  V P                  4        UUu. uF  p\        V4       F  q3NK  	  K  	  upp4      # u uppi )zTRecursively find loaded subclasses of `cls`.

Returns a set of subclasses of `cls`.
)ZsetZ__subclasses__Zunionfind_all_subclasses)r   ZsubZcZss   &   r   r4   r4      sS    
 c  "
#C99!3!3!5V!5A?RST?U!a?Ua!5VWWVs   A
N)r-   r    r2   r4   r&   r	   r   <module>r5      s'   g gT Xr	   