diff --git a/library/explorerhat/pins.py b/library/explorerhat/pins.py index 29bd13c..1a049be 100644 --- a/library/explorerhat/pins.py +++ b/library/explorerhat/pins.py @@ -11,13 +11,19 @@ def __init__(self): self.stop_event = threading.Event() self.daemon = True + def alive(self): + try: + return self.isAlive() + except AttributeError: + return self.is_alive() + def start(self): - if not self.isAlive(): + if not self.alive(): self.stop_event.clear() threading.Thread.start(self) def stop(self): - if self.isAlive(): + if self.alive(): self.stop_event.set() self.join() diff --git a/library/setup.py b/library/setup.py index dc8d1a5..9f81ac7 100755 --- a/library/setup.py +++ b/library/setup.py @@ -50,5 +50,5 @@ url = 'http://shop.pimoroni.com', classifiers = classifiers, packages = ['explorerhat'], - install_requires= ['cap1xxx'] + install_requires= ['cap1xxx>=0.1.4'] )