0.0.6 • Published 8 years ago
ambient-weather-api v0.0.6
Ambient Weather API
A simple wrapper for the forthcoming AmbientWeather.net API
Installation
npm install ambient-weather-apiGetting 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 astringof a singleapiKeyor anarrayof multipleapiKeys. Will listen for data on all the devices for all of the user'sapiKeyss. SeeEvent: subscribed&Event: dataunsubscribe-apiKeys- (required) can be astringof a singleapiKeyor anarrayof multipleapiKeys. Will stop listening for data on all of the user'sapiKeys devices. SeeEvent: subscribedEvent: subscribed- emitted when successfully subscribed to one or moreapiKeysusing thesubscribemethod. 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