Skip to content

Latest commit

 

History

History
227 lines (169 loc) · 6.2 KB

README.md

File metadata and controls

227 lines (169 loc) · 6.2 KB

In this repository you will find all the ressources to control the Amperage of a WallBox through its API

Description of the project :

TODO

Documentation :

Members

maxChargingCurrent

Le courant max de charge du chargeur

responsePuissance

La puissance à partir de laquelle on veut charger

stopCounter

Compteur utile pour arreter la charge

Constants

seuilPuissance

Le seuil de puissance pour pouvoir arreter la charge

jwtToken

The JWT Token with it expiration date

Functions

setmaxChargingCurrent()

Set the value of maxChargingCurrent by function

auth()

The function below is used to authenticate the user and setup the refurbishment of the token

setAmperage(value)

This function is used to set the amperage of the charger

switchOff()

This function is used to stop the charger

switchOn()

This function is used to start the charger

getShellyPower()

This function is used to get the power of the shelly

main1()

The function below is used to start the script

main2()

The function below is used to start the body of the script

setJwtToken(token, expiration)

The function below is used to modify the jwtToken object

getAuthToken(baseUrl, method, callback)Promise

The function below is used to generate the jwt Token for the API calls

fetchData(baseUrl, method, callback, body)Promise

The function below is used to make the API calls

delay(ms)Promise

A small fucntion to handle delay between API requests

logger(message)

This function add a message to the console and to the log file

maxChargingCurrent

Le courant max de charge du chargeur

Kind: global variable

responsePuissance

La puissance à partir de laquelle on veut charger

Kind: global variable

stopCounter

Compteur utile pour arreter la charge

Kind: global variable

seuilPuissance

Le seuil de puissance pour pouvoir arreter la charge

Kind: global constant

jwtToken

The JWT Token with it expiration date

Kind: global constant

setmaxChargingCurrent()

Set the value of maxChargingCurrent by function

Kind: global function

auth()

The function below is used to authenticate the user and setup the refurbishment of the token

Kind: global function

setAmperage(value)

This function is used to set the amperage of the charger

Kind: global function

Param Type Description
value Number The value of the amperage

switchOff()

This function is used to stop the charger

Kind: global function

switchOn()

This function is used to start the charger

Kind: global function

getShellyPower()

This function is used to get the power of the shelly

Kind: global function

main1()

The function below is used to start the script

Kind: global function

main2()

The function below is used to start the body of the script

Kind: global function

setJwtToken(token, expiration)

The function below is used to modify the jwtToken object

Kind: global function

Param Type Description
token String The token to be stored
expiration Date The expiration date of the token

getAuthToken(baseUrl, method, callback) ⇒ Promise

The function below is used to generate the jwt Token for the API calls

Kind: global function
Returns: Promise - The promise of the API call

Param Type Description
baseUrl String The endpoint of the API Request
method String The method of the API Request
callback function The callback function to be called after the API call

fetchData(baseUrl, method, callback, body) ⇒ Promise

The function below is used to make the API calls

Kind: global function
Returns: Promise - The promise of the API call

Param Type Default Description
baseUrl String The endpoint of the API Request
method String The method of the API Request
callback function The callback function to be called after the API call
body Object {} The body of the API Request

delay(ms) ⇒ Promise

A small fucntion to handle delay between API requests

Kind: global function
Returns: Promise - The promise of the timeout

Param Type Description
ms Number The number of milliseconds to wait

logger(message)

This function add a message to the console and to the log file

Kind: global function

Param Type Description
message String The message to be logged