0.1.2 • Published 3 years ago

blueriiot-api-client v0.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

blueriiot-api-client

This is an unofficial node js wrapper for the Blueriiot API

Usage

Example to fetch all pools

const {BlueriiotAPI} = require('./api');
var api = new BlueriiotAPI(process.env.EMAIL,process.env.PASSWORD);
api.init().then(function(){
    console.log(api.isAuthenticated());
    api.getSwimmingPools().then(function(data){console.log(data);});
    
    //api.getUser().then(function(data){console.log(data);});
    //api.getBlueDevice(process.env.BLUEID).then(function(data){console.log(data);});
    //api.getSwimmingPools().then(function(data){console.log(data);});
    //api.getSwimmingPool(process.env.POOLID).then(function(data){console.log(data);});
    //api.getSwimmingPoolStatus(process.env.POOLID).then(function(data){console.log(data);});
    //api.getSwimmingPoolBlueDevices(process.env.POOLID).then(function(data){console.log(data);});
    //api.getSwimmingPoolFeed(process.env.POOLID, "en").then(function(data){console.log(data);});
    //api.getLastMeasurements(process.env.POOLID,process.env.BLUEID).then(function(data){console.log(data);})
    //api.getGuidance(process.env.POOLID, "en").then(function(data){console.log(data);});
    //api.getGuidanceHistory(process.env.POOLID, "en").then(function(data){console.log(data);});
    //api.getChemistry(process.env.POOLID).then(function(data){console.log(data);});
    //api.getWeather(process.env.POOLID, "en").then(function(data){console.log(data);});
    //api.getBlueDeviceCompatibility(process.env.BLUEID).then(function(data){console.log(data);});
}).catch( function(error){
    console.log("We have issues signing in: " + error);
});

End Points

getUser()
getBlueDevice(<blue_device_serial>)
getSwimmingPools()
getSwimmingPool(<swimming_pool_id>)
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>)
etBlueDeviceCompatibility(<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=""
0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago