adjusted for mains switch

This commit is contained in:
Wolfgang Hottgenroth 2015-09-13 22:05:36 +02:00
parent b688303694
commit 02669c0bb5

View File

@ -4,9 +4,9 @@ BRUSER = ""
BRPWD = ""
CLIENTID = "ESP8266-" .. node.chipid()
SWITCH_PIN = 0
SWITCH_PIN = 3
SWITCH_ID = 0
SWITCH_ID = 1
topics = {"IoT/Watchdog", "IoT/Switch" .. SWITCH_ID}
TOPIC_WATCHDOG = 1
@ -90,9 +90,9 @@ function run_main_prog()
if (switch_state ~= old_switch_state) then
old_switch_state = switch_state
if (switch_state) then
gpio.write(SWITCH_PIN, gpio.HIGH)
else
gpio.write(SWITCH_PIN, gpio.LOW)
else
gpio.write(SWITCH_PIN, gpio.HIGH)
end
end
end