Skip to content
Nature Remo API Client for Go
Go
Branch: master
Clone or download
Latest commit 2122de9 Sep 25, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_example Merge pull request #1 from tenntenn/fix-rate-limit Dec 3, 2018
.travis.yml Add documents Nov 13, 2018
LICENSE
README.md Update README status Jul 18, 2019
aircon.go Fix the value of AirVolumeAuto Jan 28, 2019
appliance.go
appliance_service.go Add ApplianceService.SendLightSignal Jul 18, 2019
client.go Define Client.UserAgent and make a Client specify the respective User… Jun 13, 2019
default_button.go Add TV and Light fields to Appliance Jul 18, 2019
device.go Add documents Nov 13, 2018
device_service.go Add documents Nov 13, 2018
doc.go Add documents Nov 13, 2018
go.mod Add go.mod Dec 3, 2018
go.sum Add go.mod Dec 3, 2018
ir_signal.go Add documents Nov 13, 2018
light.go Add TV and Light fields to Appliance Jul 18, 2019
local_client.go Add local api Nov 13, 2018
sensor.go Add documents Nov 13, 2018
signal.go Add documents Nov 13, 2018
signal_service.go Add documents Nov 13, 2018
tv.go Add TV and Light fields to Appliance Jul 18, 2019
user.go Add comments Nov 11, 2018
user_service.go Add documents Nov 13, 2018

README.md

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
You can’t perform that action at this time.