Subversion Repositories HomeAutomation

Rev

Rev 1609 | Go to most recent revision | Blame | Last modification | View Log | SVN | RSS feed

  1.  
  2. var dimmer_module = GetModule("Dimmer230");
  3. var ir_module = GetModule("irReceive");
  4.  
  5. function test_press(event, id, channel, data, protocol)
  6. {
  7.     if (protocol == "NEC" && data == 3877174275)
  8.     {
  9.         Dimmer230_StartFade(2, 0, 135, "Increase");
  10.         Dimmer230_StartFade(1, 0, 135, "Increase");
  11.     }
  12.     else if (protocol == "NEC" && data == 3860462595)
  13.     {
  14.         Dimmer230_StartFade(2, 0, 135, "Decrease");
  15.         Dimmer230_StartFade(1, 0, 135, "Decrease");
  16.     }
  17. }
  18.  
  19. function test_release(event, id, channel, data, protocol)
  20. {
  21.     if (protocol == "NEC" && (data == 3877174275 || data == 3860462595))
  22.     {
  23.         Dimmer230_StopFade(2, 0);
  24.     }
  25. }
  26.  
  27. function test_status(event, id, available)
  28. {
  29.     //Log("status change!");
  30. }
  31.  
  32. ir_module.Bind("onStatusChange", test_status);
  33. ir_module.Bind("onPressed", test_press);
  34. ir_module.Bind("onReleased", test_release);
  35.  
  36.  
  37.  
  38.