40 lines
1.2 KiB
HTML
40 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<!-- ATTENTION, la longueur des lignes DOIT être <128 ! -->
|
|
|
|
<html lang="fr" dir="ltr">
|
|
<head>
|
|
<meta charset='utf-8' name='viewport' content='width=device-width, initial-scale=1.0'>
|
|
<title>API SonOff</title>
|
|
</head>
|
|
<body>
|
|
<h1>API SonOff zf200118.1812</h1>
|
|
<a href="/">Home...</a><br><br>
|
|
<%
|
|
if _GET.LED == "on" then
|
|
gpio.write(zLED, gpio.LOW) gpio.mode(zLED, gpio.OUTPUT)
|
|
zout("LED=".._GET.LED.."<br>")
|
|
zout('<a href="api_sonoff.html?LED=off"> Off</a><br>')
|
|
|
|
end
|
|
if _GET.LED == "off" then
|
|
gpio.write(zLED, gpio.HIGH) gpio.mode(zLED, gpio.OUTPUT)
|
|
zout("LED=".._GET.LED.."<br>")
|
|
zout('<a href="api_sonoff.html?LED=on"> On</a>')
|
|
end
|
|
%>
|
|
<%
|
|
if _GET.RELAY == "on" then
|
|
gpio.mode(zRELAY, gpio.OUTPUT) gpio.write(zRELAY, gpio.HIGH)
|
|
zout("RELAY=".._GET.RELAY.."<br>")
|
|
zout('<a href="api_sonoff.html?RELAY=off"> Off</a><br>')
|
|
end
|
|
if _GET.RELAY == "off" then
|
|
gpio.mode(zRELAY, gpio.OUTPUT) gpio.write(zRELAY, gpio.LOW)
|
|
zout("RELAY=".._GET.RELAY.."<br>")
|
|
zout('<a href="api_sonoff.html?RELAY=on"> On</a>')
|
|
end
|
|
%>
|
|
</body>
|
|
</html>
|