diff --git a/src/legacy.py b/src/legacy.py index e504201..0e7b7b2 100644 --- a/src/legacy.py +++ b/src/legacy.py @@ -21,18 +21,20 @@ INNER_TIMES = 16 # how many times to send messages in the API slow loop -# this is slower than using the driver, and will introduce +# this is slower than using the driver, and will introduce tiny # inter-burst delays OUTER_TIMES = 1 # delay in seconds between each application switch message APP_DELAY = 1 + #----- TEST APPLICATION ------------------------------------------------------- # Prebuild all possible message up front, to make switching code faster -HOUSE_ADDRESS = 0xA0170 +HOUSE_ADDRESS = None # Use default energenie quasi-random address 0x6C6C6 +#HOUSE_ADDRESS = 0xA0170 # Captured address of David's RF hand controller ALL_ON = encoder.build_switch_msg(True, house_address=HOUSE_ADDRESS) ONE_ON = encoder.build_switch_msg(True, device_address=1, house_address=HOUSE_ADDRESS) @@ -103,7 +105,8 @@ print("switch %d OFF" % switch_no) radio.transmit(OFF_MSGS[switch_no], OUTER_TIMES, INNER_TIMES) time.sleep(APP_DELAY) - + + def switch1_loop(): """Repeatedly turn switch 1 ON then OFF""" while True: @@ -112,7 +115,7 @@ time.sleep(APP_DELAY) print("Switch 1 OFF") - radio.transmit(OFF_MSGS[1], OUTER_TIMES, INNER_TIMES) + radio.transmit(OFF_MSGS[1], OUTER_TIMES, INNER_TIMES) time.sleep(APP_DELAY) diff --git a/test/TESTS.txt b/test/TESTS.txt index efbdf28..fbf0491 100644 --- a/test/TESTS.txt +++ b/test/TESTS.txt @@ -1,17 +1,56 @@ Manual tests to perform on release: +0. prepare for testing + +git clone https://github.com/whaleygeek/pyenergenie +cd pyenergenie + + 1. build radio driver on Raspberry Pi cd energenie/drv ./build_rpi +(If you think the code has changed and want to refresh the cached binary) +git add radio_rpi.so + + 2. legacy.py runs on Raspberry Pi cd src sudo python legacy.py -(learn some switches) -(make sure the switches turn on and off when commanded) +("do you want to learn any switches?" Y) +("Learn switch 1?" Y) +("Press the LEARN button on any switch 1 for 5 secs until LED flashes") +("press ENTER when LED is flashing") + (hold green button for 10 seconds for fast flash to clear pairing memory) + (press ENTER) +("ON") +("Device should now be programmed") +("Testing....") +("OFF") +("ON") +("OFF") +("ON") +("OFF") +("ON") + (say no to learn other switches) +("switch 0 ON") + (turns on due to 'all switches on') +("switch 0 OFF") + (turns off due to 'all switches off') +("switch 1 ON") + (turns on) +("switch 1 OFF") + (turns off) +("switch 2 ON") +("switch 2 OFF") +("switch 3 ON") +("switch 3 OFF") +("switch 4 ON") +("switch 4 OFF") + 3. monitor.py @@ -22,6 +61,7 @@ (plug in a MiHome house monitor, make sure reports come back) (plug in a MiHome eTRV, make sure reports come back) + 4. switch.py cd src