From f67265249dfa45e5476c5fa39e56da9e18835c46 Mon Sep 17 00:00:00 2001 From: Michael Ingraham <34340210+meingraham@users.noreply.github.com> Date: Tue, 17 Sep 2019 09:44:26 -0400 Subject: [PATCH] Updated Script Cookbook (markdown) --- Script-Cookbook.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Script-Cookbook.md b/Script-Cookbook.md index 9349c44f..57ab1068 100644 --- a/Script-Cookbook.md +++ b/Script-Cookbook.md @@ -8,7 +8,7 @@ - [Multiple IR Receiver Synchronization](#Multiple-IR-Receiver-Synchronization) - [Fast Polling](#Fast-Polling) - [Switching and Dimming By Recognizing Mains Power Frequency](#Switching-and-Dimming-By-Recognizing-Mains-Power-Frequency) -- [WEB user io demo](#WEB-user-io-demo) +- [Web UI](#Web-UI) [Back To Top](#top) @@ -1080,12 +1080,10 @@ dim="FF55"+hn(tmp*dimmlp)+"05DC0A" ------------------------------------------------------------------------------ +#### Web UI +An example to show how to implement a web UI. This example controls a light via `WebSend` -#### WEB user io demo -example to show how to implement WEB user io -used to control a light device via websend - -\>D +>**>D** dimmer=0 sw=0 color="" @@ -1095,25 +1093,25 @@ green=0 blue=0 ww=0 -\>F +>**>F** color=hn(red)+hn(green)+hn(blue)+hn(ww) if color!=col1 then col1=color =>websend [192.168.178.75] color %color% endif - -if chg[dimmer]>0 +> +>if chg[dimmer]>0 then =>websend [192.168.178.75] dimmer %dimmer% endif - -if chg[sw]>0 +> +>if chg[sw]>0 then =>websend [192.168.178.75] power1 %sw% endif -\>W +>**>W** bu(sw "Light on" "Light off") ck(sw "Light on/off   ") sl(0 100 dimmer "0" "Dimmer" "100")