adey / bangali

bangali's random code stuff for smartthings
GNU General Public License v3.0
46 stars 52 forks source link

Feature request: matching ranges and lists #55

Open spokrandt opened 5 years ago

spokrandt commented 5 years ago

As a hubitat user I would like to be able to match ranges of numbers and lists of numbers. For example the attribute from apixu for condition_code has different codes. I'd like to match the ones like snow, hail, thunder storms etc.. to automagically close my awing so it does not get damaged. I can do this with multiple rules. BUT, it would sure be nice to get it into one rule.

spokrandt commented 5 years ago

I didn't realize your repo had many projects.. this would be a request for WATO.. :>

spokrandt commented 5 years ago

Was bored yesterday afternoon and made the changes i think. I do not know groovy so here is my suggested changes.. My work firewall will not let me submit back to github.. so...

WATO-child line 161 change input "attrOp", "enum", title: "Operator?", required:true, multiple:false, submitOnChange:true, options:[['<':"< (less than)"], ['<=':"<= (less than or equals to)"], ['=':"= (equals to)"], ['>=':">= {greater than or equals to}"], ['>':"> {greater than}"], ['!=':"!= {not equals to}"], ['⬆︎':"⬆︎ (rises above)"], ['⬇︎':"⬇︎ (falls below)"], ['⬆︎⬇︎':"⬆︎⬇︎ (changes)"],['~':"~ (contained in)"]]

line 370 add case "~": if ( aV.toString().contains(evtVal) ) match = true; break

adey commented 4 years ago

sorry for the delay. i will include this.