bangali icon indicating copy to clipboard operation
bangali copied to clipboard

Feature request: matching ranges and lists

Open spokrandt opened this issue 5 years ago • 3 comments

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 avatar Mar 14 '19 17:03 spokrandt

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

spokrandt avatar Mar 14 '19 20:03 spokrandt

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

spokrandt avatar Mar 15 '19 14:03 spokrandt

sorry for the delay. i will include this.

adey avatar Dec 02 '19 05:12 adey