cocorojs

1.0.1 • Public • Published

cocorojs

This is Cocoro Air API wrapper library.


Description

Cocoro Air is cloud service that operates IoT home appliance product of Sharp.
Cocoro Air's API is private, but we can use API if the conditions are met.

Cocoro JS helps your api calling.

** Waraning **
Such use is not expected by the official.
Please use all at your own risk.


Requirement

You have to signin and register device with Cocoro Air APP.
CocoroJS require APP-SECRET and TERMINAL-APP-ID-KEY. ** Please be careful not to leak **

You have to get them using mitm proxy.

  1. Find the request below.
  2. Check your APP-SECRET in it.
POST
https://hms.cloudlabs.sharp.co.jp/hems/pfApi/ta/setting/login/?appSecret=APP-SECRET&serviceName=iClub
  1. Eenter it request show the json of request body.
  2. Check your TERMINAL-APP-ID-KEY.
{
  "terminalAppId": "https://db.cloudlabs.sharp.co.jp/clpf/key/TERMINAL-APP-ID-KEY"
}

Usage

const cocoro = require('cocorojs');
const api = new cocoro.CocoroAPI('APP-SECRET', 'TERMINAL-APP-ID-KEY');

// needs login to use API
// expires in a certain amount of time
await api.login();

// gets your registered device info
const boxes = await api.getBoxInfo();

// gets device detail
const propery = await api.getProperty(boxes[0]);

// controls your device
await api.control(boxes[0], [
    new Power('on'), // you will choice on/off
    new Operation('cooling'), // you will choice auto/cooling/heating/dehumidification
    new Wind('breeze') // you will choice auto/breeze/light/strong/rapid
    new Direction('low') // you will choice auto/up/straight/low/lower/lowest/swing
    ]);

Install

npm i cocorojs

Licence

MIT

Author

Masaharu Nemoto

Readme

Keywords

none

Package Sidebar

Install

npm i cocorojs

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

8.94 kB

Total Files

14

Last publish

Collaborators

  • harusame0616