button state constants
This commit is contained in:
parent
63f554f149
commit
3eab5b9626
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue