Initial commit

This commit is contained in:
Thomas Klaehn
2021-04-19 07:57:29 +02:00
commit d30a15567b
13 changed files with 305 additions and 0 deletions

22
heat/_Heat.py Normal file
View File

@@ -0,0 +1,22 @@
import RPi.GPIO as GPIO
class Heat():
def __init__(self, pin):
self.__pin = pin
self.__state = False
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.OUT)
if GPIO.input(pin):
self.__state = True
def on(self):
self.__state = True
GPIO.output(self.__pin, 1)
def off(self):
self.__state = False
GPIO.output(self.__pin, 0)
def state(self):
return self.__state

1
heat/__init__.py Normal file
View File

@@ -0,0 +1 @@
from ._Heat import Heat