1 # SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
3 # SPDX-License-Identifier: MIT
4 """A Pin class for use with libgpiod."""
9 "libgpiod Python bindings not found, please install and try again! See "
10 "https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/main/libgpiod.py"
13 # Versions 1.5.4 and earlier have no __version__ attribute
14 if hasattr(gpiod, "__version__"):
15 version = gpiod.__version__
19 if version.startswith("1."):
20 from .libgpiod.libgpiod_pin_1_x import Pin # pylint: disable=unused-import
22 from .libgpiod.libgpiod_pin_2_x import Pin # pylint: disable=unused-import