Function key: Relais

Example: Relais

Relais.xml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <configuration patchDefault="true">
  3. <templates version="1.3.5">
  4. <template prio="10" name="Relais Schalten">
  5. <keyConfiguration>
  6. <lua>
  7. <code>
  8. local valid = false
  9. local active = false
  10. local on = "##8*26"
  11.  
  12. local function updateLed()
  13. if valid then
  14. if active then
  15. key:setLed( "green", true )
  16. time.sleep("2")
  17. key:setLed( "off")
  18. end
  19. else
  20. key:setLed( "red", true )
  21. end
  22. end
  23.  
  24. local function check_valid()
  25. if identity == "" or relid == "" then
  26. valid = false
  27. else
  28. valid = true
  29. end
  30. end
  31.  
  32. function onKeyUp()
  33. if valid then
  34. sip.invite(on..relid.."#",false,identity,true)
  35. active = true
  36. updateLed()
  37. end
  38. end
  39. check_valid()
  40. updateLed()
  41. </code>
  42. <params>
  43. <param name="identity"/>
  44. <param name="relid"/>
  45. </params>
  46. </lua>
  47. </keyConfiguration>
  48. <parameters>
  49. <parameter name="@string/identity">
  50. <path>//param[@name="identity"]/value</path>
  51. </parameter>
  52. <parameter name="Relais Id">
  53. <path>//param[@name="relid"]/value</path>
  54. </parameter>
  55. </parameters>
  56. </template>
  57. </templates>
  58. </configuration>