.. currentmodule:: gpiozero
The GPIO Zero class hierarchy is quite extensive. It contains several base classes (most of which are documented in their corresponding chapters):
- :class:`Device` is the root of the hierarchy, implementing base functionality like :meth:`~Device.close` and context manager handlers.
- :class:`GPIODevice` represents individual devices that attach to a single GPIO pin
- :class:`SPIDevice` represents devices that communicate over an SPI interface (implemented as four GPIO pins)
- :class:`InternalDevice` represents devices that are entirely internal to the Pi (usually operating system related services)
- :class:`CompositeDevice` represents devices composed of multiple other devices like HATs
There are also several mixin classes for adding important functionality at numerous points in the hierarchy, which is illustrated below:
.. autoclass:: Device :members: close, closed, value, is_active
.. autoclass:: ValuesMixin(...) :members:
.. autoclass:: SourceMixin(...) :members:
.. autoclass:: SharedMixin(...) :members: _shared_key
.. autoclass:: EventsMixin(...) :members:
.. autoclass:: HoldMixin(...) :members: