2.0.0 • Published 2 years ago

nature-remo v2.0.0

Weekly downloads
24
License
MIT
Repository
github
Last release
2 years ago

Nature Remo

npm version npm: total downloads Build Status Codacy Badge Codacy Badge

yarn add nature-remo
# or
npm install nature-remo

Basic Usage

const NatureRemo = require('nature-remo')

const client = new NatureRemo.Cloud(process.env.NATURE_REMO_CLOUD_API_TOKEN)

async function turnOffAirConditioner() {
  const airconList = await client.listAircon()
  const aircon = airconList[0]

  await client.updateAirconSettings(aircon.id, {
    button: 'power-off',
  })

  console.log('Aircon: turned off')
}

async function turnOnAirConditioner() {
  const airconList = await client.listAircon()
  const aircon = airconList[0]

  await client.updateAirconSettings(aircon.id, {
    operation_mode: 'cool',
    temperature: 24,
  })

  console.log('Aircon: turned on')
}

You might want to grab an API token from https://home.nature.global.

API

const NatureRemo = require('nature-remo')

Cloud API

See Cloud API Documents.

const client = new NatureRemo.Cloud(NATURE_REMO_CLOUD_API_TOKEN)

Local API

See Local API Documents.

const client = new NatureRemo.Local(NATURE_REMO_LOCAL_ADDRESS)

Development

git clone https://github.com/uetchy/nature-remo # clone this repository
cd nature-remo # move to the repository folder
yarn install # install deps
NATURE_REMO_CLOUD_TOKEN=<nature-remo-cloud-api-token> yarn test # run test before creating a pull request

Sibling projects

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

2.0.0

2 years ago

1.3.0

3 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.3.1

5 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago