Anyone know how to accomplish this? I thought about creating an intermediate (like below) handler but that seems tacky and not very scalable. Also doesn’t work for floating point values… just tiny integers and enums.
This bothered me too, but I haven’t been able to find a solution. Closures could fix this, but SmartThings seems to block closures for security purposes I think.
[quote=“johnathan398, post:3, topic:17597”]
a more elegant solution exists.
[/quote]You could have the fan out fan in calls, and look up the method name of the calling method on the stack, and do different things in the fan-in method based on the caller. But that seems less clear than just doing it the other way.
What’s the purpose of the parameter? You can do a switch statement in the event handler based on the device name/id/type/event… if you just want a single handler