Hi folks,
is there a way to match in a .map file “any other value”?
eg:
1= string A
2= string B
*= “”
thanks
Andrea
Hi folks,
is there a way to match in a .map file “any other value”?
eg:
1= string A
2= string B
*= “”
thanks
Andrea
Unfortunately not that I’m aware of.
But this is and excellent candidate to open an issue in eclipse / smart home github repo !
any suggestion how to do that?
Sorry, first time for me
Go to: (I believe it’s the correct repository)
open an issue can the tile should be:
[FEATURE REQUEST] [MAP] Map transformation “Any tother value”
Is the body, describe what you would like to be implemented
Here you are:
I hope this is clear enough
thanks for your help
Andrea
At least you’ve got an option that is to use Scale transform if your input data are numbers. Scale transformation has a catchall option :
[1..2[=String A
[2..3[=String B
[..]=any other
Good news, the PR for a default value in MAP transformation has been approved and merged.
PR 6834
thank you for good news
Andrea
Should be on the latest snapshot
Let me test
5 minutes
Yep, it works:
New MAP transform docs:
WOW
so in my example above I can add at the end
=""
that’s it
Andrea
Yep, should work
Great contribution, thanks
stupid question, but …
if also my item has a value NULL, but in my map file I don’t have specific map NULL="", that means the last “default” rule will cover also this piece?
eg.
item = 3
map file:
1= value
2= value
= default_value
being 3, I will see the default_value, correct?
Andrea
It should do
I haven’t tested that…
… … … … … … …
Yes it works
that will simplify a lot my map files
Thanks guys for your help
Andrea
How would this Work in OH3 with the State-description? Or would I need a map as this does not work with State-description?
Well, everything in the above thread is about the Map transform. So if you want to do this you would use the Map transform in your State Description Pattern field.