Skip to content

Latest commit

 

History

History
103 lines (88 loc) · 3.23 KB

README.md

File metadata and controls

103 lines (88 loc) · 3.23 KB

Goira - Go Infrared API

Build Status Go Report Card Documentation Maintenance License: MIT

Goira (Go Infrared API) is a go backend for Raspberry Pi, which exposes API routes to control GPIO connected infrared LED's. Currently Goira only supports controlling air conditioners.

Features

  • Uses IRBlaster linux kernel driver to manage the IR transmission
  • Exposes Restful API
  • Only password authentication

Limitations

  • No HTTPS yet.
  • Limitations of the IRBlaster kernel driver
  • AC Config to binary mapping has to be made specifically for each AC manufacturer. See: goira/internal/accontrol/mappers/
  • By default only supports ChangHong AC's

Tech stack

Installation

First, make sure you have installed IRBlaster kernel driver.

You can use the GNU make to build just the backend service or both front-end and backend.

$ make build     #build just the backend 
$ make frontend  #build just the front-end
$ make full      #build both front-end and backend

Resulting binary and front-end files will be placed in the build folder.

Usage

After you run the binary, server will start at localhost:8080.

If the frontend has been installed, open http://localhost:8080/ to access the web app.

API

Login

  • Type: POST
  • Route: /login
  • Parameters:
{
  "password": <password_here>
}
  • Response: 200 OK for successful login

Get AC state

  • Type: GET
  • Route: /status
  • Response 200 OK for success with body (example):
{
  "temp": 20,      #20 celcius
  "wind": 0,       #wind mode 0
  "mode": 0,       #ac mode 0
  "active": false  #turned off
}

Set AC state

  • Type: POST
  • Route: /state
  • Parameters (example):
#example 1
{
  "temp": 29,
  "active": false,
  "mode": 2
}

#example 2
{
  "active": true
}
  • Response 200 OK for success

Contributing

  • Pull requests are welcome.
  • For major changes, please open an issue first to discuss what you would like to change.
  • Remember to use gofmt to format the code before making the pull request.

Roadmap

Near future

  • Multiple manufacturer support (Hitachi etc.)

Some day

  • Support for other kinds of IR devices.

References

License

MIT