elseif in rules

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ewaldharmsen
Normal user
Posts: 66
Joined: 16 Feb 2017, 09:23

elseif in rules

#1 Post by ewaldharmsen » 11 Oct 2018, 19:30

Rules is better than ever as it now supports and/or.

But does it also support else if statements? Or any plans to support it?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: elseif in rules

#2 Post by grovkillen » 11 Oct 2018, 21:20

It does support else
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

ewaldharmsen
Normal user
Posts: 66
Joined: 16 Feb 2017, 09:23

Re: elseif in rules

#3 Post by ewaldharmsen » 12 Oct 2018, 10:08

I want to have this:

Code: Select all

if X and Y
   do somethingv1
elseif X
   do something 2
else
   do something 3
endif

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: elseif in rules

#4 Post by grovkillen » 12 Oct 2018, 10:22

I understand now :)

Please open a feature request on GitHub.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

ewaldharmsen
Normal user
Posts: 66
Joined: 16 Feb 2017, 09:23

Re: elseif in rules

#5 Post by ewaldharmsen » 19 Oct 2018, 09:44

I found a solution you can do it like this:

Code: Select all

On Rules#Timer=4 do
   if [Dummy#LongLight]=1 and [LED#State]=0 
      gpio,13,1
   endif
   if [Dummy#LongLight]=1 and [LED#State]=1
      gpio,13,0
   endif
   if [Dummy#LongLight]=1
      timerSet,4,1
   endif
Endon

Post Reply

Who is online

Users browsing this forum: No registered users and 42 guests