You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
349 B

P_RLY = 1;
P_FM = 5;
M = MQTT_TOPIC_PREFIX;
MQTT_KEEP_ALIVE = 10;
dofile('utils.lua');
dofile('rly.lua');
dofile('fm.lua');
R = RLY(P_RLY, function(c)
REG(M..'snsr/valve', c);
end, 1);
FM(P_FM, function(v)
REG(M..'snsr/flowmeter', v);
end);
RECV = function(m, topic, data)
if topic == M..'ctl/valve' then
R(data);
end
end