mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-12-08 20:39:01 +00:00
Docs clean up part 1
Big push on getting the docs cleaned up before 1.0. Proper wrapping of everything so it's decently viewable from the command line (or as decently viewable as markdown can be - the tables will never look great from the command line). Only one code change in this PR: rename bouncetime to bounce_time (everything else is PEP-8, so this probably should be too) and change its units to seconds from milliseconds (again, all other durations in the library are in seconds, so it feels inconsistent that this one isn't; for the sake of those who won't read the docs - which is most people - I figure consistency helps with guessing!).
This commit is contained in:
@@ -14,7 +14,11 @@ class OutputDeviceError(GPIODeviceError):
|
||||
|
||||
class OutputDevice(GPIODevice):
|
||||
"""
|
||||
Generic GPIO Output Device (on/off).
|
||||
Represents a generic GPIO output device.
|
||||
|
||||
This class extends `GPIODevice` to add facilities common to GPIO output
|
||||
devices: an `on` method to switch the device on, and a corresponding `off`
|
||||
method.
|
||||
"""
|
||||
def __init__(self, pin=None):
|
||||
super(OutputDevice, self).__init__(pin)
|
||||
@@ -46,7 +50,12 @@ class OutputDevice(GPIODevice):
|
||||
|
||||
class DigitalOutputDevice(OutputDevice):
|
||||
"""
|
||||
Generic Digital GPIO Output Device (on/off/toggle/blink).
|
||||
Represents a generic output device with typical on/off behaviour.
|
||||
|
||||
This class extends `OutputDevice` with a `toggle` method to switch the
|
||||
device between its on and off states, and a `blink` method which uses an
|
||||
optional background thread to handle toggling the device state without
|
||||
further interaction.
|
||||
"""
|
||||
def __init__(self, pin=None):
|
||||
super(DigitalOutputDevice, self).__init__(pin)
|
||||
@@ -125,6 +134,10 @@ class DigitalOutputDevice(OutputDevice):
|
||||
class LED(DigitalOutputDevice):
|
||||
"""
|
||||
An LED (Light Emmitting Diode) component.
|
||||
|
||||
A typical configuration of such a device is to connect a GPIO pin to the
|
||||
anode (long leg) of the LED, and the cathode (short leg) to ground, with
|
||||
an optional resistor to prevent the LED from burning out.
|
||||
"""
|
||||
pass
|
||||
|
||||
@@ -132,6 +145,9 @@ class LED(DigitalOutputDevice):
|
||||
class Buzzer(DigitalOutputDevice):
|
||||
"""
|
||||
A digital Buzzer component.
|
||||
|
||||
A typical configuration of such a device is to connect a GPIO pin to the
|
||||
anode (long leg) of the buzzer, and the cathode (short leg) to ground.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user