https://github.com/techgaun/xmart-things-demo
A demo app in Phoenix for https://github.com/techgaun/xmart-things
https://github.com/techgaun/xmart-things-demo
demo phoenix smartapp
Last synced: 2 months ago
JSON representation
A demo app in Phoenix for https://github.com/techgaun/xmart-things
- Host: GitHub
- URL: https://github.com/techgaun/xmart-things-demo
- Owner: techgaun
- Created: 2016-12-09T20:23:59.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-15T20:17:22.000Z (almost 7 years ago)
- Last Synced: 2025-02-11T21:51:14.899Z (4 months ago)
- Topics: demo, phoenix, smartapp
- Language: Elixir
- Size: 72.3 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# xmart-things-demo
This is a sample application that uses [xmart_things](https://github.com/techgaun/xmart-things) to interact with Web Services SmartApp.

- [Sample Web Services SmartApp groovy script](priv/smartapp/lock.groovy)
- [Auth Controller](web/controllers/auth_controller.ex) has callback route and stores smartthings access token and smartthings endpoint URI for SmartApp in user session.
- [Page Controller](web/controllers/page_controller.ex) has lock related routes and handles listing lock devices and also turning the locks on and off.To start your Phoenix app:
* Install dependencies with `mix deps.get`
* Install Node.js dependencies with `npm install`
* Start Phoenix endpoint with `mix phoenix.server`Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
## Configuration
You have to configure `xmart_things` configuration by setting appropriate environment variables. Look at the [config](config/config.exs#L21-L25)
On the SmartThings side, configure a new app using [Sample Web Services SmartApp groovy script](priv/smartapp/lock.groovy).