Skip to content

Commit 50e40a3

Browse files
author
Brian Hines
committed
Release
1 parent 4956807 commit 50e40a3

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ v0.0.10, 2015-01-05 -- Add get_config for all pins.
99
v0.0.11, 2015-01-05 -- Update project page URL.
1010
v0.0.12, 2015-01-07 -- Update RPi.GPIO to 0.5.9.
1111
v1.0.0, 2015-02-19 -- Events handler gets passed instance of GPIO for use in callbacks.
12+
v1.1.0, 2015-03-02 -- Add a variety of helpful classes.

pi_pin_manager/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from pins import (
22
PinManager,
3+
GPIOHelper,
34
SinglePinWatcher,
45
MultiplePinWatcher,
56
PinConfigurationError,

pi_pin_manager/pins.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ def start(self):
8989
self.cleanup()
9090

9191

92+
class GPIOHelper(GPIOConfig, GPIOActions):
93+
"""This is a helper class that will configure GPIO from a file or dictionary.
94+
After that you have direct access to the RPi.GPIO module using the 'gpio'
95+
property. The rest is up to you."""
96+
97+
def __init__(self, config):
98+
super(GPIOHelper, self).__init__(config=config)
99+
self._initialize_gpio()
100+
self._initialize_pins()
101+
self.gpio = self._gpio
102+
103+
def _initialize_pins(self):
104+
for pin_num, pin_options in self._pin_config.items():
105+
self._setup_pin(pin_num, pin_options)
106+
107+
92108
class PinManager(object):
93109

94110
def __init__(self, config_file=None, config_dict=None, event_handlers=None):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='Pi-Pin-Manager',
5-
version='1.0.0',
5+
version='1.1.0',
66
author='Brian Hines',
77
author_email='brian@projectweekend.net',
88
packages=['pi_pin_manager'],

0 commit comments

Comments
 (0)