Giter VIP home page Giter VIP logo

natureremo's Introduction

Nature Remo API Client for Go Go Documentation Travis Go Report Card codecov

tenntenn/natureremo is Nature Remo API Client for Go. Nature Remo is a smart remote control that easily realizes smart home by connecting your appliances to the Internet.

Install

$ go get -u github.com/tenntenn/natureremo

Examples

See _example directory.

func main() {
	cli := natureremo.NewClient(os.Args[1])
	ctx := context.Background()

	applianceName := os.Args[2]
	signalName := os.Args[3]

	as, err := cli.ApplianceService.GetAll(ctx)
	if err != nil {
		log.Fatal(err)
	}

	var target *natureremo.Appliance
	for _, a := range as {
		if a.Nickname == applianceName {
			target = a
			break
		}
	}

	if target == nil {
		log.Fatalf("%s not found", applianceName)
	}

	for _, s := range target.Signals {
		if s.Name == signalName {
			cli.SignalService.Send(ctx, s)
			break
		}
	}
}

Supported API

Cloud API

http://swagger.nature.global

Status Endpoint HTTP Method Service
✔️ /1/users/me GET UserService
✔️ /1/users/me POST UserService
✔️ /1/devices GET DeviceService
✔️ /1/devices/{device} POST DeviceService
✔️ /1/devices/{device}/delete POST DeviceService
✔️ /1/devices/{device}/temperature_offset POST DeviceService
✔️ /1/devices/{device}/humidity_offset POST DeviceService
✔️ /1/detectappliance POST ApplianceService
✔️ /1/appliances GET ApplianceService
✔️ /1/appliances POST ApplianceService
✔️ /1/appliance_orders POST ApplianceService
✔️ /1/appliances/{appliance}/delete POST ApplianceService
✔️ /1/appliances/{appliance} POST ApplianceService
✔️ /1/appliances/{appliance}/aircon_settings POST ApplianceService
✔️ /1/appliances/{appliance}/tv POST ApplianceService
✔️ /1/appliances/{appliance}/light POST ApplianceService
✔️ /1/appliances/{appliance}/signals GET SignalService
✔️ /1/appliances/{appliance}/signals POST SignalService
✔️ /1/appliances/{appliance}/signal_orders POST SignalService
✔️ /1/signals/{signal} POST SignalService
✔️ /1/signals/{signal}/delete POST SignalService
✔️ /1/signals/{signal}/send POST SignalService

Local API

http://local.swagger.nature.global/

Status Endpoint HTTP Method LocalClient Method
✔️ /messages GET Fetch
✔️ /messages POST Emit

natureremo's People

Contributors

tenntenn avatar eivy avatar songmu avatar chroju avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.