boB Rudis
4 years ago
19 changed files with 615 additions and 8 deletions
@ -1,4 +1,11 @@ |
|||||
# Generated by roxygen2: do not edit by hand |
# Generated by roxygen2: do not edit by hand |
||||
|
|
||||
|
export(wl_conditions) |
||||
|
export(wl_nodes) |
||||
|
export(wl_sensor_activity) |
||||
|
export(wl_sensors) |
||||
|
export(wl_stations) |
||||
import(httr) |
import(httr) |
||||
|
importFrom(anytime,anytime) |
||||
|
importFrom(digest,hmac) |
||||
importFrom(jsonlite,fromJSON) |
importFrom(jsonlite,fromJSON) |
||||
|
@ -0,0 +1,7 @@ |
|||||
|
httr::user_agent( |
||||
|
sprintf( |
||||
|
"weatherlink R package v%s: (<%s>)", |
||||
|
utils::packageVersion("weatherlink"), |
||||
|
utils::packageDescription("weatherlink")$URL |
||||
|
) |
||||
|
) -> .WEATHERLINK_UA |
@ -0,0 +1,49 @@ |
|||||
|
#' Get current conditions data for one station |
||||
|
#' |
||||
|
#' Returns current conditions data for a weather station selected by a station ID. |
||||
|
#' |
||||
|
#' @param station_id (chr) Station id |
||||
|
#' @param api_key,api_secret WeatherLink API (V2) key/secret. Generate & retrieve them from |
||||
|
#' [your account page](https://www.weatherlink.com/account). Automagically retrieved from |
||||
|
#' `WEATHERLINK_API_KEY` and `WEATHERLINK_API_SECRET` environment variables. |
||||
|
#' @return list ith a `generated_at` attribute |
||||
|
#' @references [API Endpoint](https://weatherlink.github.io/v2-api/api-reference); |
||||
|
#' [Data structure types](https://weatherlink.github.io/v2-api/data-structure-types) |
||||
|
#' @export |
||||
|
wl_conditions <- function(station_id, |
||||
|
api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET")) { |
||||
|
|
||||
|
list( |
||||
|
`api-key` = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
`station-id` = station_id[1], |
||||
|
`t` = as.character(as.integer(Sys.time())) |
||||
|
) -> params |
||||
|
|
||||
|
digest::hmac( |
||||
|
key = Sys.getenv("WEATHERLINK_API_SECRET"), |
||||
|
object = paste(names(params), as.character(params), sep = "", collapse = ""), |
||||
|
algo = "sha256" |
||||
|
) -> params[["api-signature"]] |
||||
|
|
||||
|
httr::GET( |
||||
|
url = sprintf("https://api.weatherlink.com/v2/current/%s", as.character(station_id[1])), |
||||
|
query = list( |
||||
|
`api-key` = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
`t` = as.character(as.integer(Sys.time())), |
||||
|
`api-signature` = params[["api-signature"]] |
||||
|
), |
||||
|
.WEATHERLINK_UA |
||||
|
) -> res |
||||
|
|
||||
|
httr::stop_for_status(res) |
||||
|
|
||||
|
res <- httr::content(res, as = "text", encoding = "UTF-8") |
||||
|
|
||||
|
out <- jsonlite::fromJSON(res) |
||||
|
|
||||
|
attr(out$sensors, "generated_at") <- anytime::anytime(out$generated_at) |
||||
|
|
||||
|
invisible(out$sensors) |
||||
|
|
||||
|
} |
@ -0,0 +1,49 @@ |
|||||
|
#' Get historic conditions data for one station |
||||
|
#' |
||||
|
#' Returns historic conditions data for a weather station selected by a station ID. |
||||
|
#' |
||||
|
#' @param station_id (chr) Station id |
||||
|
#' @param api_key,api_secret WeatherLink API (V2) key/secret. Generate & retrieve them from |
||||
|
#' [your account page](https://www.weatherlink.com/account). Automagically retrieved from |
||||
|
#' `WEATHERLINK_API_KEY` and `WEATHERLINK_API_SECRET` environment variables. |
||||
|
#' @return list ith a `generated_at` attribute |
||||
|
#' @references [API Endpoint](https://weatherlink.github.io/v2-api/api-reference); |
||||
|
#' [Data structure types](https://weatherlink.github.io/v2-api/data-structure-types) |
||||
|
#' @export |
||||
|
wl_conditions <- function(station_id, |
||||
|
api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET")) { |
||||
|
|
||||
|
list( |
||||
|
`api-key` = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
`station-id` = station_id[1], |
||||
|
`t` = as.character(as.integer(Sys.time())) |
||||
|
) -> params |
||||
|
|
||||
|
digest::hmac( |
||||
|
key = Sys.getenv("WEATHERLINK_API_SECRET"), |
||||
|
object = paste(names(params), as.character(params), sep = "", collapse = ""), |
||||
|
algo = "sha256" |
||||
|
) -> params[["api-signature"]] |
||||
|
|
||||
|
httr::GET( |
||||
|
url = sprintf("https://api.weatherlink.com/v2/historic/%s", as.character(station_id[1])), |
||||
|
query = list( |
||||
|
`api-key` = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
`t` = as.character(as.integer(Sys.time())), |
||||
|
`api-signature` = params[["api-signature"]] |
||||
|
), |
||||
|
.WEATHERLINK_UA |
||||
|
) -> res |
||||
|
|
||||
|
httr::stop_for_status(res) |
||||
|
|
||||
|
res <- httr::content(res, as = "text", encoding = "UTF-8") |
||||
|
|
||||
|
out <- jsonlite::fromJSON(res) |
||||
|
|
||||
|
attr(out$sensors, "generated_at") <- anytime::anytime(out$generated_at) |
||||
|
|
||||
|
invisible(out$sensors) |
||||
|
|
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
#' Get all nodes attached to all weather stations associated with your API Key |
||||
|
#' |
||||
|
#' Returns data for all nodes attached to all gateways associated with the API Key passed in the query parameters. |
||||
|
#' Currently all nodes are returned in a single response. A future enhancement will provide pagination to reduce |
||||
|
#' the size of the response. |
||||
|
#' |
||||
|
#' @param api_key,api_secret WeatherLink API (V2) key/secret. Generate & retrieve them from |
||||
|
#' [your account page](https://www.weatherlink.com/account). Automagically retrieved from |
||||
|
#' `WEATHERLINK_API_KEY` and `WEATHERLINK_API_SECRET` environment variables. |
||||
|
#' @return data frame with a `generated_at` attribute |
||||
|
#' @references [API Endpoint](https://weatherlink.github.io/v2-api/api-reference); |
||||
|
#' [Data structure types](https://weatherlink.github.io/v2-api/data-structure-types) |
||||
|
#' @export |
||||
|
wl_nodes <- function(api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET")) { |
||||
|
|
||||
|
list( |
||||
|
`api-key` = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
`t` = as.character(as.integer(Sys.time())) |
||||
|
) -> params |
||||
|
|
||||
|
digest::hmac( |
||||
|
key = Sys.getenv("WEATHERLINK_API_SECRET"), |
||||
|
object = paste(names(params), as.character(params), sep = "", collapse = ""), |
||||
|
algo = "sha256" |
||||
|
) -> params[["api-signature"]] |
||||
|
|
||||
|
httr::GET( |
||||
|
url = "https://api.weatherlink.com/v2/nodes", |
||||
|
query = params, |
||||
|
.WEATHERLINK_UA |
||||
|
) -> res |
||||
|
|
||||
|
httr::stop_for_status(res) |
||||
|
|
||||
|
res <- httr::content(res, as = "text", encoding = "UTF-8") |
||||
|
|
||||
|
out <- jsonlite::fromJSON(res) |
||||
|
|
||||
|
attr(out$nodes, "generated_at") <- anytime::anytime(out$generated_at) |
||||
|
|
||||
|
invisible(out$nodes) |
||||
|
|
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
#' Get latest reporting times for all sensors attached to all weather stations associated with your API Key |
||||
|
#' |
||||
|
#' Returns the most recent times data was uploaded for all sensors associated with the api key that was passed. T |
||||
|
#' |
||||
|
#' @param api_key,api_secret WeatherLink API (V2) key/secret. Generate & retrieve them from |
||||
|
#' [your account page](https://www.weatherlink.com/account). Automagically retrieved from |
||||
|
#' `WEATHERLINK_API_KEY` and `WEATHERLINK_API_SECRET` environment variables. |
||||
|
#' @return data frame with a `generated_at` attribute |
||||
|
#' @references [API Endpoint](https://weatherlink.github.io/v2-api/api-reference); |
||||
|
#' [Data structure types](https://weatherlink.github.io/v2-api/data-structure-types) |
||||
|
#' @export |
||||
|
wl_sensor_activity <- function(api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET")) { |
||||
|
|
||||
|
list( |
||||
|
`api-key` = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
`t` = as.character(as.integer(Sys.time())) |
||||
|
) -> params |
||||
|
|
||||
|
digest::hmac( |
||||
|
key = Sys.getenv("WEATHERLINK_API_SECRET"), |
||||
|
object = paste(names(params), as.character(params), sep = "", collapse = ""), |
||||
|
algo = "sha256" |
||||
|
) -> params[["api-signature"]] |
||||
|
|
||||
|
httr::GET( |
||||
|
url = "https://api.weatherlink.com/v2/sensor-activity", |
||||
|
query = params, |
||||
|
.WEATHERLINK_UA |
||||
|
) -> res |
||||
|
|
||||
|
httr::stop_for_status(res) |
||||
|
|
||||
|
res <- httr::content(res, as = "text", encoding = "UTF-8") |
||||
|
|
||||
|
out <- jsonlite::fromJSON(res) |
||||
|
|
||||
|
attr(out$sensor_activity, "generated_at") <- anytime::anytime(out$generated_at) |
||||
|
|
||||
|
out$sensor_activity$time_received <- anytime::anytime(out$sensor_activity$time_received) |
||||
|
out$sensor_activity$time_recorded <- anytime::anytime(out$sensor_activity$time_recorded) |
||||
|
|
||||
|
invisible(out$sensor_activity) |
||||
|
|
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
#' Get a catalog of all types of sensors |
||||
|
#' |
||||
|
#' Returns a catalog of all available sensor types. |
||||
|
#' |
||||
|
#' @param api_key,api_secret WeatherLink API (V2) key/secret. Generate & retrieve them from |
||||
|
#' [your account page](https://www.weatherlink.com/account). Automagically retrieved from |
||||
|
#' `WEATHERLINK_API_KEY` and `WEATHERLINK_API_SECRET` environment variables. |
||||
|
#' @return data frame with a `generated_at` attribute |
||||
|
#' @references [API Endpoint](https://weatherlink.github.io/v2-api/api-reference); |
||||
|
#' [Data structure types](https://weatherlink.github.io/v2-api/data-structure-types) |
||||
|
#' @export |
||||
|
wl_sensors <- function(api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET")) { |
||||
|
|
||||
|
list( |
||||
|
`api-key` = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
`t` = as.character(as.integer(Sys.time())) |
||||
|
) -> params |
||||
|
|
||||
|
digest::hmac( |
||||
|
key = Sys.getenv("WEATHERLINK_API_SECRET"), |
||||
|
object = paste(names(params), as.character(params), sep = "", collapse = ""), |
||||
|
algo = "sha256" |
||||
|
) -> params[["api-signature"]] |
||||
|
|
||||
|
httr::GET( |
||||
|
url = "https://api.weatherlink.com/v2/sensor-catalog", |
||||
|
query = params, |
||||
|
.WEATHERLINK_UA |
||||
|
) -> res |
||||
|
|
||||
|
httr::stop_for_status(res) |
||||
|
|
||||
|
res <- httr::content(res, as = "text", encoding = "UTF-8") |
||||
|
|
||||
|
out <- jsonlite::fromJSON(res) |
||||
|
|
||||
|
attr(out$sensor_types, "generated_at") <- anytime::anytime(out$generated_at) |
||||
|
|
||||
|
invisible(out$sensor_types) |
||||
|
|
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
#' Get all sensors attached to all weather stations associated with your API Key |
||||
|
#' |
||||
|
#' Returns data for all sensors attached to all gateways associated with the API Key passed in the query parameters. |
||||
|
#' Currently all nodes are returned in a single response. A future enhancement will provide pagination to reduce |
||||
|
#' the size of the response. |
||||
|
#' |
||||
|
#' @param api_key,api_secret WeatherLink API (V2) key/secret. Generate & retrieve them from |
||||
|
#' [your account page](https://www.weatherlink.com/account). Automagically retrieved from |
||||
|
#' `WEATHERLINK_API_KEY` and `WEATHERLINK_API_SECRET` environment variables. |
||||
|
#' @return data frame with a `generated_at` attribute |
||||
|
#' @references [API Endpoint](https://weatherlink.github.io/v2-api/api-reference); |
||||
|
#' [Data structure types](https://weatherlink.github.io/v2-api/data-structure-types) |
||||
|
#' @export |
||||
|
wl_sensors <- function(api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET")) { |
||||
|
|
||||
|
list( |
||||
|
`api-key` = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
`t` = as.character(as.integer(Sys.time())) |
||||
|
) -> params |
||||
|
|
||||
|
digest::hmac( |
||||
|
key = Sys.getenv("WEATHERLINK_API_SECRET"), |
||||
|
object = paste(names(params), as.character(params), sep = "", collapse = ""), |
||||
|
algo = "sha256" |
||||
|
) -> params[["api-signature"]] |
||||
|
|
||||
|
httr::GET( |
||||
|
url = "https://api.weatherlink.com/v2/sensors", |
||||
|
query = params, |
||||
|
.WEATHERLINK_UA |
||||
|
) -> res |
||||
|
|
||||
|
httr::stop_for_status(res) |
||||
|
|
||||
|
res <- httr::content(res, as = "text", encoding = "UTF-8") |
||||
|
|
||||
|
out <- jsonlite::fromJSON(res) |
||||
|
|
||||
|
attr(out$sensors, "generated_at") <- anytime::anytime(out$generated_at) |
||||
|
|
||||
|
invisible(out$sensors) |
||||
|
|
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
#' Get all weather stations associated with your API Key |
||||
|
#' |
||||
|
#' Returns data for all weather stations associated with the API Key passed in the query parameters. |
||||
|
#' Currently all stations are returned in a single response. A future enhancement will provide pagination |
||||
|
#' to reduce the size of the response. |
||||
|
#' |
||||
|
#' @param api_key,api_secret WeatherLink API (V2) key/secret. Generate & retrieve them from |
||||
|
#' [your account page](https://www.weatherlink.com/account). Automagically retrieved from |
||||
|
#' `WEATHERLINK_API_KEY` and `WEATHERLINK_API_SECRET` environment variables. |
||||
|
#' @return data frame with a `generated_at` attribute |
||||
|
#' @references [API Endpoint](https://weatherlink.github.io/v2-api/api-reference); |
||||
|
#' [Data structure types](https://weatherlink.github.io/v2-api/data-structure-types) |
||||
|
#' @export |
||||
|
wl_stations <- function(api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET")) { |
||||
|
|
||||
|
list( |
||||
|
`api-key` = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
`t` = as.character(as.integer(Sys.time())) |
||||
|
) -> params |
||||
|
|
||||
|
digest::hmac( |
||||
|
key = Sys.getenv("WEATHERLINK_API_SECRET"), |
||||
|
object = paste(names(params), as.character(params), sep = "", collapse = ""), |
||||
|
algo = "sha256" |
||||
|
) -> params[["api-signature"]] |
||||
|
|
||||
|
httr::GET( |
||||
|
url = "https://api.weatherlink.com/v2/stations", |
||||
|
query = params, |
||||
|
.WEATHERLINK_UA |
||||
|
) -> res |
||||
|
|
||||
|
httr::stop_for_status(res) |
||||
|
|
||||
|
res <- httr::content(res, as = "text", encoding = "UTF-8") |
||||
|
|
||||
|
out <- jsonlite::fromJSON(res) |
||||
|
|
||||
|
attr(out$stations, "generated_at") <- anytime::anytime(out$generated_at) |
||||
|
|
||||
|
invisible(out$stations) |
||||
|
|
||||
|
} |
@ -1,9 +1,17 @@ |
|||||
#' ... |
#' Query and Orchestrate the Davis WeatherLink API |
||||
#' |
#' |
||||
|
#' Davis Instruments provides a public API (<https://weatherlink.github.io/v2-api/>) |
||||
|
#' for owners and users of their weather datalogger products. Tools are provided to query |
||||
|
#' and orchestrate the Davis WeatherLink API (V2) |
||||
|
#' |
||||
#' @md |
#' @md |
||||
#' @name weatherlink |
#' @name weatherlink |
||||
|
#' @references [API Endpoint](https://weatherlink.github.io/v2-api/api-reference); |
||||
|
#' [Data structure types](https://weatherlink.github.io/v2-api/data-structure-types) |
||||
#' @keywords internal |
#' @keywords internal |
||||
#' @author Bob Rudis (bob@@rud.is) |
#' @author Bob Rudis (bob@@rud.is) |
||||
#' @import httr |
#' @import httr |
||||
|
#' @importFrom digest hmac |
||||
|
#' @importFrom anytime anytime |
||||
#' @importFrom jsonlite fromJSON |
#' @importFrom jsonlite fromJSON |
||||
"_PACKAGE" |
"_PACKAGE" |
||||
|
@ -0,0 +1,86 @@ |
|||||
|
|
||||
|
[![Project Status: Active – The project has reached a stable, usable |
||||
|
state and is being actively |
||||
|
developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) |
||||
|
[![Signed |
||||
|
by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr) |
||||
|
![Signed commit |
||||
|
%](https://img.shields.io/badge/Signed_Commits-100%25-lightgrey.svg) |
||||
|
[![R-CMD-check](https://github.com/hrbrmstr/weatherlink/workflows/R-CMD-check/badge.svg)](https://github.com/hrbrmstr/weatherlink/actions?query=workflow%3AR-CMD-check) |
||||
|
[![Linux build |
||||
|
Status](https://travis-ci.org/hrbrmstr/weatherlink.svg?branch=batman)](https://travis-ci.org/hrbrmstr/weatherlink) |
||||
|
![Minimal R |
||||
|
Version](https://img.shields.io/badge/R%3E%3D-3.6.0-blue.svg) |
||||
|
![License](https://img.shields.io/badge/License-AGPL-blue.svg) |
||||
|
|
||||
|
# weatherlink |
||||
|
|
||||
|
Query and Orchestrate the Davis WeatherLink API |
||||
|
|
||||
|
## Description |
||||
|
|
||||
|
Davis Instruments provides a public API |
||||
|
(<https://weatherlink.github.io/v2-api/>) for owners and users of their |
||||
|
weather datalogger products. Tools are provided to query and orchestrate |
||||
|
the Davis WeatherLink API (V2). |
||||
|
|
||||
|
## What’s Inside The Tin |
||||
|
|
||||
|
The following functions are implemented: |
||||
|
|
||||
|
- `wl_conditions`: Get current conditions data for one station |
||||
|
- `wl_nodes`: Get all nodes attached to all weather stations |
||||
|
associated with your API Key |
||||
|
- `wl_sensor_activity`: Get latest reporting times for all sensors |
||||
|
attached to all weather stations associated with your API Key |
||||
|
- `wl_sensors`: Get a catalog of all types of sensors |
||||
|
- `wl_stations`: Get all weather stations associated with your API Key |
||||
|
|
||||
|
## TODO |
||||
|
|
||||
|
Add coverage for the following API endpoints: |
||||
|
|
||||
|
- `/stations/{station-ids}` |
||||
|
- `/nodes/{node-ids}` |
||||
|
- `/sensors/{sensor-ids}` |
||||
|
- `/sensor-activity/{sensor-ids}` |
||||
|
|
||||
|
## Installation |
||||
|
|
||||
|
``` r |
||||
|
remotes::install_git("https://git.rud.is/hrbrmstr/weatherlink.git") |
||||
|
# or |
||||
|
remotes::install_git("https://git.sr.ht/~hrbrmstr/weatherlink") |
||||
|
# or |
||||
|
remotes::install_bitbucket("hrbrmstr/weatherlink") |
||||
|
``` |
||||
|
|
||||
|
NOTE: To use the ‘remotes’ install options you will need to have the |
||||
|
[{remotes} package](https://github.com/r-lib/remotes) installed. |
||||
|
|
||||
|
## Usage |
||||
|
|
||||
|
``` r |
||||
|
library(weatherlink) |
||||
|
|
||||
|
# current version |
||||
|
packageVersion("weatherlink") |
||||
|
## [1] '0.1.0' |
||||
|
``` |
||||
|
|
||||
|
## weatherlink Metrics |
||||
|
|
||||
|
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) | |
||||
|
| :--- | -------: | ---: | --: | ---: | ----------: | ---: | -------: | ---: | |
||||
|
| R | 10 | 0.42 | 179 | 0.43 | 66 | 0.38 | 101 | 0.37 | |
||||
|
| YAML | 1 | 0.04 | 22 | 0.05 | 2 | 0.01 | 2 | 0.01 | |
||||
|
| Rmd | 1 | 0.04 | 8 | 0.02 | 18 | 0.10 | 34 | 0.12 | |
||||
|
| SUM | 12 | 0.50 | 209 | 0.50 | 86 | 0.50 | 137 | 0.50 | |
||||
|
|
||||
|
clock Package Metrics for weatherlink |
||||
|
|
||||
|
## Code of Conduct |
||||
|
|
||||
|
Please note that this project is released with a Contributor Code of |
||||
|
Conduct. By participating in this project you agree to abide by its |
||||
|
terms. |
@ -0,0 +1,42 @@ |
|||||
|
% Generated by roxygen2: do not edit by hand |
||||
|
% Please edit documentation in R/current-conditions.R, R/historic-conditions.R |
||||
|
\name{wl_conditions} |
||||
|
\alias{wl_conditions} |
||||
|
\title{Get current conditions data for one station} |
||||
|
\usage{ |
||||
|
wl_conditions( |
||||
|
station_id, |
||||
|
api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET") |
||||
|
) |
||||
|
|
||||
|
wl_conditions( |
||||
|
station_id, |
||||
|
api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET") |
||||
|
) |
||||
|
} |
||||
|
\arguments{ |
||||
|
\item{station_id}{(chr) Station id} |
||||
|
|
||||
|
\item{api_key, api_secret}{WeatherLink API (V2) key/secret. Generate & retrieve them from |
||||
|
\href{https://www.weatherlink.com/account}{your account page}. Automagically retrieved from |
||||
|
\code{WEATHERLINK_API_KEY} and \code{WEATHERLINK_API_SECRET} environment variables.} |
||||
|
} |
||||
|
\value{ |
||||
|
list ith a \code{generated_at} attribute |
||||
|
|
||||
|
list ith a \code{generated_at} attribute |
||||
|
} |
||||
|
\description{ |
||||
|
Returns current conditions data for a weather station selected by a station ID. |
||||
|
|
||||
|
Returns historic conditions data for a weather station selected by a station ID. |
||||
|
} |
||||
|
\references{ |
||||
|
\href{https://weatherlink.github.io/v2-api/api-reference}{API Endpoint}; |
||||
|
\href{https://weatherlink.github.io/v2-api/data-structure-types}{Data structure types} |
||||
|
|
||||
|
\href{https://weatherlink.github.io/v2-api/api-reference}{API Endpoint}; |
||||
|
\href{https://weatherlink.github.io/v2-api/data-structure-types}{Data structure types} |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
% Generated by roxygen2: do not edit by hand |
||||
|
% Please edit documentation in R/nodes.R |
||||
|
\name{wl_nodes} |
||||
|
\alias{wl_nodes} |
||||
|
\title{Get all nodes attached to all weather stations associated with your API Key} |
||||
|
\usage{ |
||||
|
wl_nodes( |
||||
|
api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET") |
||||
|
) |
||||
|
} |
||||
|
\arguments{ |
||||
|
\item{api_key, api_secret}{WeatherLink API (V2) key/secret. Generate & retrieve them from |
||||
|
\href{https://www.weatherlink.com/account}{your account page}. Automagically retrieved from |
||||
|
\code{WEATHERLINK_API_KEY} and \code{WEATHERLINK_API_SECRET} environment variables.} |
||||
|
} |
||||
|
\value{ |
||||
|
data frame with a \code{generated_at} attribute |
||||
|
} |
||||
|
\description{ |
||||
|
Returns data for all nodes attached to all gateways associated with the API Key passed in the query parameters. |
||||
|
Currently all nodes are returned in a single response. A future enhancement will provide pagination to reduce |
||||
|
the size of the response. |
||||
|
} |
||||
|
\references{ |
||||
|
\href{https://weatherlink.github.io/v2-api/api-reference}{API Endpoint}; |
||||
|
\href{https://weatherlink.github.io/v2-api/data-structure-types}{Data structure types} |
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
% Generated by roxygen2: do not edit by hand |
||||
|
% Please edit documentation in R/sensor-activity.R |
||||
|
\name{wl_sensor_activity} |
||||
|
\alias{wl_sensor_activity} |
||||
|
\title{Get latest reporting times for all sensors attached to all weather stations associated with your API Key} |
||||
|
\usage{ |
||||
|
wl_sensor_activity( |
||||
|
api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET") |
||||
|
) |
||||
|
} |
||||
|
\arguments{ |
||||
|
\item{api_key, api_secret}{WeatherLink API (V2) key/secret. Generate & retrieve them from |
||||
|
\href{https://www.weatherlink.com/account}{your account page}. Automagically retrieved from |
||||
|
\code{WEATHERLINK_API_KEY} and \code{WEATHERLINK_API_SECRET} environment variables.} |
||||
|
} |
||||
|
\value{ |
||||
|
data frame with a \code{generated_at} attribute |
||||
|
} |
||||
|
\description{ |
||||
|
Returns the most recent times data was uploaded for all sensors associated with the api key that was passed. T |
||||
|
} |
||||
|
\references{ |
||||
|
\href{https://weatherlink.github.io/v2-api/api-reference}{API Endpoint}; |
||||
|
\href{https://weatherlink.github.io/v2-api/data-structure-types}{Data structure types} |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
% Generated by roxygen2: do not edit by hand |
||||
|
% Please edit documentation in R/sensor-catalog.R, R/sensors.R |
||||
|
\name{wl_sensors} |
||||
|
\alias{wl_sensors} |
||||
|
\title{Get a catalog of all types of sensors} |
||||
|
\usage{ |
||||
|
wl_sensors( |
||||
|
api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET") |
||||
|
) |
||||
|
|
||||
|
wl_sensors( |
||||
|
api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET") |
||||
|
) |
||||
|
} |
||||
|
\arguments{ |
||||
|
\item{api_key, api_secret}{WeatherLink API (V2) key/secret. Generate & retrieve them from |
||||
|
\href{https://www.weatherlink.com/account}{your account page}. Automagically retrieved from |
||||
|
\code{WEATHERLINK_API_KEY} and \code{WEATHERLINK_API_SECRET} environment variables.} |
||||
|
} |
||||
|
\value{ |
||||
|
data frame with a \code{generated_at} attribute |
||||
|
|
||||
|
data frame with a \code{generated_at} attribute |
||||
|
} |
||||
|
\description{ |
||||
|
Returns a catalog of all available sensor types. |
||||
|
|
||||
|
Returns data for all sensors attached to all gateways associated with the API Key passed in the query parameters. |
||||
|
Currently all nodes are returned in a single response. A future enhancement will provide pagination to reduce |
||||
|
the size of the response. |
||||
|
} |
||||
|
\references{ |
||||
|
\href{https://weatherlink.github.io/v2-api/api-reference}{API Endpoint}; |
||||
|
\href{https://weatherlink.github.io/v2-api/data-structure-types}{Data structure types} |
||||
|
|
||||
|
\href{https://weatherlink.github.io/v2-api/api-reference}{API Endpoint}; |
||||
|
\href{https://weatherlink.github.io/v2-api/data-structure-types}{Data structure types} |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
% Generated by roxygen2: do not edit by hand |
||||
|
% Please edit documentation in R/stations.R |
||||
|
\name{wl_stations} |
||||
|
\alias{wl_stations} |
||||
|
\title{Get all weather stations associated with your API Key} |
||||
|
\usage{ |
||||
|
wl_stations( |
||||
|
api_key = Sys.getenv("WEATHERLINK_API_KEY"), |
||||
|
api_secret = Sys.getenv("WEATHERLINK_API_SECRET") |
||||
|
) |
||||
|
} |
||||
|
\arguments{ |
||||
|
\item{api_key, api_secret}{WeatherLink API (V2) key/secret. Generate & retrieve them from |
||||
|
\href{https://www.weatherlink.com/account}{your account page}. Automagically retrieved from |
||||
|
\code{WEATHERLINK_API_KEY} and \code{WEATHERLINK_API_SECRET} environment variables.} |
||||
|
} |
||||
|
\value{ |
||||
|
data frame with a \code{generated_at} attribute |
||||
|
} |
||||
|
\description{ |
||||
|
Returns data for all weather stations associated with the API Key passed in the query parameters. |
||||
|
Currently all stations are returned in a single response. A future enhancement will provide pagination |
||||
|
to reduce the size of the response. |
||||
|
} |
||||
|
\references{ |
||||
|
\href{https://weatherlink.github.io/v2-api/api-reference}{API Endpoint}; |
||||
|
\href{https://weatherlink.github.io/v2-api/data-structure-types}{Data structure types} |
||||
|
} |
Loading…
Reference in new issue