Package Exports
- ambient-weather-api
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ambient-weather-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Ambient Weather API
A simple wrapper for the forthcoming AmbientWeather.net API
Installation
npm install ambient-weather-api
Getting Started
const api = new AmbientWeatherApi({
apiKey: 'Put your AW apiKey here',
applicationKey: 'Put your AW applicationKey here'
})
REST Methods
userDevices()
- list the user's devices@return
- Promise containing array of device objects
deviceData(macAddress, options)
- fetch data for a specific devicemacAddress
- (required)options
- limit, endDate see docs@return
- Promise containing array of data objects
Realtime Methods
connect
- connect to the realtime APIdisconnect
- disconnect from the realtime APIsubscribe
-apiKeys
- (required) can be astring
of a singleapiKey
or anarray
of multipleapiKey
s. Will listen for data on all the devices for all of the user'sapiKeys
s. SeeEvent: subscribed
&Event: data
unsubscribe
-apiKeys
- (required) can be astring
of a singleapiKey
or anarray
of multipleapiKey
s. Will stop listening for data on all of the user'sapiKey
s devices. SeeEvent: subscribed
Event: subscribed
- emitted when successfully subscribed to one or moreapiKeys
using thesubscribe
method. This event is also emitted after sucessfully unsubscribing. It will list all the currently subscribed devicesdata.devices
- array of device objects currently subscribed to
Event: data
- emitted on new data for a subscribed devicedata
- the weather data pointdata.device
- the device that data point is for