General development questions about smartthings development


(techgaun) #1

Hi, I’m new to working with smartthings and have only played around with web services API so far and built an OAuth strategy and client for Elixir. Now that I’m trying to jump into some groovy code and I’ve couple of questions regarding smartthings development process.

  • How do I typically writing unit tests for the groovy scripts I write for smartthings apps?
  • I can not seem to use simulator for smartthings parent/child apps. Is there something special that needs to be done for it?
  • Is there a way to mass deploy the same code on multiple smart-apps (same/similar code) via continuous integration tools? Would be just easier if I could post the content of file via some sort of api but I can’t seem to find api documentation for this.

Thanks,
Samar


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2
  1. Currently the simulator is not trustworthy and has a lot of limitations. You need to test by self-publishing repeatedly.

  2. At the SDC 9 months ago, SmartThings demoed the “CLI” (command line environment) for SmartApps & Device Type Handlers. It definitely exists (and the demo confirms why the GitHub repos are structured like they are), but it is still only available internally or perhaps in a secret Beta.


(techgaun) #3

Thanks tgauchat. Its been a pain from the development perspective so far. Specially, I am trying to build this out for bigger deployment and these things are definitely the pain points for me. I hope the CLI comes out soon as I want my development workflow to be better.

Any idea on unit testing approaches?


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #4

Don’t hold your breath waiting for CLI, but search forum for Beta program application link; might get lucky.

Nah…well… If you can build small SmartApps which accurately test some isolated code, then you can cut and paste… How very 80’s.


(Anders) #5

I’d love to see some better solutions to your problems. Developing now can be quite painful. Partly because the simulator sucks and isn’t trustworthy at all. That might not matter much if we had a good way to write unit tests, but we don’t.

I’ve been thinking about creating mocks for the most common things in Groovy, but never gotten around to it. :slight_smile:️ Let me know if you find/start anything.


(Tim) #6

@techgaun I came up with at least some stuff for my repo.

Specifically I got this one unit test working, don’t know if that helps at all:


(Boris Britva) #7

While developing mobile apps via smart tings and being in need of help i’ve calculation engine case and got some help. So, you might try it as well.