Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.72 KB | None | 0 0
  1. /*
  2. {
  3.     desc:"Огонь",
  4.     tag:"item",
  5.     vars:[         
  6.         {name:"I0",type:"devices-list",required:true,width:600,filter:["rgb-lamp"],desc:"RGB",descWidth:100},
  7.     ]
  8. }
  9. */
  10.  
  11. u8 V=0;
  12. u8 B=0;
  13. u8 H=0;
  14.  
  15. void replay()
  16. {
  17. setStatus(183:30, 0);
  18. setStatus(183:30, {1, 100, 1, "http://192.168.1.125/MEDIA/FIRE.mp3"});
  19. }
  20.  
  21. void blink()
  22. {
  23. if (V==245) V=250; else V=245;
  24. B=rand()%10+240;
  25. H=rand()%10+15;
  26.  
  27. setStatus(I0, {1,V,B,H,0});
  28. }
  29.  
  30.  
  31. V-ID/V-ADDR
  32. {
  33. if([V-ADDR.0]==1) {delayedCallMsR(blink,75); setStatus(183:30, {1, 100, 1, "http://192.168.1.125/MEDIA/FIRE.mp3"}); delayedCallR(replay,90); setStatus(573:249, 0);}
  34. if([V-ADDR.0]==0) {cancelDelayedCall(blink); cancelDelayedCall(replay); setStatus(I0,0); setStatus(183:30, 0);}
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement