From a0f54fd1abc723c6b6039d237428483f70ec6fc3 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Wed, 5 Jan 2022 13:10:16 +0000 Subject: [PATCH] bindings: python: Add iio.Device.hwmon property This readonly property will be True if the device is a hardware monitoring device, False if it is a IIO device. Signed-off-by: Paul Cercueil --- bindings/python/iio.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bindings/python/iio.py b/bindings/python/iio.py index 5b03cf976..df27e399a 100644 --- a/bindings/python/iio.py +++ b/bindings/python/iio.py @@ -1325,6 +1325,10 @@ def _get_trigger(self): None, "Contains the configured trigger for this IIO device.\n\ttype=iio.Trigger", ) + hwmon = property( + lambda self: self._id[:5] == "hwmon", None, None, + "Contains True if the device is a hardware-monitoring device, False if it is a IIO device.\n\ttype=bool", + ) @property def context(self):