Groovy question

I work with languages like C# and Java professionally. Thinking that because Groovy is built on Java JIT and Java has strong inheritance system I went to this and this and yes groovy has inheritance. It has classes, interfaces, traits… But in the groovy code in the ST I cannot find any classes, interfaces or traits. I tried to get some runtime information (methods?) on the class but all I have got an security exception. So I wonder how should I know the class(es) my class is inherited from (or is it)

You probably won’t get much help since the groovy IDE part of Smartthings will go away soon and they are trying move to restful Api’s

1 Like

Have you seen this? …

I did, but it does not say what should I do to check the the methods or how can I print the stack trace. Do you know how?

The SmartThings Groovy environment is very sandboxed. Think of it more as a simple scripting language versus a full-blown development environment. The code you write runs on the SmartThings cloud servers. Thus, Samsung needs to limit what is available to protect their platform.

If I was starting fresh with SmartThings, I would avoid spending too much time learning their legacy Groovy platform. Instead, I would focus on learning the new ST API.

The one exception to this currently, is if I was needing to write a hub-connected device handler. Those must still be written in Groovy for now. Samsung has not announced what, if anything, will replace those Groovy DTHs. Since they have exited the hardware side of home automation, hub connected device drivers may become the problem of the WASH (works as SmartThings hub) hub providers. No one knows for sure at this time what the future will look like.


Thank you for your advice. My immediate plans is to see what can I do to the ST to Ring integration ( see my other posts). I was really surprised when all Ring device handlers suddenly disappeared. So you suggest that we need to wait to see what kind of the API ST will give us. Apparently backwards compatibility is not a biggest concern