This won't get you all the way there, but it will give you a keypad that can can act based on correct/incorrect entries. I don't believe that there is a way to force a overlaying control page from the server's side... at any rate, here's this if you can use it...
Create three variables: Keypad, Keypress, Password
Put the numerical password you want to try in the variable 'Password'
Create a control panel with buttons labeled 0-9, plus a 'Clear' and 'Enter' button. Each button should change the variable 'Keypress' to it's labeled value. 'Clear' and 'Enter' buttons change the 'Keypress' variable to 'C' and 'E' respectively.
Add a "Display Variable" control to the top of the control page above the numbers and set it to display the value of the 'Keypad' variable. Here's an example:
- Screen Shot 2012-02-14 at 7.37.46 PM.png (72.41 KiB) Viewed 2112 times
Create a trigger that will fire on the 'Keypress' variable change.. Add the following python code to the Actions tab:
- Code: Select all
import time
keyPressVar = indigo.variables[298613556]
keyPadVar = indigo.variables[1364787289]
keyPadPass = indigo.variables[1966950299]
if keyPressVar.value == "C":
indigo.variable.updateValue(keyPadVar, '')
elif keyPressVar.value =="E":
if keyPadVar.value == keyPadPass.value:
indigo.variable.updateValue(keyPadVar, 'Accepted')
time.sleep(2)
indigo.variable.updateValue(keyPadVar, '')
elif keyPadVar.value != keyPadPass.value:
indigo.variable.updateValue(keyPadVar, 'Denied !!')
time.sleep(2)
indigo.variable.updateValue(keyPadVar, '')
else:
keyPadVar.value += keyPressVar.value
indigo.variable.updateValue(keyPadVar, keyPadVar.value)
That should be it, the code is pretty easy to follow, just add what you want to happen in the "Accepted" 'if' clause.
The code isn't optimized, but it gives you a direction - I hacked it out while watching 'The Walking Dead' on AMC so it's far from high quality, but it works...
Hope this helps,
Terry