termo-api

command module
v0.0.0-...-25765a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2014 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Termo-API

A Go based API for a DIY internet controlled thermostat.

Hardware

diy-thermostat - Raspberry Pi (Model B) - Sainsmart 4 Relay Module - DS18B20 Temperature Sensor

Dependencies

  • Go
  • gin a Go web framework.
  • hwio a Go GPIO library.
  • Termo-UI is an EmberJS powered UI for this API.

Building (on OS X 10.9.5)

Note: The toolchain is only needed if there is a cgo dependency.

Deploying

  • Create ./api_key see ./api_key.example
  • Edit script/deploy variables as needed
  • $ script/deploy

Note: Currently termo-api is deployed as root so as to interface with GPIO pins, this is awful, and will be remedied soon.

Starting

$ API_KEY=foo ./termo-api

Issues

  • Permissions issues are preventing running the server as a non superuser
  • Hardware build needs to be documented.
  • No unit tests

JSON API

GET /v1/thermostat
{
  "targetTemp": 20,
  "heaterStatus" : true,
  "currentTemp": 18
}

POST /v1/thermostat

set the target temperature

{
  "targetTemp": 30
}

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址