Coder Social home page Coder Social logo

cocorojs's Introduction

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

cocorojs's People

Contributors

harusame0616 avatar

Stargazers

Kazuki Fujita avatar

Watchers

 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.