1
0
Fork 0

button state constants

This commit is contained in:
Kevin Matz 2018-10-22 17:18:46 -04:00
parent 63f554f149
commit 3eab5b9626
1 changed files with 6 additions and 2 deletions

View File

@ -22,15 +22,19 @@ from time import sleep
logger = logging.getLogger("CommentMacro")
# button state constants
buttonDOWN = 1
buttonUP = 0
class HogDevice():
def __init__(self, servers):
self.servers = servers
def button_press(self, device, path, delay=0.05):
self.send_message(device, path, 1) # button down
self.send_message(device, path, buttonDOWN) # button down
sleep(delay)
self.send_message(device, path, 0) # button up
self.send_message(device, path, buttonUP) # button up
# utility function to send simple messages with one argument
def send_message(self, device, path, arg):