on any go_to_percent command, it just toggles the garage switch

master
nathan wagner 3 years ago
parent d2639e1b8b
commit a9fe50a171

@ -1,3 +1,5 @@
import time
import com import com
import xbee import xbee
from machine import Pin from machine import Pin
@ -23,7 +25,10 @@ class Barrier:
def command(self, seq, payload): def command(self, seq, payload):
pass self.ad4.value(1)
time.sleep_ms(600)
self.ad4.value(0)
#should probably respond if there's a request for it
def watch(self): def watch(self):
current_door = self.door current_door = self.door

@ -73,14 +73,8 @@ while 1 != 0:
#print(payload) #print(payload)
com.fancy_transmit(payload=payload, source_ep=packet['dest_ep'], dest_ep=packet['source_ep'], com.fancy_transmit(payload=payload, source_ep=packet['dest_ep'], dest_ep=packet['source_ep'],
cluster=packet['cluster'], profile=packet['profile']) cluster=packet['cluster'], profile=packet['profile'])
if command_name == "on": if command_name == "go_to_percent":
ad4.value(1) garage.command(seq,payload)
if command_name == "off":
ad4.value(0)
if command_name == "toggle":
ad4.value(1)
time.sleep(1)
ad4.value(0)
if packet['cluster']==5: #active endpoint request if packet['cluster']==5: #active endpoint request
print(bytes(packet['payload'])) print(bytes(packet['payload']))
b = bytearray(packet['payload']) b = bytearray(packet['payload'])

Loading…
Cancel
Save