Device

Device

new Device()

Source:
Represents a single device of any type; GPIO-based, SPI-based, I2C-based, etc. This is the base class of the device hierarchy. It defines the basic services applicable to all devices (specifically the is_active property, the value property, and the close method).

Methods

(abstract) close()

Source:

is_active()

Source:
Returns `true` if the device is currently active and `false` otherwise. This property is usually derived from `value` attribute. Unlike `value` attribute, this is *always* a boolean.

value()

Source:
Returns a value representing the device's state. Frequently, this is a boolean value, or a number between 0 and 1 but some devices use larger ranges (e.g. -1 to +1) and composite devices usually use tuples to return the states of all their subordinate components.