Giter Site home page Giter Site logo

blueriiot-api-client's Introduction

blueriiot-api-client

This is an unofficial node js wrapper for the Blueriiot API

Usage

Example to fetch all pools

import 'dotenv/config';
import { BlueriiotAPI } from './api.mjs';
import { logger } from './logger.mjs';
const api = new BlueriiotAPI(process.env.EMAIL, process.env.PASSWORD);
api.authenticate()
    .then(async () => {
        logger.debug('Authentication success!');
    })
    .catch((error) => {
        logger.error(`Authentication failed! ${error.message}`);
    });
//logger.log(await api.getUser());
//logger.log(await api.getBlueDevice(process.env.BLUEID));
//logger.log(await api.getSwimmingPools());
//logger.log(await api.getSwimmingPool(process.env.POOLID));
// DEPECREATED logger.log(await api.getSwimmingPoolStatus(process.env.POOLID));
//logger.log(await api.getSwimmingPoolBlueDevices(process.env.POOLID));
//logger.log(await api.getSwimmingPoolFeed(process.env.POOLID, 'en'));
//logger.log(await api.getLastMeasurements(process.env.POOLID, process.env.BLUEID));
//logger.log(await api.getGuidance(process.env.POOLID, 'en'));
//logger.log(await api.getGuidanceHistory(process.env.POOLID, 'en'));
//logger.log(await api.getChemistry(process.env.POOLID));
//logger.log(await api.getWeather(process.env.POOLID, 'se'));
//logger.log(await api.getBlueDeviceCompatibility(process.env.BLUEID));

End Points

getUser()
getBlueDevice(<blue_device_serial>)
getSwimmingPools()
getSwimmingPool(<swimming_pool_id>)
// DEPECREATED getSwimmingPoolStatus(<swimming_pool_id>)
getSwimmingPoolBlueDevices(<swimming_pool_id>)
getSwimmingPoolFeed(<swimming_pool_id>,<language>)
getLastMeasurements(<swimming_pool_id>,<blue_device_serial>)
getGuidance(<swimming_pool_id>,<language>)
getGuidanceHistory(<swimming_pool_id>,<language>)
getChemistry(<swimming_pool_id>)
getWeather(<swimming_pool_id>,<language>)
getBlueDeviceCompatibility(<blue_device_serial>)

Test

For test you can look in the test.js file. To use it either mod the code or add a .env file. .env should then include at least email and password. Poolid/blueid can be added when you have it.

EMAIL= ""
PASSWORD=""
POOLID=""
BLUEID=""

blueriiot-api-client's People

Contributors

ludvigaldrin avatar allwi290 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.