Skip to content

Commit

Permalink
fix(lib): update readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
manushak committed Feb 29, 2024
1 parent 4702bf8 commit 8beec6a
Showing 1 changed file with 17 additions and 28 deletions.
45 changes: 17 additions & 28 deletions src/lib/watt-time/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,26 @@ Limitations:

WattTime API requires activation of subscription before usage. Please refer to the [WattTime website](https://watttime.org/docs-dev/data-plans/) for more information.

Create a `.env` file in the IF project root directory. This is where you can store your WattTime authentication details. Your `.env` file should look as follows:

**Required Parameters:**

```txt
WATT_TIME_USERNAME: <your-username>
WATT_TIME_PASSWORD: <your-password>
```
# example environment variable config , prefix the environment variables with "ENV" to load them inside the plugin.
# export WATT_TIME_USERNAME=test1
# export WATT_TIME_PASSWORD=test2

**Optional Parameter:**

```txt
WATT_TIME_TOKEN: <your-token>
```

- username: Username for the WattTime API
- ENV_WATT_TIME_USERNAME - specifying this value enables the Impact to load the value from the environment variable `WATT_TIME_USERNAME`
- password: Password for the WattTime API
- ENV_WATT_TIME_PASSWORD - specifying this value enables the Impact to load the value from the environment variable `WATT_TIME_PASSWORD`
### Plugin global config

- `base-url`: The URL for the WattTime API endpoint.

### inputs
### Inputs

**Required Parameters:**

Expand All @@ -55,10 +61,7 @@ WattTime API requires activation of subscription before usage. Please refer to t
// export WATT_TIME_USERNAME=test1
// export WATT_TIME_PASSWORD=test2
// use environment variables to configure the plugin
const output = WattTimeGridEmissions({
username: process.env.WATT_TIME_USERNAME,
password: process.env.WATT_TIME_PASSWORD,
});
const output = WattTimeGridEmissions();
const result = await output.execute([
{
timestamp: '2021-01-01T00:00:00Z',
Expand All @@ -68,20 +71,9 @@ const result = await output.execute([
]);
```

### manifest Usage

#### Environment Variable based configuration for manifest

```yaml
# environment variable config , prefix the environment variables with "ENV" to load them inside the plugin.
# export WATT_TIME_USERNAME=test1
# export WATT_TIME_PASSWORD=test2
global-config:
username: ENV_WATT_TIME_USERNAME
password: ENV_WATT_TIME_PASSWORD
```
### Manifest Usage

#### Static configuration for manifest
#### Input for manifest

```yaml
inputs:
Expand All @@ -101,9 +93,6 @@ initialize:
watt-time:
method: WattTimeGridEmissions
path: '@grnsft/if-unofficial-plugins'
global-config:
username: username
password: password
tree:
children:
child:
Expand Down

0 comments on commit 8beec6a

Please sign in to comment.