Skip to content

Commit

Permalink
bindings: python: Add iio.Device.hwmon property
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pcercuei committed Jan 11, 2022
1 parent 626e910 commit a0f54fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bindings/python/iio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit a0f54fd

Please sign in to comment.