Skip to content

Commit

Permalink
Bug fix and readme expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
alandoherty committed Aug 17, 2018
1 parent dd9b30a commit 9fca8b2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@

This repository provides a Grafana datasource plugin for working with the WIFIPLUG platform.

[![Demonstration](https://s3-eu-west-1.amazonaws.com/assets.wifiplug.co.uk/github/grafana-wifiplug-1.png)](https://s3-eu-west-1.amazonaws.com/assets.wifiplug.co.uk/github/grafana-wifiplug-1.png)

## Getting Started

To get started you need a personal API Key & API Secret.

Please note that the API is subject to rate limits and excessive usage my be throttled, contact us directly if you believe this may be a problem or if you require a billed API plan.

## Contributing

We welcome any pull requests or bug reports, please try and keep to the existing style conventions and comment any additions. The issues section is only for problems related to the Grafana datasource, other issues will be closed.
2 changes: 2 additions & 0 deletions dist/datasource.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/datasource.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export default class WifiPlugDatasource {
let deviceUuid = targetComponents[0];
let serviceUuid = targetComponents[1];

if (targetComponents.length == 0 || (target.device_requirement == null || target.device_requirement == ""))
continue;

if (target.device_requirement == "consumption") {
promises[`${target.target}#consumption`] = this.backendSrv.datasourceRequest({
url: `${url}/wifiplug-v1.0/device/${deviceUuid}/service/${serviceUuid}/energy/consumption/historic?date_from=${dateFrom}Z&date_to=${dateTo}Z&grouping=hour`,
Expand Down
Binary file added dist/img/dashboard_example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions dist/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"id": "wifiplug-datasource",

"info": {
"description": "Provides a datasource for WIFIPLUG energy consumption information",
"description": "Provides a datasource for WIFIPLUG energy data",
"author": {
"name": "WIFIPLUG",
"url": "https://wifiplug.co.uk"
Expand All @@ -18,10 +18,13 @@
{"name": "Project site", "url": "https://github.com/wifiplug/grafana-wifiplug"},
{"name": "Company site", "url": "https://wifiplug.co.uk"}
],
"version": "0.1.0",
"updated": "2018-08-13"
"version": "0.1.0"
},

"screenshots": [
{"name": "Example Dashboard", "path": "img/dashboard_example.png"}
],

"dependencies": {
"grafanaVersion": "4.5.x",
"plugins": [ ]
Expand All @@ -34,7 +37,7 @@
"url": "https://api.wifiplug.co.uk/v1.0",
"headers": [
{"name": "X-API-Key", "content": "{{.JsonData.apiKey}}"},
{"name": "X-API-Secret", "content": "{{.JsonData.apiSecret}}"},
{"name": "X-API-Secret", "content": "{{.SecureJsonData.apiSecret}}"},
{"name": "X-API-Client", "content": "grafana-ds/1.0"}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"url": "https://api.wifiplug.co.uk/v1.0",
"headers": [
{"name": "X-API-Key", "content": "{{.JsonData.apiKey}}"},
{"name": "X-API-Secret", "content": "{{.JsonData.apiSecret}}"},
{"name": "X-API-Secret", "content": "{{.SecureJsonData.apiSecret}}"},
{"name": "X-API-Client", "content": "grafana-ds/1.0"}
]
}
Expand Down

0 comments on commit 9fca8b2

Please sign in to comment.