Merge pull request #13 from avollkopf/master

Change Inverted logic for GPIO Actor
This commit is contained in:
Manuel83 2021-02-07 13:07:27 +01:00 committed by GitHub
commit 143db84c32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
100 changed files with 3 additions and 5 deletions

View file

@ -20,17 +20,17 @@ except Exception:
import RPi.GPIO as GPIO import RPi.GPIO as GPIO
@parameters([Property.Select(label="GPIO", options=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]), Property.Select(label="Inverted", options=["Yes", "No"])]) @parameters([Property.Select(label="GPIO", options=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]), Property.Select(label="Inverted", options=["Yes", "No"],description="No: Active on high; Yes: Active on low")])
class GPIOActor(CBPiActor): class GPIOActor(CBPiActor):
def get_GPIO_state(self, state): def get_GPIO_state(self, state):
# ON # ON
if state == 1: if state == 1:
return 0 if self.inverted == False else 1 return 1 if self.inverted == False else 0
# OFF # OFF
if state == 0: if state == 0:
return 1 if self.inverted == False else 0 return 0 if self.inverted == False else 1
async def start(self): async def start(self):
await super().start() await super().start()

0
venv/bin/autopep8 Executable file → Normal file
View file

0
venv/bin/chardetect Executable file → Normal file
View file

0
venv/bin/easy_install Executable file → Normal file
View file

0
venv/bin/easy_install-3.8 Executable file → Normal file
View file

0
venv/bin/epylint Executable file → Normal file
View file

0
venv/bin/f2py Executable file → Normal file
View file

0
venv/bin/f2py3 Executable file → Normal file
View file

0
venv/bin/f2py3.8 Executable file → Normal file
View file

0
venv/bin/isort Executable file → Normal file
View file

0
venv/bin/isort-identify-imports Executable file → Normal file
View file

0
venv/bin/pip Executable file → Normal file
View file

0
venv/bin/pip3 Executable file → Normal file
View file

0
venv/bin/pip3.8 Executable file → Normal file
View file

0
venv/bin/pycodestyle Executable file → Normal file
View file

0
venv/bin/pyfiglet Executable file → Normal file
View file

0
venv/bin/pylint Executable file → Normal file
View file

0
venv/bin/pyreverse Executable file → Normal file
View file

View file

@ -1 +0,0 @@
python3

View file

@ -1 +0,0 @@
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3

0
venv/bin/symilar Executable file → Normal file
View file

View file

View file

View file

Before

Width:  |  Height:  |  Size: 445 B

After

Width:  |  Height:  |  Size: 445 B

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View file

View file

View file

View file

View file

View file

View file

View file